diff options
author | Christian Hesse <mail@eworm.de> | 2014-06-07 06:55:47 +0200 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2014-06-07 06:55:47 +0200 |
commit | 16642157bebd6c691207dd0e4ed5f1a2830bd316 (patch) | |
tree | 58474c955fe37dbd3baf88f483f7a42cf625891e /dyndhcpd.c | |
parent | 1edcee2141c48a6bd767e9400b0883e6de9d14e5 (diff) | |
download | dyndhcpd-16642157bebd6c691207dd0e4ed5f1a2830bd316.tar.gz dyndhcpd-16642157bebd6c691207dd0e4ed5f1a2830bd316.tar.zst |
fix error handling in case execlp() fails
Diffstat (limited to 'dyndhcpd.c')
-rw-r--r-- | dyndhcpd.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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 */ |