Use i2s instead of hard coding the imsg type. Suggested by tb.
authorflorian <florian@openbsd.org>
Mon, 26 Aug 2024 06:06:04 +0000 (06:06 +0000)
committerflorian <florian@openbsd.org>
Mon, 26 Aug 2024 06:06:04 +0000 (06:06 +0000)
sbin/dhcpleased/engine.c
sbin/dhcpleased/frontend.c

index 265d52f..f7c4338 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: engine.c,v 1.48 2024/08/26 06:05:05 florian Exp $     */
+/*     $OpenBSD: engine.c,v 1.49 2024/08/26 06:06:04 florian Exp $     */
 
 /*
  * Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org>
@@ -552,8 +552,9 @@ engine_dispatch_main(int fd, short event, void *bula)
                        char                     ifnamebuf[IF_NAMESIZE];
 
                        if (nconf == NULL)
-                               fatalx("%s: IMSG_RECONF_END without "
-                                   "IMSG_RECONF_CONF", __func__);
+                               fatalx("%s: %s without IMSG_RECONF_CONF",
+                                   __func__, i2s(type));
+
                        ifaces = changed_ifaces(engine_conf, nconf);
                        merge_config(engine_conf, nconf);
                        nconf = NULL;
index d0dae2d..399345c 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: frontend.c,v 1.37 2024/08/26 06:04:24 florian Exp $   */
+/*     $OpenBSD: frontend.c,v 1.38 2024/08/26 06:06:04 florian Exp $   */
 
 /*
  * Copyright (c) 2017, 2021 Florian Obser <florian@openbsd.org>
@@ -426,8 +426,8 @@ frontend_dispatch_main(int fd, short event, void *bula)
                        char     ifnamebuf[IF_NAMESIZE], *if_name;
 
                        if (nconf == NULL)
-                               fatalx("%s: IMSG_RECONF_END without "
-                                   "IMSG_RECONF_CONF", __func__);
+                               fatalx("%s: %s without IMSG_RECONF_CONF",
+                                   __func__, i2s(type));
 
                        ifaces = changed_ifaces(frontend_conf, nconf);
                        merge_config(frontend_conf, nconf);