summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-04-24 16:01:33 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:04:19 -0500
commitc175e066b228c13d8947c0da0de554fbe64e3895 (patch)
tree31d767b2a5e0cb21330dbe70e89d5c5298f31505 /source4
parent5027cd85c19bf42577ba0bf9e1037e7924b8b2cc (diff)
downloadsamba-c175e066b228c13d8947c0da0de554fbe64e3895.tar.gz
samba-c175e066b228c13d8947c0da0de554fbe64e3895.tar.bz2
samba-c175e066b228c13d8947c0da0de554fbe64e3895.zip
r15212: Simplify setproctitle code
(This used to be commit 555ca1df1c57e5798e75b19f66b62b253a066e21)
Diffstat (limited to 'source4')
-rw-r--r--source4/smbd/process_standard.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/source4/smbd/process_standard.c b/source4/smbd/process_standard.c
index e1affbbf89..e77985253b 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 <setproctitle.h>
-#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));
}
}