diff options
Diffstat (limited to 'source/utils/smbcontrol.c')
-rw-r--r-- | source/utils/smbcontrol.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/source/utils/smbcontrol.c b/source/utils/smbcontrol.c index 9ca304c62bd..ec1e101e061 100644 --- a/source/utils/smbcontrol.c +++ b/source/utils/smbcontrol.c @@ -59,7 +59,8 @@ static BOOL send_message(struct process_id pid, int msg_type, return False; if (procid_to_pid(&pid) != 0) - return message_send_pid(pid, msg_type, buf, len, duplicates); + return NT_STATUS_IS_OK(message_send_pid(pid, msg_type, buf, len, + duplicates)); tdb = tdb_open_log(lock_path("connections.tdb"), 0, TDB_DEFAULT, O_RDWR, 0); @@ -98,7 +99,8 @@ static void wait_replies(BOOL multiple_replies) /* Message handler callback that displays the PID and a string on stdout */ -static void print_pid_string_cb(int msg_type, struct process_id pid, void *buf, size_t len) +static void print_pid_string_cb(int msg_type, struct process_id pid, void *buf, + size_t len, void *private_data) { printf("PID %u: %.*s", (unsigned int)procid_to_pid(&pid), (int)len, (const char *)buf); @@ -108,7 +110,7 @@ static void print_pid_string_cb(int msg_type, struct process_id pid, void *buf, /* Message handler callback that displays a string on stdout */ static void print_string_cb(int msg_type, struct process_id pid, - void *buf, size_t len) + void *buf, size_t len, void *private_data) { printf("%.*s", (int)len, (const char *)buf); num_replies++; @@ -371,7 +373,8 @@ static BOOL do_election(const struct process_id pid, /* Ping a samba daemon process */ -static void pong_cb(int msg_type, struct process_id pid, void *buf, size_t len) +static void pong_cb(int msg_type, struct process_id pid, void *buf, + size_t len, void *private_data) { char *src_string = procid_str(NULL, &pid); printf("PONG from pid %s\n", src_string); @@ -391,7 +394,7 @@ static BOOL do_ping(const struct process_id pid, const int argc, const char **ar if (!send_message(pid, MSG_PING, NULL, 0, False)) return False; - message_register(MSG_PONG, pong_cb); + message_register(MSG_PONG, pong_cb, NULL); wait_replies(procid_to_pid(&pid) == 0); @@ -436,7 +439,8 @@ static BOOL do_profile(const struct process_id pid, /* Return the profiling level */ -static void profilelevel_cb(int msg_type, struct process_id pid, void *buf, size_t len) +static void profilelevel_cb(int msg_type, struct process_id pid, void *buf, + size_t len, void *private_data) { int level; const char *s; @@ -473,7 +477,7 @@ static void profilelevel_cb(int msg_type, struct process_id pid, void *buf, size } static void profilelevel_rqst(int msg_type, struct process_id pid, - void *buf, size_t len) + void *buf, size_t len, void *private_data) { int v = 0; @@ -495,8 +499,8 @@ static BOOL do_profilelevel(const struct process_id pid, if (!send_message(pid, MSG_REQ_PROFILELEVEL, NULL, 0, False)) return False; - message_register(MSG_PROFILELEVEL, profilelevel_cb); - message_register(MSG_REQ_PROFILELEVEL, profilelevel_rqst); + message_register(MSG_PROFILELEVEL, profilelevel_cb, NULL); + message_register(MSG_REQ_PROFILELEVEL, profilelevel_rqst, NULL); wait_replies(procid_to_pid(&pid) == 0); @@ -525,7 +529,7 @@ static BOOL do_debuglevel(const struct process_id pid, if (!send_message(pid, MSG_REQ_DEBUGLEVEL, NULL, 0, False)) return False; - message_register(MSG_DEBUGLEVEL, print_pid_string_cb); + message_register(MSG_DEBUGLEVEL, print_pid_string_cb, NULL); wait_replies(procid_to_pid(&pid) == 0); @@ -732,7 +736,7 @@ static BOOL do_poolusage(const struct process_id pid, return False; } - message_register(MSG_POOL_USAGE, print_string_cb); + message_register(MSG_POOL_USAGE, print_string_cb, NULL); /* Send a message and register our interest in a reply */ @@ -923,7 +927,7 @@ static BOOL do_winbind_onlinestatus(const struct process_id pid, return False; } - message_register(MSG_WINBIND_ONLINESTATUS, print_pid_string_cb); + message_register(MSG_WINBIND_ONLINESTATUS, print_pid_string_cb, NULL); if (!send_message(pid, MSG_WINBIND_ONLINESTATUS, &myid, sizeof(myid), False)) return False; |