]> code.delx.au - pulseaudio/commit
daemon: Fix some more error paths in the double forking.
authorColin Guthrie <cguthrie@mandriva.org>
Fri, 25 Mar 2011 09:12:51 +0000 (09:12 +0000)
committerColin Guthrie <cguthrie@mandriva.org>
Fri, 25 Mar 2011 21:35:40 +0000 (21:35 +0000)
commit34ddc5b9c533ed83d53238fff0777663f9c50336
tree0f274a06d544cc68daa9154b06e26a9a8d5b5370
parentf49711c99a86075de0a2337c4ea71049a9aa146a
daemon: Fix some more error paths in the double forking.

As spotted by Tanu Kaskinen:

The first process: daemon_pipe is not closed if the first fork() call
fails. Even if it doesn't fail, the first process never closes
daemon_pipe[0].

The second process: daemon_pipe[1] is not closed if anything fails
between the first and the second fork() call. Also, if the second fork
fails, then the finish section writes to daemon_pipe2[1], even though
only the third process should do that. Also, if anything fails between
the first and the second fork, then the second process never writes
anything to daemon_pipe[1]. I don't know what happens in the first
process in this case - does it get an error or does pa_loop_read() get
stuck.

The third process: No problems :)
src/daemon/main.c