summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNikolai Kondrashov <Nikolai.Kondrashov@redhat.com>2014-01-10 13:00:42 +0200
committerJakub Hrozek <jhrozek@redhat.com>2014-05-02 10:58:10 +0200
commit38e51a251fe4f76fd26f6f50948d57487bc5988d (patch)
tree1bd6688ccd75856a63e6314341e8bda7666fc49f
parent7f3b9e09ff4664ef86b44ef0f89f40bbcaecfbce (diff)
downloadsssd-38e51a251fe4f76fd26f6f50948d57487bc5988d.tar.gz
sssd-38e51a251fe4f76fd26f6f50948d57487bc5988d.tar.xz
sssd-38e51a251fe4f76fd26f6f50948d57487bc5988d.zip
Cleanup debug_fn
Cleanup debug_fn to better match coding conventions. Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> Reviewed-by: Stephen Gallagher <sgallagh@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com> (cherry picked from commit 1eedbd1bd2037437f5b9aed1f4061af396ef6733)
-rw-r--r--src/util/debug.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/util/debug.c b/src/util/debug.c
index a42623f1a..4c49dc662 100644
--- a/src/util/debug.c
+++ b/src/util/debug.c
@@ -131,11 +131,12 @@ static void debug_printf(const char *format, ...)
void debug_fn(const char *function, int newlevel, const char *format, ...)
{
va_list ap;
+ struct timeval tv;
+ struct tm *tm;
+ char datetime[20];
+ int year;
+
if (debug_timestamps) {
- struct timeval tv;
- struct tm *tm;
- char datetime[20];
- int year;
gettimeofday(&tv, NULL);
tm = localtime(&tv.tv_sec);
year = tm->tm_year + 1900;
@@ -156,6 +157,7 @@ void debug_fn(const char *function, int newlevel, const char *format, ...)
debug_printf("[%s] [%s] (%#.4x): ",
debug_prg_name, function, newlevel);
}
+
va_start(ap, format);
debug_vprintf(format, ap);
va_end(ap);