Merge pull request #5 from szatam/master
In order to get the correct pid, we should daemonize before writing the ...
This commit is contained in:
commit
e2e44ec5ed
14
src/ndppd.cc
14
src/ndppd.cc
@ -201,13 +201,6 @@ int main(int argc, char* argv[], char* env[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pidfile.empty()) {
|
|
||||||
std::ofstream pf;
|
|
||||||
pf.open(pidfile.c_str(), std::ios::out | std::ios::trunc);
|
|
||||||
pf << getpid() << std::endl;
|
|
||||||
pf.close();
|
|
||||||
}
|
|
||||||
|
|
||||||
logger::notice()
|
logger::notice()
|
||||||
<< "ndppd (NDP Proxy Daemon) version " NDPPD_VERSION << logger::endl
|
<< "ndppd (NDP Proxy Daemon) version " NDPPD_VERSION << logger::endl
|
||||||
<< "Using configuration file '" << config_path << "'";
|
<< "Using configuration file '" << config_path << "'";
|
||||||
@ -226,6 +219,13 @@ int main(int argc, char* argv[], char* env[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!pidfile.empty()) {
|
||||||
|
std::ofstream pf;
|
||||||
|
pf.open(pidfile.c_str(), std::ios::out | std::ios::trunc);
|
||||||
|
pf << getpid() << std::endl;
|
||||||
|
pf.close();
|
||||||
|
}
|
||||||
|
|
||||||
// Time stuff.
|
// Time stuff.
|
||||||
|
|
||||||
struct timeval t1, t2;
|
struct timeval t1, t2;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user