diff options
author | ghelmer <ghelmer@FreeBSD.org> | 2012-02-06 14:11:24 +0000 |
---|---|---|
committer | ghelmer <ghelmer@FreeBSD.org> | 2012-02-06 14:11:24 +0000 |
commit | 10fb6673e8872813e1d696e3dd3c20ec7b5e1933 (patch) | |
tree | 36403f044c4b168dc5d5da5990fda2191ed40ee5 /lib/libelf/elf_scn.c | |
parent | 9df8133640c5924838c6b7491804ea0842d4d4c4 (diff) | |
download | FreeBSD-src-10fb6673e8872813e1d696e3dd3c20ec7b5e1933.zip FreeBSD-src-10fb6673e8872813e1d696e3dd3c20ec7b5e1933.tar.gz |
Using the O_CLOEXEC flag on open(2) caused the pidfile lock to be lost
when the child process execs daemon's target program thanks to flock(2)
semantics. So, we apparently have to leak the open pidfile's file
descriptor to keep the lock for the pidfile(3) functions to work properly.
Test case demonstrated by trociny:
ref8-amd64:/home/trociny% uname -r
8.2-STABLE
ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10
ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10
daemon: process already running, pid: 19799
kopusha:~% uname -r
10.0-CURRENT
kopusha:~% daemon -p /tmp/sleep.pid sleep 10
kopusha:~% daemon -p /tmp/sleep.pid sleep 10
kopusha:~%
Diffstat (limited to 'lib/libelf/elf_scn.c')
0 files changed, 0 insertions, 0 deletions