diff options
author | Herb Lewis <herb@samba.org> | 2004-04-29 23:05:58 +0000 |
---|---|---|
committer | Herb Lewis <herb@samba.org> | 2004-04-29 23:05:58 +0000 |
commit | dce54a330156e6fa63f9c36d0fad1983e8cc735d (patch) | |
tree | 424ec011a76e3dc82737f488eeaad14685739c02 /source/utils | |
parent | f1040f57692c3f182ee3abc970dce7f2443e7265 (diff) | |
download | samba-dce54a330156e6fa63f9c36d0fad1983e8cc735d.tar.gz |
r416: add a newline to the debuglevel message returned string
and have smbcontrol print the PID with it
Diffstat (limited to 'source/utils')
-rw-r--r-- | source/utils/smbcontrol.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/source/utils/smbcontrol.c b/source/utils/smbcontrol.c index 8a27684a4d3..2eb661c8b68 100644 --- a/source/utils/smbcontrol.c +++ b/source/utils/smbcontrol.c @@ -82,6 +82,14 @@ static void wait_replies(BOOL multiple_replies) } while (timeout - (time(NULL) - start_time) > 0); } +/* Message handler callback that displays the PID and a string on stdout */ + +static void print_pid_string_cb(int msg_type, pid_t pid, void *buf, size_t len) +{ + printf("PID %u: %.*s", (unsigned int)pid, (int)len, (const char *)buf); + num_replies++; +} + /* Message handler callback that displays a string on stdout */ static void print_string_cb(int msg_type, pid_t pid, void *buf, size_t len) @@ -281,7 +289,7 @@ static BOOL do_debuglevel(const pid_t pid, const int argc, const char **argv) if (!send_message(pid, MSG_REQ_DEBUGLEVEL, NULL, 0, False)) return False; - message_register(MSG_DEBUGLEVEL, print_string_cb); + message_register(MSG_DEBUGLEVEL, print_pid_string_cb); wait_replies(pid == 0); |