From: Ben Pfaff Date: Wed, 8 Apr 2009 20:46:20 +0000 (-0700) Subject: vlog: Make vlog_reopen_log_file() a no-op if no log file is open. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ddba16a7f4ce63117f10feb256f907bae29c1cad;p=openvswitch vlog: Make vlog_reopen_log_file() a no-op if no log file is open. The --log-file option is supposed to be used to create a log file, but until now, even if this isn't done, --reopen to the vlogconf program will make it open one. This behavior was unexpected, hence this commit that prevents it from happening. Fixes bug #905. --- diff --git a/lib/vlog.c b/lib/vlog.c index 64dc1966..63d274cc 100644 --- a/lib/vlog.c +++ b/lib/vlog.c @@ -317,7 +317,7 @@ vlog_set_log_file(const char *file_name) int vlog_reopen_log_file(void) { - return vlog_set_log_file(log_file_name); + return log_file_name ? vlog_set_log_file(log_file_name) : 0; } /* Set debugging levels: