From d721b8d86b2f2355bd74c13da010843afcd8c3d2 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 31 Mar 2017 12:00:29 -0700 Subject: [PATCH] s4: server: Use server_state as a parameter to max_runtime_handler, not just name. Signed-off-by: Jeremy Allison Reviewed-by: Volker Lendecke --- source4/smbd/server.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source4/smbd/server.c b/source4/smbd/server.c index 97f0c02cac6..96f9d9d2347 100644 --- a/source4/smbd/server.c +++ b/source4/smbd/server.c @@ -189,10 +189,11 @@ _NORETURN_ static void max_runtime_handler(struct tevent_context *ev, struct tevent_timer *te, struct timeval t, void *private_data) { - const char *binary_name = (const char *)private_data; + struct server_state *state = talloc_get_type_abort( + private_data, struct server_state); DEBUG(0,("%s: maximum runtime exceeded - " "terminating PID %d at %llu, current ts: %llu\n", - binary_name, + state->binary_name, (int)getpid(), (unsigned long long)t.tv_sec, (unsigned long long)time(NULL))); @@ -509,7 +510,7 @@ static int binary_smbd_main(const char *binary_name, tevent_add_timer(state->event_ctx, state->event_ctx, timeval_current_ofs(max_runtime, 0), max_runtime_handler, - discard_const(binary_name)); + state); } if (lpcfg_server_role(cmdline_lp_ctx) != ROLE_ACTIVE_DIRECTORY_DC -- 2.34.1