Close stdout script fd. Fixes #388
This commit is contained in:
@@ -361,9 +361,7 @@ namespace SwayNotificationCenter {
|
|||||||
Shell.parse_argv (cmd, out argvp);
|
Shell.parse_argv (cmd, out argvp);
|
||||||
|
|
||||||
Pid child_pid;
|
Pid child_pid;
|
||||||
int std_input;
|
|
||||||
int std_output;
|
int std_output;
|
||||||
int std_err;
|
|
||||||
Process.spawn_async_with_pipes (
|
Process.spawn_async_with_pipes (
|
||||||
"/",
|
"/",
|
||||||
argvp,
|
argvp,
|
||||||
@@ -371,9 +369,9 @@ namespace SwayNotificationCenter {
|
|||||||
SpawnFlags.SEARCH_PATH | SpawnFlags.DO_NOT_REAP_CHILD,
|
SpawnFlags.SEARCH_PATH | SpawnFlags.DO_NOT_REAP_CHILD,
|
||||||
null,
|
null,
|
||||||
out child_pid,
|
out child_pid,
|
||||||
out std_input,
|
null,
|
||||||
out std_output,
|
out std_output,
|
||||||
out std_err);
|
null);
|
||||||
|
|
||||||
// stdout:
|
// stdout:
|
||||||
string res = "";
|
string res = "";
|
||||||
@@ -398,6 +396,7 @@ namespace SwayNotificationCenter {
|
|||||||
int end_status = 0;
|
int end_status = 0;
|
||||||
ChildWatch.add (child_pid, (pid, status) => {
|
ChildWatch.add (child_pid, (pid, status) => {
|
||||||
Process.close_pid (pid);
|
Process.close_pid (pid);
|
||||||
|
GLib.FileUtils.close (std_output);
|
||||||
end_status = status;
|
end_status = status;
|
||||||
execute_command.callback ();
|
execute_command.callback ();
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user