From f7e0726a5c98adb53362fb9d502b63c80f41fb74 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Sat, 4 Aug 2007 23:57:57 +0000 Subject: [PATCH] Patch from Elias to close stdin and stdout of our launched process. If we had a Win98 machine around we could test whether closing stderr prevents the buffer fill-up deadlock that necessitates leaving the Getdown process around to read stderr on that platform, but I vaguely recall having tried that and having it not work. --- src/java/com/threerings/getdown/launcher/Getdown.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/java/com/threerings/getdown/launcher/Getdown.java b/src/java/com/threerings/getdown/launcher/Getdown.java index 598ea4d..9b95fdf 100644 --- a/src/java/com/threerings/getdown/launcher/Getdown.java +++ b/src/java/com/threerings/getdown/launcher/Getdown.java @@ -631,6 +631,11 @@ public abstract class Getdown extends Thread } else { Process proc = _app.createProcess(); + // close standard in to avoid choking standard out of the launched process + proc.getInputStream().close(); + // close standard out, since we're not going to write to anything to it anyway + proc.getOutputStream().close(); + // on Windows 98 and ME we need to stick around and read the output of stderr lest // the process fill its output buffer and choke, yay! final InputStream stderr = proc.getErrorStream();