summaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
authorNikolai Kondrashov <Nikolai.Kondrashov@redhat.com>2014-01-10 13:00:42 +0200
committerJakub Hrozek <jhrozek@redhat.com>2014-02-12 22:30:50 +0100
commit1eedbd1bd2037437f5b9aed1f4061af396ef6733 (patch)
treeb0cc83d6a556d8b88c0274fb5807dcf3b99c2710 /src/util
parent63ec0cbd668b251708fad23b60cf557163963dc4 (diff)
downloadsssd-1eedbd1bd2037437f5b9aed1f4061af396ef6733.tar.gz
sssd-1eedbd1bd2037437f5b9aed1f4061af396ef6733.tar.xz
sssd-1eedbd1bd2037437f5b9aed1f4061af396ef6733.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>
Diffstat (limited to 'src/util')
-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);