summaryrefslogtreecommitdiffstats
path: root/lib/util/debug.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2014-07-29 15:31:48 +0000
committerMichael Adam <obnox@samba.org>2014-07-31 18:49:47 +0200
commit1929b1fa20a43a1c78d08e0c28523f00da9a3411 (patch)
tree3deb7df124c0f90207b13f1555e21d7b889adfdf /lib/util/debug.c
parent44c77e80326c17a80c70140ee1b64a8847a4f779 (diff)
downloadsamba-1929b1fa20a43a1c78d08e0c28523f00da9a3411.tar.gz
samba-1929b1fa20a43a1c78d08e0c28523f00da9a3411.tar.xz
samba-1929b1fa20a43a1c78d08e0c28523f00da9a3411.zip
debug: Only call Debug1 once 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.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/util/debug.c b/lib/util/debug.c
index f94f44310f..9fdad54edb 100644
--- a/lib/util/debug.c
+++ b/lib/util/debug.c
@@ -1036,14 +1036,17 @@ bool dbghdrclass(int level, int cls, const char *location, const char *func)
classname_table[cls]);
}
- /* Print it all out at once to prevent split syslog output. */
- if( state.settings.debug_prefix_timestamp ) {
- (void)Debug1("%s] ", header_str);
- } else {
- (void)Debug1("%s] %s(%s)\n",
- header_str, location, func );
+ strlcat(header_str, "] ", sizeof(header_str));
+
+ if (!state.settings.debug_prefix_timestamp) {
+ size_t hs_len = strlen(header_str);
+ snprintf(header_str + hs_len,
+ sizeof(header_str) - hs_len,
+ "%s(%s)\n", location, func);
}
+ (void)Debug1("%s", header_str);
+
errno = old_errno;
return( true );
}