# HG changeset patch
# Parent  d9a47033bbbaecf0977610656ab35d4326038993
Fix compilation for SYS:RUN-PROGRAM on JDK-6

diff -r d9a47033bbba -r a1801c61a3e9 src/org/armedbear/lisp/run-program.lisp
--- a/src/org/armedbear/lisp/run-program.lisp	Sat Nov 19 12:34:20 2016 +0000
+++ b/src/org/armedbear/lisp/run-program.lisp	Sun Nov 20 10:22:26 2016 +0100
@@ -163,7 +163,8 @@
         process))))
 
 (defconstant +inherit+
-  (java:jfield "java.lang.ProcessBuilder$Redirect" "INHERIT"))
+  (ignore-errors
+    (java:jfield "java.lang.ProcessBuilder$Redirect" "INHERIT")))
 
 (defun coerce-to-file (value)
   (java:jnew
@@ -180,7 +181,7 @@
 
 (defun setup-input-redirection (process-builder value if-does-not-exist)
   (let ((redirect (if (eq value T)
-                      +inherit+
+                      (when +inherit+ +inherit+) 
                       (let ((file (coerce-to-file value)))
                         (when value
                           (if (eq if-does-not-exist :create)
@@ -195,7 +196,7 @@
 
 (defun setup-output-redirection (process-builder value errorp if-does-exist)
   (let ((redirect (if (eq value T)
-                      +inherit+
+                      (when +inherit+ +inherit+)
                       (let ((file (coerce-to-file value))
                             appendp)
                         (when (and value (probe-file value))
