]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Respect initial commandline arguments when rebooting via a signal.
authorRoy Marples <roy@marples.name>
Tue, 25 Feb 2014 10:24:01 +0000 (10:24 +0000)
committerRoy Marples <roy@marples.name>
Tue, 25 Feb 2014 10:24:01 +0000 (10:24 +0000)
dhcpcd.c

index 900f30112adbd1623d252ebd9405464fb2ae35e5..128726c0ee269eff2d014c057e40e16b3fb2793a 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -882,7 +882,10 @@ handle_signal1(void *arg)
                    ifo->options |= DHCPCD_DAEMONISED;
                ctx->options = ifo->options;
                free_options(ifo);
-               reconf_reboot(ctx, 1, ctx->ifc, ctx->ifv, 0);
+               /* Preserve any options passed on the commandline
+                * when we were started. */
+               reconf_reboot(ctx, 1, ctx->argc, ctx->argv,
+                   ctx->argc - ctx->ifc);
                return;
        case SIGHUP:
                syslog(LOG_INFO, "received SIGHUP from PID %d, releasing",
@@ -1090,6 +1093,7 @@ handle_args(struct dhcpcd_ctx *ctx, struct fd_list *fd, int argc, char **argv)
                return 0;
        }
 
+       /* XXX: Respect initial commandline options? */
        reconf_reboot(ctx, do_reboot, argc, argv, optind);
        return 0;
 }