Added a note regarding SO_NOSIGPIPE

This commit is contained in:
ANR2ME committed 2022-05-18 01:14:01 +07:00
1 parent f3dd1d908b
commit 1aa56ec942
1 file changed
+1
+1
View File
@@ -2038,6 +2038,7 @@ int setSockNoSIGPIPE(int sock, int flag) {
// Set SIGPIPE when supported (ie. BSD/MacOS X)
int opt = flag;
#if defined(SO_NOSIGPIPE)
// Note: Linux might have SO_NOSIGPIPE defined too, but using it on setsockopt will result to EINVAL error
return setsockopt(sock, SOL_SOCKET, SO_NOSIGPIPE, (void*)&opt, sizeof(opt));
#endif
return -1;