sb-posix: make SYSCALL-ERROR's argument optional
authorNikodemus Siivola <nikodemus@random-state.net>
Thu, 9 Jun 2011 18:03:09 +0000 (21:03 +0300)
committerNikodemus Siivola <nikodemus@random-state.net>
Thu, 9 Jun 2011 18:05:46 +0000 (21:05 +0300)
  The symbol is exported, and adding a required argument to the call broke
  backwards compatibility.

  Oops.

NEWS
contrib/sb-posix/interface.lisp

diff --git a/NEWS b/NEWS
index 98f1151..497858f 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,8 @@ changes relative to sbcl-1.0.49:
     the offending handler.
   * bug fix: bound derivation for floating point operations is now more
     careful about rounding possibly closing open bounds. (lp#793771)
+  * bug fix: SB-POSIX:SYSCALL-ERROR's argument is now optional. (accidental
+    backwards incompatible change in 1.0.48.27)
 
 changes in sbcl-1.0.49 relative to sbcl-1.0.48:
   * minor incompatible change: WITH-LOCKED-HASH-TABLE no longer disables
index 732922e..4669aaf 100644 (file)
   ((errno :initarg :errno :reader sb-posix:syscall-errno)
    (name :initarg :name :initform nil :reader sb-posix:syscall-name))
   (:report (lambda (c s)
-             (let ((errno (sb-posix:syscall-errno c)))
-               (format s "Error in ~S: ~A (~A)"
-                       (sb-posix:syscall-name c)
-                       (sb-int:strerror errno)
-                       errno)))))
-
-(declaim (ftype (function (symbol) nil) syscall-error))
-(defun syscall-error (name)
+             (let ((errno (sb-posix:syscall-errno c))
+                   (name (sb-posix:syscall-name c)))
+               (if name
+                   (format s "Error in ~S: ~A (~A)"
+                           name
+                           (sb-int:strerror errno)
+                           errno)
+                   (format s "Error in syscall: ~A (~A)"
+                           (sb-int:strerror errno)
+                           errno))))))
+
+(declaim (ftype (function (&optional symbol) nil) syscall-error))
+(defun syscall-error (&optional name)
   (error 'sb-posix:syscall-error
          :name name
          :errno (get-errno)))