Skip to content

Commit

Permalink
vlog: exit with error if explicitly specified logfile cannot be opened
Browse files Browse the repository at this point in the history
It seems like if the user wanted a specific logfile but that request
cannot be fulfilled, OVS/OVN shouldn't just continue as if nothing
really happened (besides logging a warning).

Signed-off-by: Dan Williams <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
dcbw authored and blp committed May 25, 2018
1 parent 34d598d commit dd8ff6c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions include/openvswitch/vlog.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,15 @@ void vlog_rate_limit(const struct vlog_module *, enum vlog_level,
case 'v': \
vlog_set_verbosity(optarg); \
break; \
case OPT_LOG_FILE: \
vlog_set_log_file(optarg); \
case OPT_LOG_FILE: { \
int err = vlog_set_log_file(optarg);\
/* Exit if logfile explicitly given \
* but cannot be opened. */ \
if (err && optarg) { \
exit(EXIT_FAILURE); \
} \
break; \
} \
case OPT_SYSLOG_IMPL: \
vlog_set_syslog_method(optarg); \
break; \
Expand Down

0 comments on commit dd8ff6c

Please sign in to comment.