From 93d471ce7152c820b1a64f2cecb28647660527b9 Mon Sep 17 00:00:00 2001 From: Stelian Ionescu Date: Thu, 17 Apr 2008 20:33:55 +0200 Subject: [PATCH] Set SO_NOSIGPIPE by default on FreeBSD in %%init-* functions. Signed-off-by: Stelian Ionescu --- net.sockets/make-socket.lisp | 4 ++++ net.sockets/socket-methods.lisp | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/net.sockets/make-socket.lisp b/net.sockets/make-socket.lisp index 0c34ba0..411871d 100644 --- a/net.sockets/make-socket.lisp +++ b/net.sockets/make-socket.lisp @@ -51,6 +51,7 @@ If a non-local exit occurs during the execution of `BODY' call CLOSE with :ABORT local-host local-port remote-host remote-port) (let ((local-port (ensure-numerical-service local-port)) (remote-port (ensure-numerical-service remote-port))) + #+freebsd (setf (socket-option socket :no-sigpipe) t) (when keepalive (setf (socket-option socket :keep-alive) t)) (when nodelay (setf (socket-option socket :tcp-nodelay) t)) (when local-host @@ -136,6 +137,7 @@ If a non-local exit occurs during the execution of `BODY' call CLOSE with :ABORT ;;; Local Stream Active Socket creation (defun %%init-local-stream-active-socket (socket local-filename remote-filename) + #+freebsd (setf (socket-option socket :no-sigpipe) t) (when local-filename (bind-address socket (ensure-address local-filename :family :local))) (when remote-filename @@ -199,6 +201,7 @@ If a non-local exit occurs during the execution of `BODY' call CLOSE with :ABORT (defun %%init-internet-datagram-socket (socket broadcast interface reuse-address local-host local-port remote-host remote-port) #-linux (declare (ignore interface)) + #+freebsd (setf (socket-option socket :no-sigpipe) t) (let ((local-port (ensure-numerical-service local-port)) (remote-port (ensure-numerical-service remote-port))) (when broadcast (setf (socket-option socket :broadcast) t)) @@ -241,6 +244,7 @@ If a non-local exit occurs during the execution of `BODY' call CLOSE with :ABORT ;;; Local Datagram Socket creation (defun %%init-local-datagram-socket (socket local-filename remote-filename) + #+freebsd (setf (socket-option socket :no-sigpipe) t) (when local-filename (bind-address socket (ensure-address local-filename :family :local))) (when remote-filename diff --git a/net.sockets/socket-methods.lisp b/net.sockets/socket-methods.lisp index c95214c..123e480 100644 --- a/net.sockets/socket-methods.lisp +++ b/net.sockets/socket-methods.lisp @@ -280,11 +280,6 @@ ;;;; CONNECT -(defmethod connect :before ((socket active-socket) address &key) - (declare (ignore address)) -#+freebsd - (setf (socket-option socket :no-sigpipe) t)) - (defun ipv4-connect (fd address port) (with-sockaddr-in (sin address port) (%connect fd sin size-of-sockaddr-in))) -- 2.11.4.GIT