summaryrefslogtreecommitdiffstats
path: root/src/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2020-10-09 20:21:52 +0100
committerRoy Marples <roy@marples.name>2020-10-09 20:21:52 +0100
commit86df6737c2a944db5d6c01c65d3586ef72e40636 (patch)
treedc99c0d1e9e6198da84bfe2979ff9ede49137b2d /src/dhcpcd.c
parent908b028ca6c944774454eb37e7c286d79691ecba (diff)
downloaddhcpcd-86df6737c2a944db5d6c01c65d3586ef72e40636.tar.xz
compat: Use libbsd's setproctitle(3)
Linux PRCTL variant, although more light weight, doesn't work on some kernels. This weighs in around 1k more, but always works. It does play around with environ and args but unlike other similar variants doesn't appear to stamp on what you actually use in the program.
Diffstat (limited to 'src/dhcpcd.c')
-rw-r--r--src/dhcpcd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/dhcpcd.c b/src/dhcpcd.c
index 4cd5a02e..8220219d 100644
--- a/src/dhcpcd.c
+++ b/src/dhcpcd.c
@@ -1787,6 +1787,10 @@ main(int argc, char **argv)
size_t si;
#endif
+#ifdef SETPROCTITLE_H
+ setproctitle_init(argc, argv, environ);
+#endif
+
/* Test for --help and --version */
if (argc > 1) {
if (strcmp(argv[1], "--help") == 0) {
@@ -2566,7 +2570,7 @@ exit1:
free(ctx.logfile);
free(ctx.ctl_buf);
#ifdef SETPROCTITLE_H
- setproctitle_free();
+ setproctitle_fini();
#endif
#ifdef USE_SIGNALS
if (ctx.options & DHCPCD_STARTED) {