On Mon, 2007-06-11 at 22:29 -0400, Mike Frysinger wrote:
> > So you mean any code using libc daemon(3) is broken ?
>
> how is that function relevant to the discussion ? it can be safely used
> regardless of the state of stdin/stdout/stderr before it is called
main()
{
fd = socket(...);
fd2 = pipe(...);
[...]
/* ok all set */
daemon(0, 0)
[...]
FD_SET(fd, &rfd);
select(...);
[...]
}
It's a valid and common daemon(3) usage scheme to me, but this code will
break if fd and fd2 get fd between 0 and 2.
--
Maxime
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox