Create a pidfile even in the case where ndhc never backgrounds.

This commit is contained in:
Nicholas J. Kain 2010-11-12 20:08:16 -05:00
parent ac6f60c4fe
commit 0b1a3b4c14

View File

@ -564,6 +564,14 @@ int main(int argc, char **argv)
log_line("ndhc client " VERSION " started."); log_line("ndhc client " VERSION " started.");
if (client_config.foreground && !client_config.background_if_no_lease) {
if (file_exists(pidfile, "w") == -1) {
log_line("FATAL - cannot open pidfile for write!");
exit(EXIT_FAILURE);
}
write_pid(pidfile);
}
if (read_interface(client_config.interface, &client_config.ifindex, if (read_interface(client_config.interface, &client_config.ifindex,
NULL, client_config.arp) < 0) NULL, client_config.arp) < 0)
exit(EXIT_FAILURE); exit(EXIT_FAILURE);