File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/main/clojure/cljs/repl Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change 7878(defn platform-path [v]
7979 (str " path.join.apply(null, " (seq->js-array v) " )" ))
8080
81+ (defn- alive? [proc]
82+ (try (.exitValue proc) false (catch IllegalThreadStateException _ true )))
83+
8184(defn- pipe [^Process proc in ^Writer out]
8285 ; ; we really do want system-default encoding here
8386 (with-open [^java.io.Reader in (-> in InputStreamReader. BufferedReader.)]
8487 (loop [buf (char-array 1024 )]
85- (when (try ( .exitValue proc) false ( catch IllegalThreadStateException _ true ) )
88+ (when (alive? proc)
8689 (try
8790 (let [len (.read in buf)]
8891 (when-not (neg? len)
8992 (.write out buf 0 len)
9093 (.flush out)))
9194 (catch IOException e
92- (when (and (.isAlive proc) (not (.contains (.getMessage e) " Stream closed" )))
95+ (when (and (alive? proc) (not (.contains (.getMessage e) " Stream closed" )))
9396 (.printStackTrace e *err*))))
9497 (recur buf)))))
9598
You can’t perform that action at this time.
0 commit comments