diff --git a/src/cas/io/bsdSocket/sigPipeIgnore.c b/src/cas/io/bsdSocket/sigPipeIgnore.c deleted file mode 100644 index 1082cb55c..000000000 --- a/src/cas/io/bsdSocket/sigPipeIgnore.c +++ /dev/null @@ -1,89 +0,0 @@ - -/* - * - * escape into C to call signal because of a brain dead - * signal() func proto supplied in signal.h by gcc 2.7.2 - * - */ - -#include -#include -#include -#include - -#include "sigPipeIgnore.h" - -typedef void (*pSigFunc) (); - -static pSigFunc pReplacedFunc; - -#ifndef UNIX // all os except UNIX - -void installSigPipeIgnore (void) -{ -} - -#else // it is UNIX - -static void localInstallSigPipeIgnore (void); - -/* - * ignoreSigPipe () - */ -static void ignoreSigPipe (int param) -{ - if (pReplacedFunc) { - (*pReplacedFunc) (param); - } - /* - * some versios of unix reset to SIG_DFL - * each time that the signal occurs - */ - localInstallSigPipeIgnore (); -} - -/* - * installSigPipeIgnore () - */ -void installSigPipeIgnore (void) -{ - static int init; - - if (init) { - return; - } - localInstallSigPipeIgnore(); - init = 1; -} - -/* - * localInstallSigPipeIgnore () - * - * dont allow disconnect to terminate process - * when running in UNIX environment - * - * allow error to be returned to sendto() - * instead of handling disconnect at interrupt - */ -static void localInstallSigPipeIgnore (void) -{ - pSigFunc sigRet; - - sigRet = signal (SIGPIPE, ignoreSigPipe); - if (sigRet==SIG_ERR) { - fprintf (stderr, "%s replace of SIGPIPE failed beacuse %s\n", - __FILE__, strerror(errno)); - } - else if (sigRet!=SIG_DFL && sigRet!=SIG_IGN) { - pReplacedFunc = sigRet; - } - /* - * no infinite loops - */ - if (pReplacedFunc==ignoreSigPipe) { - pReplacedFunc = NULL; - } -} - -#endif // UNIX - diff --git a/src/cas/io/bsdSocket/sigPipeIgnore.h b/src/cas/io/bsdSocket/sigPipeIgnore.h deleted file mode 100644 index 264db8ea9..000000000 --- a/src/cas/io/bsdSocket/sigPipeIgnore.h +++ /dev/null @@ -1,16 +0,0 @@ - -/* - * escape into C to call signal because of a brain dead - * signal() func proto supplied in signal.h by gcc 2.7.2 - */ - -#ifdef __cplusplus -extern "C" { -#endif - -void installSigPipeIgnore (void); - -#ifdef __cplusplus -} -#endif -