1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-10-01 03:36:26 -04:00

fsp: Comment and FIXME about closing file descriptors.

This commit is contained in:
Kalle Olavi Niemitalo 2007-03-05 20:20:04 +02:00 committed by Kalle Olavi Niemitalo
parent c3a6ca3ef0
commit 1ad016bdd5

View File

@ -427,6 +427,17 @@ fsp_protocol_handler(struct connection *conn)
close(fsp_pipe[0]);
close(header_pipe[0]);
/* There may be outgoing data in stdio buffers
* inherited from the parent process. The parent
* process is going to write this data, so the child
* process must not do that. Closing the file
* descriptors ensures this.
*
* FIXME: If something opens more files and gets the
* same file descriptors and does not close them
* before exit(), then stdio may attempt to write the
* buffers to the wrong files. This might happen for
* example if fsplib calls syslog(). */
close_all_non_term_fd();
do_fsp(conn);