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

smb: Comment and FIXME about closing file descriptors.

Corresponds to FSP commit 1ad016bdd5.
This commit is contained in:
Kalle Olavi Niemitalo 2007-03-05 23:10:43 +02:00 committed by Kalle Olavi Niemitalo
parent e08d040c4c
commit c19ad66070

View File

@ -509,6 +509,17 @@ smb_protocol_handler(struct connection *conn)
close(smb_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 libsmbclient calls syslog(). */
close_all_non_term_fd();
do_smb(conn);