From 4d0b87793a047baecf2403455ddca1a82f44a41b Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Thu, 9 Jun 2011 21:03:09 +0300 Subject: [PATCH] sb-posix: make SYSCALL-ERROR's argument optional The symbol is exported, and adding a required argument to the call broke backwards compatibility. Oops. --- NEWS | 2 ++ contrib/sb-posix/interface.lisp | 21 +++++++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/NEWS b/NEWS index 98f1151..497858f 100644 --- 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 diff --git a/contrib/sb-posix/interface.lisp b/contrib/sb-posix/interface.lisp index 732922e..4669aaf 100644 --- a/contrib/sb-posix/interface.lisp +++ b/contrib/sb-posix/interface.lisp @@ -64,14 +64,19 @@ ((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))) -- 1.7.10.4