mirror of
https://gitlab.isc.org/isc-projects/dhcp
synced 2025-08-31 06:15:55 +00:00
Unlink dhcpd.pid file before writing so that we don't leave garbage at the end
This commit is contained in:
1
dhcpd.c
1
dhcpd.c
@@ -135,6 +135,7 @@ int main (argc, argv, envp)
|
||||
discover_interfaces ();
|
||||
|
||||
/* Write a pid file. */
|
||||
unlink (_PATH_DHCPD_PID);
|
||||
if ((i = open (_PATH_DHCPD_PID, O_WRONLY | O_CREAT, 0640)) >= 0) {
|
||||
char obuf [20];
|
||||
sprintf (obuf, "%d\n", (int)getpid ());
|
||||
|
@@ -135,6 +135,7 @@ int main (argc, argv, envp)
|
||||
discover_interfaces ();
|
||||
|
||||
/* Write a pid file. */
|
||||
unlink (_PATH_DHCPD_PID);
|
||||
if ((i = open (_PATH_DHCPD_PID, O_WRONLY | O_CREAT, 0640)) >= 0) {
|
||||
char obuf [20];
|
||||
sprintf (obuf, "%d\n", (int)getpid ());
|
||||
|
Reference in New Issue
Block a user