]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Move NO_FORK code down so options is initialised.
authorRoy Marples <roy@marples.name>
Tue, 27 May 2008 09:14:04 +0000 (09:14 +0000)
committerRoy Marples <roy@marples.name>
Tue, 27 May 2008 09:14:04 +0000 (09:14 +0000)
dhcpcd.c

index 4ca3dc17d1e0eae2104f44638ebebc62dc0eb93c..1dd633307c571d918a2e020b8a306616b40372ba 100644 (file)
--- a/dhcpcd.c
+++ b/dhcpcd.c
@@ -439,16 +439,6 @@ main(int argc, char **argv)
        closefrom(3);
        openlog(PACKAGE, LOG_PID, LOG_LOCAL0);
 
-#ifdef THERE_IS_NO_FORK
-       dhcpcd_argv = argv;
-       dhcpcd_argc = argc;
-       if (!realpath(argv[0], dhcpcd)) {
-               fprintf(stderr, "unable to resolve the path `%s': %s",
-                       argv[0], strerror(errno));
-               goto abort;
-       }
-#endif
-
        options = xzalloc(sizeof(*options));
        options->script = SCRIPT;
        snprintf(options->classid, CLASS_ID_MAX_LEN, "%s %s",
@@ -482,6 +472,16 @@ main(int argc, char **argv)
 # endif
 #endif
 
+#ifdef THERE_IS_NO_FORK
+       dhcpcd_argv = argv;
+       dhcpcd_argc = argc;
+       if (!realpath(argv[0], dhcpcd)) {
+               fprintf(stderr, "unable to resolve the path `%s': %s",
+                       argv[0], strerror(errno));
+               goto abort;
+       }
+#endif
+
        gethostname(options->hostname, sizeof(options->hostname));
        if (strcmp(options->hostname, "(none)") == 0 ||
            strcmp(options->hostname, "localhost") == 0)