X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=lib%2Fvlog.c;h=b534d196525dfce984c7fb2280056452138f617d;hb=7e56c85c02c547deda93ec09a589eae7e253fc58;hp=97a930aca5d1c8fad65b615b2c344fa89aec4964;hpb=34e63086edddcae06d7c1a4fa84fec0861e50758;p=openvswitch diff --git a/lib/vlog.c b/lib/vlog.c index 97a930ac..b534d196 100644 --- a/lib/vlog.c +++ b/lib/vlog.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009 Nicira Networks. + * Copyright (c) 2008, 2009, 2010 Nicira Networks. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -314,7 +314,7 @@ vlog_reopen_log_file(void) char * vlog_set_levels_from_string(const char *s_) { - char *save_ptr; + char *save_ptr = NULL; char *s = xstrdup(s_); char *module, *facility; @@ -385,7 +385,8 @@ vlog_set_verbosity(const char *arg) } static void -vlog_unixctl_set(struct unixctl_conn *conn, const char *args) +vlog_unixctl_set(struct unixctl_conn *conn, + const char *args, void *aux OVS_UNUSED) { char *msg = vlog_set_levels_from_string(args); unixctl_command_reply(conn, msg ? 501 : 202, msg); @@ -393,7 +394,8 @@ vlog_unixctl_set(struct unixctl_conn *conn, const char *args) } static void -vlog_unixctl_list(struct unixctl_conn *conn, const char *args UNUSED) +vlog_unixctl_list(struct unixctl_conn *conn, + const char *args OVS_UNUSED, void *aux OVS_UNUSED) { char *msg = vlog_get_levels(); unixctl_command_reply(conn, 200, msg); @@ -401,7 +403,8 @@ vlog_unixctl_list(struct unixctl_conn *conn, const char *args UNUSED) } static void -vlog_unixctl_reopen(struct unixctl_conn *conn, const char *args UNUSED) +vlog_unixctl_reopen(struct unixctl_conn *conn, + const char *args OVS_UNUSED, void *aux OVS_UNUSED) { if (log_file_name) { int error = vlog_reopen_log_file(); @@ -435,9 +438,9 @@ vlog_init(void) VLOG_ERR("current time is negative: %s (%ld)", s, (long int) now); } - unixctl_command_register("vlog/set", vlog_unixctl_set); - unixctl_command_register("vlog/list", vlog_unixctl_list); - unixctl_command_register("vlog/reopen", vlog_unixctl_reopen); + unixctl_command_register("vlog/set", vlog_unixctl_set, NULL); + unixctl_command_register("vlog/list", vlog_unixctl_list, NULL); + unixctl_command_register("vlog/reopen", vlog_unixctl_reopen, NULL); } /* Closes the logging subsystem. */ @@ -522,7 +525,7 @@ format_log_message(enum vlog_module module, enum vlog_level level, p++; } field = 0; - while (isdigit(*p)) { + while (isdigit((unsigned char)*p)) { field = (field * 10) + (*p - '0'); p++; }