[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet] branch master updated: make SO_NOSIGPIPE more prom
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet] branch master updated: make SO_NOSIGPIPE more prominent |
Date: |
Sat, 10 Aug 2019 21:42:39 +0200 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
The following commit(s) were added to refs/heads/master by this push:
new ade5133f6 make SO_NOSIGPIPE more prominent
ade5133f6 is described below
commit ade5133f6d79a722bff5d7f66e00c2f4ed19e5dc
Author: Schanzenbach, Martin <address@hidden>
AuthorDate: Sat Aug 10 21:41:05 2019 +0200
make SO_NOSIGPIPE more prominent
---
src/util/network.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/util/network.c b/src/util/network.c
index 90f8c8640..2c16fe8c9 100644
--- a/src/util/network.c
+++ b/src/util/network.c
@@ -343,7 +343,7 @@ socket_set_inheritable (const struct GNUNET_NETWORK_Handle
*h)
*
* @param h the socket to make non-delaying
*/
-static void
+static int
socket_set_nosigpipe (const struct GNUNET_NETWORK_Handle *h)
{
int abs_value = 1;
@@ -352,7 +352,8 @@ socket_set_nosigpipe (const struct GNUNET_NETWORK_Handle *h)
setsockopt (h->fd, SOL_SOCKET, SO_NOSIGPIPE,
(const void *) &abs_value,
sizeof (abs_value)))
- LOG_STRERROR (GNUNET_ERROR_TYPE_WARNING, "setsockopt");
+ return GNUNET_SYSERR;
+ return GNUNET_OK;
}
#endif
@@ -444,7 +445,14 @@ initialize_network_handle (struct GNUNET_NETWORK_Handle *h,
return GNUNET_SYSERR;
}
#ifdef DARWIN
- socket_set_nosigpipe (h);
+ if (GNUNET_SYSERR == socket_set_nosigpipe (h))
+ {
+ eno = errno;
+ GNUNET_break (0);
+ GNUNET_break (GNUNET_OK == GNUNET_NETWORK_socket_close (h));
+ errno = eno;
+ return GNUNET_SYSERR;
+ }
#endif
if ( (type == SOCK_STREAM)
#ifdef AF_UNIX
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] [gnunet] branch master updated: make SO_NOSIGPIPE more prominent,
gnunet <=