Raymond Toy pushed to branch master at cmucl / cmucl

Commits:

1 changed file:

Changes:

  • src/code/run-program.lisp
    ... ... @@ -522,8 +522,18 @@
    522 522
       ;; Make sure all the args are okay.
    
    523 523
       (unless (every #'simple-string-p args)
    
    524 524
         (error (intl:gettext "All args to program must be simple strings -- ~S.") args))
    
    525
    +
    
    526
    +  ;; Make sure program is a string that we can use with spawn.
    
    527
    +  (setf program
    
    528
    +	(if (pathnamep program)
    
    529
    +	    (lisp::with-pathname (p program)
    
    530
    +	      (or (unix::unix-namestring p)
    
    531
    +		  (namestring p)))
    
    532
    +	    (namestring program)))
    
    533
    +  (check-type program string)
    
    534
    +
    
    525 535
       ;; Prepend the program to the argument list.
    
    526
    -  (push (namestring program) args)
    
    536
    +  (push program args)
    
    527 537
       ;; Clear random specials used by GET-DESCRIPTOR-FOR to communicate cleanup
    
    528 538
       ;; info.  Also, establish proc at this level so we can return it.
    
    529 539
       (let (*close-on-error* *close-in-parent* *handlers-installed* proc)
    
    ... ... @@ -566,9 +576,10 @@
    566 576
     					     (cdr entry)))
    
    567 577
     					env))
    
    568 578
     			(let ((child-pid
    
    569
    -			       (without-gcing
    
    570
    -				(spawn program argv envp pty-name
    
    571
    -				       stdin stdout stderr))))
    
    579
    +				(without-gcing
    
    580
    +				    (spawn program
    
    581
    +					   argv envp pty-name
    
    582
    +					   stdin stdout stderr))))
    
    572 583
     			  (when (< child-pid 0)
    
    573 584
     			    (error (intl:gettext "Could not fork child process: ~A")
    
    574 585
     				   (unix:get-unix-error-msg)))