diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-04-26 12:15:01 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:05:00 -0500 |
commit | 7ffe0fcaee413de96ec9c3d4fdeaab6c2f106578 (patch) | |
tree | df7802147810c6dda82989c02d435f4ccf296343 /source4 | |
parent | b6063c6732b6d3c2330dcfb62085b4227fbdc571 (diff) | |
download | samba-7ffe0fcaee413de96ec9c3d4fdeaab6c2f106578.tar.gz samba-7ffe0fcaee413de96ec9c3d4fdeaab6c2f106578.tar.bz2 samba-7ffe0fcaee413de96ec9c3d4fdeaab6c2f106578.zip |
r15273: fix setproctitle support
metze
(This used to be commit 35936fd4743554bb4ba9b2f61ec3651762189bee)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/smbd/process_standard.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/source4/smbd/process_standard.c b/source4/smbd/process_standard.c index e77985253b..f5dda11680 100644 --- a/source4/smbd/process_standard.c +++ b/source4/smbd/process_standard.c @@ -39,7 +39,11 @@ #include <setproctitle.h> #endif #else -#define setproctitle(x) +static int setproctitle(const char *fmt, ...) PRINTF_ATTRIBUTE(1, 2); +static int setproctitle(const char *fmt, ...) +{ + return 0; +} #endif /* @@ -120,8 +124,8 @@ 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]", - c->addr, c->port, s->addr, s->port, pid)); + setproctitle("conn c[%s:%u] s[%s:%u] server_id[%d]", + c->addr, c->port, s->addr, s->port, pid); } talloc_free(c); talloc_free(s); @@ -177,7 +181,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); @@ -214,9 +218,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); } } |