Ticket #422: run-program-20161120a.diff

File run-program-20161120a.diff, 1.3 KB (added by Mark Evenson, 7 years ago)
  • src/org/armedbear/lisp/run-program.lisp

    # 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 b  
    163163        process))))
    164164
    165165(defconstant +inherit+
    166   (java:jfield "java.lang.ProcessBuilder$Redirect" "INHERIT"))
     166  (ignore-errors
     167    (java:jfield "java.lang.ProcessBuilder$Redirect" "INHERIT")))
    167168
    168169(defun coerce-to-file (value)
    169170  (java:jnew
     
    180181
    181182(defun setup-input-redirection (process-builder value if-does-not-exist)
    182183  (let ((redirect (if (eq value T)
    183                       +inherit+
     184                      (when +inherit+ +inherit+)
    184185                      (let ((file (coerce-to-file value)))
    185186                        (when value
    186187                          (if (eq if-does-not-exist :create)
     
    195196
    196197(defun setup-output-redirection (process-builder value errorp if-does-exist)
    197198  (let ((redirect (if (eq value T)
    198                       +inherit+
     199                      (when +inherit+ +inherit+)
    199200                      (let ((file (coerce-to-file value))
    200201                            appendp)
    201202                        (when (and value (probe-file value))