diff options
author | Sachidananda <sac@gluster.com> | 2011-02-11 02:08:55 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2011-02-17 11:32:18 -0800 |
commit | fc63f24904b14aaad338aa44107cbda7e547e6b1 (patch) | |
tree | cec58d6dab826ac2dad6926c20cd96c5f92a06e3 | |
parent | de44838d514e1f83a81dcff9438adbbb268ef981 (diff) |
Check correct variable after function call.
And some white space cleanups.
Signed-off-by: Sachidananda Urs <sac@gluster.com>
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
BUG: 2410 (Wrong variable checked after a function call)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2410
-rw-r--r-- | libglusterfs/src/logging.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/libglusterfs/src/logging.c b/libglusterfs/src/logging.c index 5b89aafb490..78bd1d6103f 100644 --- a/libglusterfs/src/logging.c +++ b/libglusterfs/src/logging.c @@ -172,14 +172,14 @@ struct _log_msg { -void +void gf_log_lock (void) { pthread_mutex_lock (&logfile_mutex); } -void +void gf_log_unlock (void) { pthread_mutex_unlock (&logfile_mutex); @@ -413,7 +413,7 @@ log: { va_start (ap, fmt); - strftime (timestr, 256, "%Y-%m-%d %H:%M:%S", tm); + strftime (timestr, 256, "%Y-%m-%d %H:%M:%S", tm); snprintf (timestr + strlen (timestr), 256 - strlen (timestr), ".%"GF_PRI_SUSECONDS, tv.tv_usec); @@ -505,7 +505,7 @@ client_log_init (struct _client_log *cl, char *identifier) } cl->file = fopen (path, "a"); GF_FREE (path); - + INIT_LIST_HEAD (&cl->list); } @@ -560,17 +560,17 @@ gf_log_from_client (const char *msg, char *identifier) } int -gf_cmd_log_init (const char *filename) +gf_cmd_log_init (const char *filename) { if (!filename){ - gf_log ("glusterd",GF_LOG_CRITICAL, "gf_cmd_log_init: no " + gf_log ("glusterd", GF_LOG_CRITICAL, "gf_cmd_log_init: no " "filename specified\n"); return -1; } cmd_log_filename = gf_strdup (filename); - if (!filename) { - gf_log ("glusterd",GF_LOG_CRITICAL, "gf_cmd_log_init: strdup" + if (!cmd_log_filename) { + gf_log ("glusterd", GF_LOG_CRITICAL, "gf_cmd_log_init: strdup" " error\n"); return -1; } @@ -653,5 +653,4 @@ out: FREE (str2); return (0); - } |