netperf: handle EPIPE / silence warnings

This is an intermediate fix to handle sends to sockets shut down by the
peer already. A final fix in the libc would add support for the
MSG_NOSIGNAL send flag, generate SIGPIPE, and return the expected EINTR.
Then this patch is no longer required.

This commit also drops the obsolete patch for missing
sysconf(_SC_NPROCESSORS_ONLN), which is now part of libc.
This commit is contained in:
Christian Helmuth 2019-11-11 17:11:00 +01:00
parent a3cb9d9897
commit 6410e88698
3 changed files with 13 additions and 13 deletions

View File

@ -1 +1 @@
0f8fcff2de9f71c697739023726f0ae9b0fef28a
7b5692dcbe87fc7e4fb528e33c5522f8f832c56d

View File

@ -1,15 +1,4 @@
+++ src/app/netperf/src/netlib.c
@@ -844,6 +844,10 @@
exit(1);
}
+ /* On Genode libc port -1 is returned for sysconf(_SC_NPROCESSORS_ONLN) */
+ if (temp_cpus < 0)
+ temp_cpus = 1;
+
return(temp_cpus);
}
@@ -1095,8 +1095,13 @@
#endif /* WIN32 */
@ -34,3 +23,13 @@
}
if (debug > 1) {
fprintf(where, "netperf: set_sock_buffer: %s of %d requested.\n",
+++ src/app/netperf/src/netlib.h
@@ -368,7 +368,7 @@
/* Let's define a macro to hide all of this. */
#ifndef WIN32
-#define SOCKET_EINTR(return_value) (errno == EINTR)
+#define SOCKET_EINTR(return_value) (errno == EINTR || errno == EPIPE)
#define SOCKET_EADDRINUSE(return_value) (errno == EADDRINUSE)
#define SOCKET_EADDRNOTAVAIL(return_value) (errno == EADDRNOTAVAIL)

View File

@ -14,7 +14,8 @@ SRC_CC += timer.cc
INC_DIR += $(PRG_DIR)
CC_OPT += -DHAVE_CONFIG_H -DGENODE_BUILD
CC_WARN = -Wall -Wno-unused
CC_WARN = -Wall -Wno-unused -Wno-maybe-uninitialized -Wno-format-truncation \
-Wno-stringop-truncation -Wno-stringop-overflow
CC_CXX_WARN_STRICT =