diff options
author | Guy Harris <guy@alum.mit.edu> | 2011-11-21 06:26:03 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2011-11-21 06:26:03 +0000 |
commit | 272c011d197ad04137d6d1d8d5c86ed8b93f61b4 (patch) | |
tree | 3bbebcfa10cec1edddeda5c768754af6046ebb93 /mergecap.c | |
parent | f2e8579ba375ef960209214fe432afd3bb3f83b1 (diff) |
On an I/O error, merge_read_packet() and merge_append_read_packet() need
to return a pointer to the merge_in_file_t that got the error. Set *err
to 0 on success and an error code on an err, treat a null return as an
EOF indication, and if we don't get a null return check for a non-zero
error code and treat that as an I/O error.
svn path=/trunk/; revision=39964
Diffstat (limited to 'mergecap.c')
-rw-r--r-- | mergecap.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/mergecap.c b/mergecap.c index 51e64464c8..91b956d3d8 100644 --- a/mergecap.c +++ b/mergecap.c @@ -351,8 +351,13 @@ main(int argc, char *argv[]) in_file = merge_read_packet(in_file_count, in_files, &read_err, &err_info); if (in_file == NULL) { - if (read_err != 0) - got_read_error = TRUE; + /* EOF */ + break; + } + + if (read_err != 0) { + /* I/O error reading from in_file */ + got_read_error = TRUE; break; } |