]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
dhcpcd: log forked to background earlier
authorRoy Marples <roy@marples.name>
Sun, 1 Dec 2019 08:57:07 +0000 (08:57 +0000)
committerRoy Marples <roy@marples.name>
Sun, 1 Dec 2019 08:57:07 +0000 (08:57 +0000)
src/dhcpcd.c

index 3703b1eaf9ea45212bac06a2638ba618f8417c72..125bf5f4b593dfc9028e475388d2ca9361006d90 100644 (file)
@@ -345,11 +345,11 @@ dhcpcd_daemonise(struct dhcpcd_ctx *ctx)
            !(ctx->options & DHCPCD_DAEMONISE))
                return;
 
+       loginfox("forked to background, child pid %d", getpid());
        i = EXIT_SUCCESS;
        if (write(ctx->fork_fd, &i, sizeof(i)) == -1)
                logerr("write");
        ctx->options |= DHCPCD_DAEMONISED;
-       loginfox("forked to background, child pid %d", getpid());
        eloop_event_delete(ctx->eloop, ctx->fork_fd);
        close(ctx->fork_fd);
        ctx->fork_fd = -1;