-/* $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>
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) ||
-/* $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>
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) ||
-/* $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>
#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 *);
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();
}
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;
-/* $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>
#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,