Skip to content

Commit 0fec26b

Browse files
committed
util: Make ovs_error() understand that EOF means "end of file".
This convention is in use in a few places in the source tree, and so it seems to be about time to start putting it into central places.
1 parent d918d9d commit 0fec26b

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/util.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,10 @@ ovs_error(int err_no, const char *format, ...)
168168
va_start(args, format);
169169
vfprintf(stderr, format, args);
170170
va_end(args);
171-
if (err_no != 0)
172-
fprintf(stderr, " (%s)", strerror(err_no));
171+
if (err_no != 0) {
172+
fprintf(stderr, " (%s)",
173+
err_no == EOF ? "end of file" : strerror(err_no));
174+
}
173175
putc('\n', stderr);
174176

175177
errno = save_errno;

0 commit comments

Comments
 (0)