From: xi Date: Tue, 25 Apr 2006 12:30:11 +0000 (+1000) Subject: Close stdin, stdout and stderr in mlmmj-recieve after forking. X-Git-Tag: RELEASE_1_2_12_RC1~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7cbcf7d585f207960bb2a0880dcea43e158ecf1d;p=thirdparty%2Fmlmmj.git Close stdin, stdout and stderr in mlmmj-recieve after forking. On FreeBSD this allows the process calling mlmmj-receive to get the return code and continue. Without the change it just waits for the child to finish which might take a long time. It shouldn't hurt other platforms in any way. --- diff --git a/ChangeLog b/ChangeLog index 6ba87ebc..470ed042 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,5 @@ + o Close stdin, stdout and stderr in the child of mlmmj-receive after + forking. This is neccesary on FreeBSD. o No need to check for subscribers in 0-sized files o Make sure chomp works with empty strings (Frank Denis) 1.2.11 diff --git a/src/mlmmj-recieve.c b/src/mlmmj-recieve.c index e3eca9d2..deac52b4 100644 --- a/src/mlmmj-recieve.c +++ b/src/mlmmj-recieve.c @@ -162,6 +162,10 @@ int main(int argc, char **argv) if(childpid) exit(EXIT_SUCCESS); /* Parent says: "bye bye kids!"*/ + + close(0); + close(1); + close(2); } execlp(mlmmjprocess, mlmmjprocess,