From: Ben Pfaff Date: Fri, 27 Jun 2008 21:16:53 +0000 (-0700) Subject: Fix -v, --verbose options to userspace programs. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c44bef2f6ec77d20e97e26decfb5335c6c110679;p=openvswitch Fix -v, --verbose options to userspace programs. Now providing an argument to these options works as documented. --- diff --git a/lib/vlog.c b/lib/vlog.c index 63162723..17f20a2c 100644 --- a/lib/vlog.c +++ b/lib/vlog.c @@ -232,12 +232,16 @@ vlog_set_levels_from_string(const char *s_) } /* If 'arg' is null, configure maximum verbosity. Otherwise, sets - * configuration according to 'arg' (see vlog_set_levels_from_string()). If - * parsing fails, default to maximum verbosity. */ + * configuration according to 'arg' (see vlog_set_levels_from_string()). */ void vlog_set_verbosity(const char *arg) { - if (arg == NULL || !vlog_set_levels_from_string(arg)) { + if (arg) { + char *msg = vlog_set_levels_from_string(arg); + if (msg) { + fatal(0, "processing \"%s\": %s", arg, msg); + } + } else { vlog_set_levels(VLM_ANY_MODULE, VLF_CONSOLE, VLL_DBG); } }