mirror of
https://github.com/weechat/weechat.git
synced 2026-06-12 14:14:48 +02:00
core: use "/dev/null" for stdin in hook_process instead of closing stdin (bug #39538)
This commit is contained in:
@@ -14,6 +14,8 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
|
||||
Version 0.4.2 (under dev!)
|
||||
--------------------------
|
||||
|
||||
* core: use "/dev/null" for stdin in hook_process instead of closing stdin
|
||||
(bug #39538)
|
||||
* core: add option "scroll_beyond_end" for command /window (task #6745)
|
||||
* core: add options weechat.look.hotlist_prefix and weechat.look.hotlist_suffix
|
||||
(task #12730)
|
||||
|
||||
+2
-5
@@ -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]));
|
||||
|
||||
Reference in New Issue
Block a user