diff options
author | Volker Lendecke <vl@samba.org> | 2014-07-29 15:06:17 +0000 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2014-07-31 18:49:47 +0200 |
commit | 601b2b04530445344255992ebf6fb08a5ccf6eaa (patch) | |
tree | 42f8b7eace1ff5106a88cad3a15f481e94acffa0 /lib/util/debug.c | |
parent | 15b0f57696cf8c1ae1c8760008b414f9a456bc49 (diff) | |
download | samba-601b2b04530445344255992ebf6fb08a5ccf6eaa.tar.gz samba-601b2b04530445344255992ebf6fb08a5ccf6eaa.tar.xz samba-601b2b04530445344255992ebf6fb08a5ccf6eaa.zip |
debug: Use timeval_str_buf in dbghdrclass
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'lib/util/debug.c')
-rw-r--r-- | lib/util/debug.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/lib/util/debug.c b/lib/util/debug.c index 6dbf906177..5d202ef8be 100644 --- a/lib/util/debug.c +++ b/lib/util/debug.c @@ -971,6 +971,8 @@ bool dbghdrclass(int level, int cls, const char *location, const char *func) int old_errno = errno; bool verbose = false; char header_str[200]; + struct timeval tv; + struct timeval_buf tvbuf; if( format_pos ) { /* This is a fudge. If there is stuff sitting in the format_bufr, then @@ -1028,21 +1030,18 @@ bool dbghdrclass(int level, int cls, const char *location, const char *func) classname_table[cls]); } + GetTimeOfDay(&tv); + timeval_str_buf(&tv, state.settings.debug_hires_timestamp, &tvbuf); + /* Print it all out at once to prevent split syslog output. */ if( state.settings.debug_prefix_timestamp ) { - char *time_str = current_timestring(NULL, - state.settings.debug_hires_timestamp); - (void)Debug1( "[%s, %2d%s] ", - time_str, - level, header_str); - talloc_free(time_str); + (void)Debug1("[%s, %2d%s] ", + tvbuf.buf, + level, header_str); } else { - char *time_str = current_timestring(NULL, - state.settings.debug_hires_timestamp); - (void)Debug1( "[%s, %2d%s] %s(%s)\n", - time_str, - level, header_str, location, func ); - talloc_free(time_str); + (void)Debug1("[%s, %2d%s] %s(%s)\n", + tvbuf.buf, + level, header_str, location, func ); } errno = old_errno; |