Hi! > bird needs something like this because in case it daemonizes it still > keeps the fds open of the controlling tty which is bad in case you'd > like to log out which then will hang.
This is definitely worth fixing, but I think that closing all possible fd's is an overkill, especially as getdtablesize() can return an arbitrarily high number if the ulimit on the number of fd's is unset. Here is the patch I applied. diff -u -p -r1.56 main.c --- sysdep/unix/main.c 6 Jun 2004 17:05:25 -0000 1.56 +++ sysdep/unix/main.c 20 Jun 2007 07:32:04 -0000 @@ -435,6 +435,11 @@ main(int argc, char **argv) if (pid) return 0; setsid(); + close(0); + if (open("/dev/null", O_RDWR) < 0) + die("Cannot open /dev/null: %m"); + dup2(0, 1); + dup2(0, 2); } signal_init(); Thanks for your bug report -- Martin `MJ' Mares <[EMAIL PROTECTED]> http://mj.ucw.cz/ Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth A: No. Q: Should I include quotations after my reply? -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]