diff options
author | brian <brian@FreeBSD.org> | 2000-08-16 09:07:23 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2000-08-16 09:07:23 +0000 |
commit | a7aa2e6cdb6c5521e4c444686f843a5ec015f6c2 (patch) | |
tree | f92a54d342123c82413213bce4839e5b3df8ae48 /usr.sbin/ppp/defs.c | |
parent | 724f61b07d51e05677c46e23e943f24eac26cf11 (diff) | |
download | FreeBSD-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.c | 16 |
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); +} |