]> git.decadent.org.uk Git - odhcp6c.git/blobdiff - src/odhcp6c.c
Update license headers
[odhcp6c.git] / src / odhcp6c.c
index 645131252a2f9f10c0e19aa136dac61bb6a62855..a97e4c914cf646d680edd869bcfe258e4f652372 100644 (file)
@@ -1,5 +1,5 @@
 /**
- * Copyright (C) 2012 Steven Barth <steven@midlink.org>
+ * Copyright (C) 2012-2013 Steven Barth <steven@midlink.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License v2 as published by
@@ -139,13 +139,6 @@ int main(_unused int argc, char* const argv[])
        if (help || !ifname)
                return usage();
 
-       if ((urandom_fd = open("/dev/urandom", O_CLOEXEC | O_RDONLY)) < 0 ||
-                       init_dhcpv6(ifname, request_pd) || ra_init(ifname) ||
-                       script_init(script, ifname)) {
-               syslog(LOG_ERR, "failed to initialize: %s", strerror(errno));
-               return 3;
-       }
-
        signal(SIGIO, sighandler);
        signal(SIGHUP, sighandler);
        signal(SIGINT, sighandler);
@@ -154,6 +147,13 @@ int main(_unused int argc, char* const argv[])
        signal(SIGUSR1, sighandler);
        signal(SIGUSR2, sighandler);
 
+       if ((urandom_fd = open("/dev/urandom", O_CLOEXEC | O_RDONLY)) < 0 ||
+                       init_dhcpv6(ifname, request_pd) || ra_init(ifname) ||
+                       script_init(script, ifname)) {
+               syslog(LOG_ERR, "failed to initialize: %s", strerror(errno));
+               return 3;
+       }
+
        if (daemonize) {
                openlog("odhcp6c", LOG_PID, LOG_DAEMON); // Disable LOG_PERROR
                if (daemon(0, 0)) {