Changeset 9551


Ignore:
Timestamp:
May 19, 2008, 8:56:14 PM (11 years ago)
Author:
andreas
Message:

Pass the error in execute to the calling thread.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/win64/level-1/linux-files.lisp

    r9550 r9551  
    14071407  (unless (every #'(lambda (a) (typep a 'simple-string)) args)
    14081408    (error "Program args must all be simple strings : ~s" args))
    1409 ;  (push (native-untranslated-namestring program) args)
    14101409  (push program args)
    14111410  (let* ((token (list 0))
     
    14561455           )
    14571456      (dolist (fd close-in-parent) (fd-close fd))
    1458       (unless (external-process-pid proc)
    1459         (dolist (fd close-on-error) (fd-close fd)))
    1460       (when (and wait (external-process-pid proc))
    1461         (with-interrupts-enabled
    1462             (wait-on-semaphore (external-process-completed proc)))))
     1457      (if (external-process-pid proc)
     1458        (when (and wait (external-process-pid proc))
     1459          (with-interrupts-enabled
     1460              (wait-on-semaphore (external-process-completed proc))))
     1461        (progn
     1462          (dolist (fd close-on-error) (fd-close fd))
     1463          (error "Process execution failed"))))
    14631464    (and (external-process-pid proc) proc)))
    14641465
     
    14841485
    14851486(defun run-external-process (proc in-fd out-fd error-fd &optional env)
    1486   ;; stub, stub
    1487   (let* ((args (external-process-args proc))
    1488          (child-pid (exec-with-io-redirection in-fd out-fd error-fd args)))
    1489     (setf (external-process-pid proc) child-pid)
    1490     (add-external-process proc)
    1491     (signal-semaphore (external-process-signal proc))
    1492     (monitor-external-process proc)))
     1487  (handler-case
     1488      (let* ((args (external-process-args proc))
     1489             (child-pid (exec-with-io-redirection in-fd out-fd error-fd args)))
     1490        (setf (external-process-pid proc) child-pid)
     1491        (add-external-process proc)
     1492        (signal-semaphore (external-process-signal proc))
     1493        (monitor-external-process proc))
     1494    (error (condition) (signal-semaphore (external-process-signal proc)))))
    14931495
    14941496(defun join-strings (strings)
Note: See TracChangeset for help on using the changeset viewer.