X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;ds=sidebyside;f=src%2Futcp-test.c;h=564bfba8618472fdcffe646d9dcb54efeb937ce4;hb=2b696ea05e1f519bb37bed5577da9fcd860ece1b;hp=f48ac6948431a0f640895c76a54c0ca078363c8d;hpb=ed210eb557e7fb5edbac89ff43a573ae84a941f9;p=meshlink diff --git a/src/utcp-test.c b/src/utcp-test.c index f48ac694..564bfba8 100644 --- a/src/utcp-test.c +++ b/src/utcp-test.c @@ -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;