]> git.meshlink.io Git - meshlink/blobdiff - src/utcp-test.c
Don't use assert() to check the results of pthread_*() calls.
[meshlink] / src / utcp-test.c
index f48ac6948431a0f640895c76a54c0ca078363c8d..564bfba8618472fdcffe646d9dcb54efeb937ce4 100644 (file)
@@ -164,6 +164,8 @@ static void set_mtu(struct utcp *u, int s) {
                getsockopt(s, IPPROTO_IP, IP_MTU, &mtu, &optlen);
        }
 
+#else
+       (void)s;
 #endif
 
        if(!mtu || mtu == 65535) {
@@ -268,6 +270,11 @@ int main(int argc, char *argv[]) {
                        return 1;
                }
        } else {
+#ifdef SO_NOSIGPIPE
+               int nosigpipe = 1;
+               setsockopt(s, SOL_SOCKET, SO_NOSIGPIPE, &nosigpipe, sizeof(nosigpipe));
+#endif
+
                if(connect(s, ai->ai_addr, ai->ai_addrlen)) {
                        debug("Could not connect: %s\n", strerror(errno));
                        return 1;