> If a user knows that a third-party library (Oracle, whatever) can > provide messages to stderr, and they knowingly close that file > descriptor without dup()ing it elsewhere, then that is a bug in > their software.
Note that the author of the non-apr application does not necessarily must submit to that wisdom. While you are theoritecally correct, it matters little practically. > Having APR open a bunch of file-descriptors so > that this fixes a potential problem (IMO bug in their software) > is just wasting file descriptors. Not really. (error handling excluded) do { fd = open("/dev/null", O_RDWR); } while (fd < 3); close(fd); No fd wasted. - Sascha Experience IRCG http://schumann.cx/ http://schumann.cx/ircg