[CLEANUP] remove ifdef MSG_NOSIGNAL and define it instead
ifdefs are really annoying in the code. Define MSG_NOSIGNAL to zero
when undefined and remove associated ifdefs.
diff --git a/src/stream_sock.c b/src/stream_sock.c
index 3a69d1f..f563755 100644
--- a/src/stream_sock.c
+++ b/src/stream_sock.c
@@ -313,8 +313,9 @@
/*
* 2. read the largest possible block
*/
-#ifndef MSG_NOSIGNAL
- {
+ if (MSG_NOSIGNAL) {
+ ret = recv(fd, b->r, max, MSG_NOSIGNAL);
+ } else {
int skerr;
socklen_t lskerr = sizeof(skerr);
@@ -324,9 +325,7 @@
else
ret = recv(fd, b->r, max, 0);
}
-#else
- ret = recv(fd, b->r, max, MSG_NOSIGNAL);
-#endif
+
if (ret > 0) {
b->r += ret;
b->l += ret;
@@ -606,8 +605,9 @@
}
#endif
-#ifndef MSG_NOSIGNAL
- {
+ if (MSG_NOSIGNAL) {
+ ret = send(si->fd, b->w, max, MSG_DONTWAIT | MSG_NOSIGNAL);
+ } else {
int skerr;
socklen_t lskerr = sizeof(skerr);
@@ -617,9 +617,6 @@
else
ret = send(si->fd, b->w, max, MSG_DONTWAIT);
}
-#else
- ret = send(si->fd, b->w, max, MSG_DONTWAIT | MSG_NOSIGNAL);
-#endif
if (ret > 0) {
if (fdtab[si->fd].state == FD_STCONN)