openrc/src
Thomas Pfaff 062223a5df Avoid race condition in runscript (bug #319865)
Under normal conditions, runscript creates one child and waits for its
termination, which is signaled by a pipe write from the SIGCHLD
sighandler.

When running killprocs however more than one SIGHCLD signal is generated, at
least on all of my amd64 boxes running on real hardware and in vmware.

When the first SIGCHLD occurs svc_exec leaves the loop and closes the pipe.
Subsequent SIGCHLDs during the close can lead to a race condition and create an
EBADF error in the pipe write (pipe is closed but the file handle is still !=
-1).

We avoid this by blocking SIGHCHLD during the pipe close.
2010-12-03 14:01:28 -06:00
..
includes Add new utility and init script swclock that sets the system time based on 2009-10-13 08:03:45 +01:00
libeinfo restore old e* func output 2010-04-09 02:19:40 -04:00
librc random spelling fixes 2010-01-08 22:02:51 +00:00
rc Avoid race condition in runscript (bug #319865) 2010-12-03 14:01:28 -06:00
test Use rc_getline instead of assuming a fixed kernel cmdline length. 2009-06-21 12:20:53 +01:00
Makefile Add (c) to Copyright 2009-05-01 15:11:40 +01:00