From: Roy Marples Date: Wed, 18 Feb 2015 20:29:42 +0000 (+0000) Subject: Use the exit code of EXIT_SUCCESS when terminating gracefully. X-Git-Tag: v6.8.0~89 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=641301d1c8812f934fe65f064aadbef2f1131be3;p=thirdparty%2Fdhcpcd.git Use the exit code of EXIT_SUCCESS when terminating gracefully. --- 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