Fix issue #2 - ndppd dæmonizes too early

This commit is contained in:
Daniel Adolfsson 2013-02-12 13:25:22 +01:00
parent 24aeceb060
commit 00da8bf7ba

View File

@ -201,15 +201,6 @@ int main(int argc, char* argv[], char* env[])
}
}
if (daemon) {
logger::syslog(true);
if (daemonize() < 0) {
logger::error() << "Failed to daemonize process";
return 1;
}
}
if (!pidfile.empty()) {
std::ofstream pf;
pf.open(pidfile.c_str(), std::ios::out | std::ios::trunc);
@ -226,7 +217,14 @@ int main(int argc, char* argv[], char* env[])
if (!configure(config_path))
return -1;
//route::load("/proc/net/ipv6_route");
if (daemon) {
logger::syslog(true);
if (daemonize() < 0) {
logger::error() << "Failed to daemonize process";
return 1;
}
}
// Time stuff.