aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2014-06-07 06:55:47 +0200
committerGravatar Christian Hesse <mail@eworm.de>2014-06-07 06:55:47 +0200
commit16642157bebd6c691207dd0e4ed5f1a2830bd316 (patch)
tree58474c955fe37dbd3baf88f483f7a42cf625891e
parent1edcee2141c48a6bd767e9400b0883e6de9d14e5 (diff)
downloaddyndhcpd-16642157bebd6c691207dd0e4ed5f1a2830bd316.tar.gz
dyndhcpd-16642157bebd6c691207dd0e4ed5f1a2830bd316.tar.zst
fix error handling in case execlp() fails
-rw-r--r--dyndhcpd.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/dyndhcpd.c b/dyndhcpd.c
index dde769b..1794831 100644
--- a/dyndhcpd.c
+++ b/dyndhcpd.c
@@ -274,10 +274,11 @@ int main(int argc, char ** argv) {
if (verbose > 1)
printf("Running: dhcpd -f -d -q -4 -pf %s -lf %s -cf %s %s\n",
pidfile, leasesfile, filename, interface);
- execlp(DHCPDFILE, "dhcpd", "-f", "-d", "-q", "-4",
+ rc = execlp(DHCPDFILE, "dhcpd", "-f", "-d", "-q", "-4",
"-pf", pidfile, "-lf", leasesfile, "-cf", filename, interface, NULL);
- rc = EXIT_SUCCESS;
+ fprintf(stderr, "The dhcp daemon failed to execute.\n");
+
goto out;
} else {
/* failed to convert addresses from binary to string */