Changeset 13382


Ignore:
Timestamp:
Jan 12, 2010, 6:59:49 PM (10 years ago)
Author:
rme
Message:

On Linux, the EAI_xxx error codes (as returned by getaddrinfo or
getnameinfo) are negative.

Therefore, don't mess with the sign of the error code in socket-error
when nameserver-p is true, and don't mess with the sign at all in
%gai-strerror.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/l1-sockets.lisp

    r13377 r13382  
    238238
    239239#-windows-target
    240 (defun %gai-strerror (errno)
    241   (let* ((err (abs errno))
    242          (p (#_gai_strerror err)))
     240(defun %gai-strerror (err)
     241  (let ((p (#_gai_strerror err)))
    243242    (if (%null-ptr-p p)
    244243      (format nil "Unknown nameserver error ~d" err)
     
    248247  "Creates and signals (via error) one of two socket error
    249248conditions, based on the state of the arguments."
    250   (when (< errno 0)
    251     (setq errno (- errno)))
     249  (unless nameserver-p
     250    (setq errno (abs errno)))
    252251  (if stream
    253252    (error (make-condition 'socket-error
Note: See TracChangeset for help on using the changeset viewer.