summaryrefslogtreecommitdiffstats
path: root/dhcpcd.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2015-02-18 20:29:42 +0000
committerRoy Marples <roy@marples.name>2015-02-18 20:29:42 +0000
commit641301d1c8812f934fe65f064aadbef2f1131be3 (patch)
tree83cf59b9975155fc01b69d777eebb68e0b27bcf7 /dhcpcd.c
parentab19bdf8ac251fcb28ee9944dddc9a533e0b6053 (diff)
downloaddhcpcd-641301d1c8812f934fe65f064aadbef2f1131be3.tar.xz
Use the exit code of EXIT_SUCCESS when terminating gracefully.
Diffstat (limited to 'dhcpcd.c')
-rw-r--r--dhcpcd.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/dhcpcd.c b/dhcpcd.c
index 987d437f..00e58ae7 100644
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -1070,21 +1070,24 @@ handle_signal1(void *arg)
struct dhcpcd_ctx *ctx;
struct dhcpcd_siginfo *si;
struct interface *ifp;
- int do_release;
+ int do_release, exit_code;;
ctx = dhcpcd_ctx;
si = arg;
do_release = 0;
+ exit_code = EXIT_FAILURE;
switch (si->signo) {
case SIGINT:
syslog(LOG_INFO, sigmsg, "INT", (int)si->pid, "stopping");
break;
case SIGTERM:
syslog(LOG_INFO, sigmsg, "TERM", (int)si->pid, "stopping");
+ exit_code = EXIT_SUCCESS;
break;
case SIGALRM:
syslog(LOG_INFO, sigmsg, "ALRM", (int)si->pid, "releasing");
do_release = 1;
+ exit_code = EXIT_SUCCESS;
break;
case SIGHUP:
syslog(LOG_INFO, sigmsg, "HUP", (int)si->pid, "rebinding");
@@ -1113,7 +1116,7 @@ handle_signal1(void *arg)
if (!(ctx->options & DHCPCD_TEST))
stop_all_interfaces(ctx, do_release);
- eloop_exit(ctx->eloop, EXIT_FAILURE);
+ eloop_exit(ctx->eloop, exit_code);
}
static void