Browse Source

If ChildProcess is not interested in stdout/stderr, then redirect to /dev/null instead of closing

tags/2021-05-28
hogliux 9 years ago
parent
commit
24a63ae2e0
2 changed files with 4 additions and 6 deletions
  1. +4
    -4
      modules/juce_core/native/juce_posix_SharedCode.h
  2. +0
    -2
      modules/juce_gui_basics/native/juce_linux_FileChooser.cpp

+ 4
- 4
modules/juce_core/native/juce_posix_SharedCode.h View File

@@ -1090,14 +1090,14 @@ public:
close (pipeHandles[0]); // close the read handle
if ((streamFlags & wantStdOut) != 0)
dup2 (pipeHandles[1], 1); // turns the pipe into stdout
dup2 (pipeHandles[1], STDOUT_FILENO); // turns the pipe into stdout
else
close (STDOUT_FILENO);
dup2 (open ("/dev/null", O_WRONLY), STDOUT_FILENO);
if ((streamFlags & wantStdErr) != 0)
dup2 (pipeHandles[1], 2);
dup2 (pipeHandles[1], STDERR_FILENO);
else
close (STDERR_FILENO);
dup2 (open ("/dev/null", O_WRONLY), STDERR_FILENO);
close (pipeHandles[1]);


+ 0
- 2
modules/juce_gui_basics/native/juce_linux_FileChooser.cpp View File

@@ -171,8 +171,6 @@ void FileChooser::showPlatformDialog (Array<File>& results,
else
addZenityArgs (args, separator, title, file, filters, isDirectory, isSave, selectMultipleFiles);
args.add ("2>/dev/null"); // (to avoid logging info ending up in the results)
ChildProcess child;
if (child.start (args, ChildProcess::wantStdOut))


Loading…
Cancel
Save