2
0
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:
Ted Lemon
1996-05-16 07:17:23 +00:00
parent d3e5a8928c
commit fb93bab09d
2 changed files with 2 additions and 0 deletions

View File

@@ -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 ());