int messaging_read_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
struct messaging_rec **presult);
+int messaging_cleanup(struct messaging_context *msg_ctx, pid_t pid);
+
bool messaging_parent_dgm_cleanup_init(struct messaging_context *msg);
#include "librpc/gen_ndr/ndr_messaging.h"
tevent_req_set_callback(req, mess_parent_dgm_cleanup_done, msg);
}
+int messaging_cleanup(struct messaging_context *msg_ctx, pid_t pid)
+{
+ int ret;
+
+ if (pid == 0) {
+ ret = messaging_dgm_wipe(msg_ctx);
+ } else {
+ ret = messaging_dgm_cleanup(msg_ctx, pid);
+ }
+
+ return ret;
+}
+
struct messaging_backend *messaging_local_backend(
struct messaging_context *msg_ctx)
{
return num_replies;
}
-static bool do_dgm_cleanup(struct tevent_context *ev_ctx,
+static bool do_msg_cleanup(struct tevent_context *ev_ctx,
struct messaging_context *msg_ctx,
const struct server_id pid,
const int argc, const char **argv)
{
int ret;
- if (pid.pid != 0) {
- ret = messaging_dgm_cleanup(msg_ctx, pid.pid);
- } else {
- ret = messaging_dgm_wipe(msg_ctx);
- }
+ ret = messaging_cleanup(msg_ctx, pid.pid);
printf("cleanup(%u) returned %s\n", (unsigned)pid.pid,
ret ? strerror(ret) : "ok");
{ "notify-cleanup", do_notify_cleanup },
{ "num-children", do_num_children,
"Print number of smbd child processes" },
- { "dgm-cleanup", do_dgm_cleanup },
+ { "msg-cleanup", do_msg_cleanup },
{ "noop", do_noop, "Do nothing" },
{ NULL }
};