summaryrefslogtreecommitdiff
path: root/sbin/unwind
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/unwind')
-rw-r--r--sbin/unwind/frontend.c7
-rw-r--r--sbin/unwind/resolver.c7
-rw-r--r--sbin/unwind/unwind.c15
-rw-r--r--sbin/unwind/unwind.h14
4 files changed, 17 insertions, 26 deletions
diff --git a/sbin/unwind/frontend.c b/sbin/unwind/frontend.c
index 9ef3c6b96a5..9737cc636f5 100644
--- a/sbin/unwind/frontend.c
+++ b/sbin/unwind/frontend.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: frontend.c,v 1.60 2021/01/12 16:40:33 florian Exp $ */
+/* $OpenBSD: frontend.c,v 1.61 2021/01/19 16:50:23 florian Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@@ -198,9 +198,8 @@ frontend(int debug, int verbose)
if (chdir("/") == -1)
fatal("chdir(\"/\")");
- uw_process = PROC_FRONTEND;
- setproctitle("%s", log_procnames[uw_process]);
- log_procinit(log_procnames[uw_process]);
+ setproctitle("%s", "frontend");
+ log_procinit("frontend");
if (setgroups(1, &pw->pw_gid) ||
setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) ||
diff --git a/sbin/unwind/resolver.c b/sbin/unwind/resolver.c
index e2b5abb35ea..c0af11d1069 100644
--- a/sbin/unwind/resolver.c
+++ b/sbin/unwind/resolver.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: resolver.c,v 1.129 2020/12/26 15:07:25 florian Exp $ */
+/* $OpenBSD: resolver.c,v 1.130 2021/01/19 16:50:23 florian Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@@ -355,9 +355,8 @@ resolver(int debug, int verbose)
if ((pw = getpwnam(UNWIND_USER)) == NULL)
fatal("getpwnam");
- uw_process = PROC_RESOLVER;
- setproctitle("%s", log_procnames[uw_process]);
- log_procinit(log_procnames[uw_process]);
+ setproctitle("%s", "resolver");
+ log_procinit("resolver");
if (setgroups(1, &pw->pw_gid) ||
setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) ||
diff --git a/sbin/unwind/unwind.c b/sbin/unwind/unwind.c
index 66866395667..dcb5be39adb 100644
--- a/sbin/unwind/unwind.c
+++ b/sbin/unwind/unwind.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: unwind.c,v 1.54 2021/01/18 15:26:04 florian Exp $ */
+/* $OpenBSD: unwind.c,v 1.55 2021/01/19 16:50:23 florian Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@@ -50,12 +50,18 @@
#define TRUST_ANCHOR_FILE "/var/db/unwind.key"
+enum uw_process {
+ PROC_MAIN,
+ PROC_RESOLVER,
+ PROC_FRONTEND,
+};
+
__dead void usage(void);
__dead void main_shutdown(void);
void main_sig_handler(int, short, void *);
-static pid_t start_child(int, char *, int, int, int);
+static pid_t start_child(enum uw_process, char *, int, int, int);
void main_dispatch_frontend(int, short, void *);
void main_dispatch_resolver(int, short, void *);
@@ -218,8 +224,7 @@ main(int argc, char *argv[])
pipe_main2frontend[1], debug, cmd_opts & (OPT_VERBOSE |
OPT_VERBOSE2 | OPT_VERBOSE3));
- uw_process = PROC_MAIN;
- log_procinit(log_procnames[uw_process]);
+ log_procinit("main");
event_init();
@@ -336,7 +341,7 @@ main_shutdown(void)
}
static pid_t
-start_child(int p, char *argv0, int fd, int debug, int verbose)
+start_child(enum uw_process p, char *argv0, int fd, int debug, int verbose)
{
char *argv[7];
int argc = 0;
diff --git a/sbin/unwind/unwind.h b/sbin/unwind/unwind.h
index 910378f3faf..f94e5850c5c 100644
--- a/sbin/unwind/unwind.h
+++ b/sbin/unwind/unwind.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: unwind.h,v 1.50 2021/01/12 16:40:33 florian Exp $ */
+/* $OpenBSD: unwind.h,v 1.51 2021/01/19 16:50:23 florian Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@@ -44,18 +44,6 @@
#define IMSG_DATA_SIZE(imsg) ((imsg).hdr.len - IMSG_HEADER_SIZE)
-enum {
- PROC_MAIN,
- PROC_RESOLVER,
- PROC_FRONTEND,
-} uw_process;
-
-static const char * const log_procnames[] = {
- "main",
- "resolver",
- "frontend",
-};
-
enum uw_resolver_type {
UW_RES_RECURSOR,
UW_RES_DHCP,