May 26, 2010 0
An Interesting pid File Race
ISC’s dhcpd uses this code to check for an already-running daemon:
/* Read previous pid file. */
if ((i = open (path_dhcpd_pid, O_RDONLY)) >= 0) {
status = read (i, pbuf, (sizeof pbuf) – 1);
close (i);
if (status > 0) {
[...]
From The Peanut Gallery