projects
/
yaz-moved-to-github.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a92a7ff
)
Ignore SIGPIPE on systems that cannot prevent signal on send (Solaris)
author
Adam Dickmeiss
<adam@indexdata.dk>
Tue, 19 Feb 2002 20:02:40 +0000
(20:02 +0000)
committer
Adam Dickmeiss
<adam@indexdata.dk>
Tue, 19 Feb 2002 20:02:40 +0000
(20:02 +0000)
comstack/tcpip.c
patch
|
blob
|
history
diff --git
a/comstack/tcpip.c
b/comstack/tcpip.c
index
311b6e2
..
dac5b2a
100644
(file)
--- a/
comstack/tcpip.c
+++ b/
comstack/tcpip.c
@@
-2,7
+2,7
@@
* Copyright (c) 1995-2002, Index Data
* See the file LICENSE for details.
*
* Copyright (c) 1995-2002, Index Data
* See the file LICENSE for details.
*
- * $Id: tcpip.c,v 1.45 2002-01-21 21:50:32 adam Exp $
+ * $Id: tcpip.c,v 1.46 2002-02-19 20:02:40 adam Exp $
*/
#include <stdio.h>
*/
#include <stdio.h>
@@
-13,6
+13,7
@@
#endif
#include <errno.h>
#include <fcntl.h>
#endif
#include <errno.h>
#include <fcntl.h>
+#include <signal.h>
#if HAVE_OPENSSL_SSL_H
#include <openssl/ssl.h>
#include <openssl/err.h>
#if HAVE_OPENSSL_SSL_H
#include <openssl/ssl.h>
#include <openssl/err.h>
@@
-125,10
+126,17
@@
COMSTACK tcpip_type(int s, int blocking, int protocol, void *vp)
#ifdef WIN32
if (!(p->blocking = blocking) && ioctlsocket(s, FIONBIO, &tru) < 0)
#ifdef WIN32
if (!(p->blocking = blocking) && ioctlsocket(s, FIONBIO, &tru) < 0)
+ return 0;
#else
#else
- if (!(p->blocking = blocking) && fcntl(s, F_SETFL, O_NONBLOCK) < 0)
+ if (!(p->blocking = blocking))
+ {
+ if (fcntl(s, F_SETFL, O_NONBLOCK) < 0)
+ return 0;
+#ifndef MSG_NOSIGNAL
+ signal (SIGPIPE, SIG_IGN);
+#endif
+ }
#endif
#endif
- return 0;
p->io_pending = 0;
p->iofile = s;
p->io_pending = 0;
p->iofile = s;