Kill dvrmpd_process and log_procnames. Unneeded abstraction for this
authorclaudio <claudio@openbsd.org>
Tue, 19 Jan 2021 12:26:38 +0000 (12:26 +0000)
committerclaudio <claudio@openbsd.org>
Tue, 19 Jan 2021 12:26:38 +0000 (12:26 +0000)
simple daemon.

usr.sbin/dvmrpd/dvmrpd.c
usr.sbin/dvmrpd/dvmrpd.h
usr.sbin/dvmrpd/dvmrpe.c
usr.sbin/dvmrpd/rde.c

index bcb5267..782e63f 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dvmrpd.c,v 1.25 2016/09/02 16:20:34 benno Exp $ */
+/*     $OpenBSD: dvmrpd.c,v 1.26 2021/01/19 12:26:38 claudio Exp $ */
 
 /*
  * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -108,8 +108,7 @@ main(int argc, char *argv[])
        size_t           len;
 
        conffile = CONF_FILE;
-       dvmrpd_process = PROC_MAIN;
-       log_procname = log_procnames[dvmrpd_process];
+       log_procname = "parent";
 
        log_init(1);    /* log to stderr until daemonized */
        log_verbose(1);
index 511ccdc..96f02b0 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dvmrpd.h,v 1.23 2021/01/19 11:46:10 claudio Exp $ */
+/*     $OpenBSD: dvmrpd.h,v 1.24 2021/01/19 12:26:38 claudio Exp $ */
 
 /*
  * Copyright (c) 2004, 2005, 2006 Esben Norby <norby@openbsd.org>
 
 #define MAXVIFS                        32      /* XXX */
 
-static const char * const log_procnames[] = {
-       "parent",
-       "dvmrpe",
-       "rde"
-};
-
 struct imsgev {
        struct imsgbuf           ibuf;
        void                    (*handler)(int, short, void *);
@@ -235,12 +229,6 @@ struct iface {
 };
 
 /* dvmrp_conf */
-enum {
-       PROC_MAIN,
-       PROC_DVMRP_ENGINE,
-       PROC_RDE_ENGINE
-} dvmrpd_process;
-
 struct dvmrpd_conf {
        struct event             ev;
        struct event             report_timer;
index 57cb6ec..75432db 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dvmrpe.c,v 1.21 2021/01/19 12:23:30 claudio Exp $ */
+/*     $OpenBSD: dvmrpe.c,v 1.22 2021/01/19 12:26:38 claudio Exp $ */
 
 /*
  * Copyright (c) 2005 Claudio Jeker <claudio@openbsd.org>
@@ -117,8 +117,7 @@ dvmrpe(struct dvmrpd_conf *xconf, int pipe_parent2dvmrpe[2],
                fatal("chdir(\"/\")");
 
        setproctitle("dvmrp engine");
-       dvmrpd_process = PROC_DVMRP_ENGINE;
-       log_procname = log_procnames[dvmrpd_process];
+       log_procname = "dvmrpe";
 
        if (setgroups(1, &pw->pw_gid) ||
            setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) ||
index fa7ef1d..330b3f9 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: rde.c,v 1.29 2016/09/02 16:20:34 benno Exp $ */
+/*     $OpenBSD: rde.c,v 1.30 2021/01/19 12:26:38 claudio Exp $ */
 
 /*
  * Copyright (c) 2004, 2005 Claudio Jeker <claudio@openbsd.org>
@@ -97,8 +97,7 @@ rde(struct dvmrpd_conf *xconf, int pipe_parent2rde[2], int pipe_dvmrpe2rde[2],
                fatal("chdir(\"/\")");
 
        setproctitle("route decision engine");
-       dvmrpd_process = PROC_RDE_ENGINE;
-       log_procname = log_procnames[dvmrpd_process];
+       log_procname = "rde";
 
        if (setgroups(1, &pw->pw_gid) ||
            setresgid(pw->pw_gid, pw->pw_gid, pw->pw_gid) ||