as arguments of arithmetic operators.
* bug fix: on 32-bit platforms, rounding of double floats larger than a
fixnum is correct. (reported by Peter Keller)
+ * bug fix: stray FD-HANDLERs are no longer left lying around after unwinds
+ from RUN-PROGRAM. (lp#840190, reported by Dominic Pearson; fix from Max
+ Mikhanosha)
changes in sbcl-1.0.51 relative to sbcl-1.0.50:
* minor incompatible change: SB-BSD-SOCKET socket streams no longer
(unless proc
(dolist (fd *close-on-error*)
(sb-unix:unix-close fd))
- ;; FIXME: nothing seems to set this.
#-win32
(dolist (handler *handlers-installed*)
- (sb-sys:remove-fd-handler handler))))
- #-win32
- (when (and wait proc)
- (process-wait proc))
+ (sb-sys:remove-fd-handler handler)))
+ #-win32
+ (when (and wait proc)
+ (unwind-protect
+ (process-wait proc)
+ (dolist (handler *handlers-installed*)
+ (sb-sys:remove-fd-handler handler)))))
proc)))
;;; Install a handler for any input that shows up on the file
(strerror errno)))
(t
(incf read-end count)
- (funcall copy-fun))))))))))
+ (funcall copy-fun))))))))
+ (push handler *handlers-installed*)))
;;; FIXME: something very like this is done in SB-POSIX to treat
;;; streams as file descriptor designators; maybe we can combine these
(process-close proc)
(assert (not stopped))))))
+
+;; Check that in when you do run-program with :wait t that causes
+;; encoding error, it does not affect the following run-program
+(with-test (:name (:run-program :clean-exit-after-encoding-error))
+ (let ((had-error-p nil))
+ (flet ((barf (&optional (format :default))
+ (with-output-to-string (stream)
+ (run-program "/usr/bin/perl"
+ '("-e" "print \"\\x20\\xfe\\xff\\x0a\"")
+ :output stream
+ :external-format format)))
+ (no-barf ()
+ (with-output-to-string (stream)
+ (run-program "/bin/echo"
+ '("This is a test")
+ :output stream))))
+ (handler-case
+ (barf :utf-8)
+ (error ()
+ (setq had-error-p t)))
+ (assert had-error-p)
+ ;; now run the harmless program
+ (setq had-error-p nil)
+ (handler-case
+ (no-barf)
+ (error ()
+ (setq had-error-p t)))
+ (assert (not had-error-p)))))
+