summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/defs.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2000-08-16 09:07:23 +0000
committerbrian <brian@FreeBSD.org>2000-08-16 09:07:23 +0000
commita7aa2e6cdb6c5521e4c444686f843a5ec015f6c2 (patch)
treef92a54d342123c82413213bce4839e5b3df8ae48 /usr.sbin/ppp/defs.c
parent724f61b07d51e05677c46e23e943f24eac26cf11 (diff)
downloadFreeBSD-src-a7aa2e6cdb6c5521e4c444686f843a5ec015f6c2.zip
FreeBSD-src-a7aa2e6cdb6c5521e4c444686f843a5ec015f6c2.tar.gz
setproctitle() doesn't need to be called with root privs, so move
it from id.c into defs.c
Diffstat (limited to 'usr.sbin/ppp/defs.c')
-rw-r--r--usr.sbin/ppp/defs.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/usr.sbin/ppp/defs.c b/usr.sbin/ppp/defs.c
index c7577c2..7101dd8 100644
--- a/usr.sbin/ppp/defs.c
+++ b/usr.sbin/ppp/defs.c
@@ -35,6 +35,11 @@
#include <ctype.h>
#include <errno.h>
+#ifdef __OpenBSD__
+#include <util.h>
+#else
+#include <libutil.h>
+#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -358,3 +363,14 @@ ex_desc(int ex)
snprintf(num, sizeof num, "%d", ex);
return num;
}
+
+void
+SetTitle(const char *title)
+{
+ if (title == NULL)
+ setproctitle(NULL);
+ else if (title[0] == '-' && title[1] != '\0')
+ setproctitle("-%s", title + 1);
+ else
+ setproctitle("%s", title);
+}
OpenPOWER on IntegriCloud