(disassoc): src/lib/player/accept.c rev. 1.18.2.1 broke the server

when it runs as daemon, because it relies on player_socket remaining
open across disassoc().  Change disassoc() to only close file
descriptors 0..2 instead of 0..9.  By the way, it should really
redirect 0..2 to /dev/null instead.
This commit is contained in:
Markus Armbruster 2005-03-09 19:25:20 +00:00
parent fcf064625d
commit ba7d26b2ba

View file

@ -54,7 +54,7 @@ disassoc(void)
if (fork() != 0)
exit(0);
for (i = 0; i < 10; i++)
for (i = 0; i < 2; i++)
(void)close(i);
(void)open("/", O_RDONLY, 0);
(void)dup2(0, 1);