mirror of
https://github.com/openvswitch/ovs
synced 2025-08-30 22:05:19 +00:00
pcap-file: Improve error logging.
There is no reason to log end of file as an error, but that's what this code was doing. Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
@@ -114,10 +114,14 @@ pcap_read(FILE *file, struct ofpbuf **bufp)
|
||||
|
||||
/* Read header. */
|
||||
if (fread(&prh, sizeof prh, 1, file) != 1) {
|
||||
int error = ferror(file) ? errno : EOF;
|
||||
VLOG_WARN("failed to read pcap record header: %s",
|
||||
ovs_retval_to_string(error));
|
||||
return error;
|
||||
if (ferror(file)) {
|
||||
int error = errno;
|
||||
VLOG_WARN("failed to read pcap record header: %s",
|
||||
ovs_retval_to_string(error));
|
||||
return error;
|
||||
} else {
|
||||
return EOF;
|
||||
}
|
||||
}
|
||||
|
||||
/* Calculate length. */
|
||||
|
Reference in New Issue
Block a user