changeset 656:29a0637c176f

Close standard fds before launching the eventcmd process
author Mikael Berthe <mikael@lilotux.net>
date Sat, 07 Jan 2006 22:42:08 +0100
parents de6837908702
children 056dc9e65c25
files mcabber/src/hooks.c
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mcabber/src/hooks.c	Sat Jan 07 13:59:17 2006 +0100
+++ b/mcabber/src/hooks.c	Sat Jan 07 22:42:08 2006 +0100
@@ -324,6 +324,10 @@
   }
 
   if (pid == 0) { // child
+    // Close standard file descriptors
+    close(STDIN_FILENO);
+    close(STDOUT_FILENO);
+    close(STDERR_FILENO);
     if (execl(extcmd, extcmd, arg_type, arg_info, jid, arg_data, NULL) == -1) {
       // scr_LogPrint(LPRINT_LOGNORM, "Cannot execute external command.");
       exit(1);