The Daily Build

Icon

Software Development, version 3.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) {
[...]

Read the rest of this entry »