From c175e066b228c13d8947c0da0de554fbe64e3895 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Mon, 24 Apr 2006 16:01:33 +0000 Subject: r15212: Simplify setproctitle code (This used to be commit 555ca1df1c57e5798e75b19f66b62b253a066e21) --- source4/smbd/process_standard.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'source4/smbd/process_standard.c') diff --git a/source4/smbd/process_standard.c b/source4/smbd/process_standard.c index e1affbbf892..e77985253b9 100644 --- a/source4/smbd/process_standard.c +++ b/source4/smbd/process_standard.c @@ -35,10 +35,11 @@ #include "passdb/secrets.h" #ifdef HAVE_SETPROCTITLE +#ifdef HAVE_SETPROCTITLE_H #include -#define SETPROCTITLE(x) setproctitle x +#endif #else -#define SETPROCTITLE(x) +#define setproctitle(x) #endif /* @@ -119,7 +120,7 @@ static void standard_accept_connection(struct event_context *ev, c = socket_get_peer_addr(sock2, ev2); s = socket_get_my_addr(sock2, ev2); if (s && c) { - SETPROCTITLE(("conn c[%s:%u] s[%s:%u] server_id[%d]", + setproctitle(("conn c[%s:%u] s[%s:%u] server_id[%d]", c->addr, c->port, s->addr, s->port, pid)); } talloc_free(c); @@ -176,7 +177,7 @@ static void standard_new_task(struct event_context *ev, /* Ensure that the forked children do not expose identical random streams */ set_need_random_reseed(); - SETPROCTITLE(("task server_id[%d]", pid)); + setproctitle(("task server_id[%d]", pid)); /* setup this new connection */ new_task(ev2, pid, private); @@ -213,9 +214,9 @@ static void standard_terminate(struct event_context *ev, const char *reason) static void standard_set_title(struct event_context *ev, const char *title) { if (title) { - SETPROCTITLE(("%s", title)); + setproctitle(("%s", title)); } else { - SETPROCTITLE((NULL)); + setproctitle((NULL)); } } -- cgit v1.2.1