1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-01 23:36:37 +02:00

core: use "/dev/null" for stdin in hook_process instead of closing stdin (bug #39538)

This commit is contained in:
Sebastien Helleu
2013-07-20 15:45:25 +02:00
parent f4a0307316
commit 56baaaffa8
2 changed files with 4 additions and 5 deletions
+2 -5
View File
@@ -1435,11 +1435,8 @@ hook_process_child (struct t_hook *hook_process)
const char *ptr_url, *ptr_arg;
int rc, i, num_args;
/*
* close stdin, so that process will fail to read stdin (process reading
* stdin should not be run inside WeeChat!)
*/
close (STDIN_FILENO);
/* use "/dev/null" for stdin stream */
freopen ("/dev/null", "r", stdin);
/* redirect stdout/stderr to pipe (so that father process can read them) */
close (HOOK_PROCESS(hook_process, child_read[HOOK_PROCESS_STDOUT]));