Fix multi-packet packet-based metadata
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 17 May 2011 13:06:10 +0000 (09:06 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 17 May 2011 13:06:10 +0000 (09:06 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
formats/ctf/ctf.c

index ac064b809995ea72e06e84b85821292d6351e873..13c87eae176651fe97b1fd0c25d3871e5f02f6a4 100644 (file)
@@ -465,11 +465,7 @@ int ctf_open_trace_metadata_packet_read(struct ctf_trace *td, FILE *in,
                }
                toread -= readlen;
                if (!toread) {
-                       ret = -EOF;
-                       break;
-               }
-               if (feof(in)) {
-                       ret = -EINVAL;
+                       ret = 0;        /* continue reading next packet */
                        break;
                }
        }
@@ -491,10 +487,11 @@ int ctf_open_trace_metadata_stream_read(struct ctf_trace *td, FILE **fp,
 
        for (;;) {
                ret = ctf_open_trace_metadata_packet_read(td, in, out);
-               if (ret == -EOF) {
-                       ret = 0;
+               if (ret) {
                        break;
-               } else if (ret) {
+               }
+               if (feof(in)) {
+                       ret = 0;
                        break;
                }
        }
This page took 0.024737 seconds and 4 git commands to generate.