From 38fe65f8bd50f2525515b0612b8ec1a6e6497e60 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 29 Aug 2020 21:09:35 -0700 Subject: [PATCH] Remove unused variable --- src/PlatformSockets.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/PlatformSockets.c b/src/PlatformSockets.c index d78af09..450412a 100644 --- a/src/PlatformSockets.c +++ b/src/PlatformSockets.c @@ -252,7 +252,6 @@ int setSocketNonBlocking(SOCKET s, int val) { SOCKET createSocket(int addressFamily, int socketType, int protocol, int nonBlocking) { SOCKET s; - int val; s = socket(addressFamily, socketType, protocol); if (s == INVALID_SOCKET) { @@ -261,9 +260,11 @@ SOCKET createSocket(int addressFamily, int socketType, int protocol, int nonBloc } #ifdef LC_DARWIN - // Disable SIGPIPE on iOS - val = 1; - setsockopt(s, SOL_SOCKET, SO_NOSIGPIPE, (char*)&val, sizeof(val)); + { + // Disable SIGPIPE on iOS + int val = 1; + setsockopt(s, SOL_SOCKET, SO_NOSIGPIPE, (char*)&val, sizeof(val)); + } #endif if (nonBlocking) {