Fix reversed logic in MSG_NOSIGNAL

This should work better. Thanks to Korli for spotting the issue.
This commit is contained in:
Adrien Destugues
2015-06-11 00:38:42 +02:00
parent e22a18e9f3
commit 79985c3d86
@@ -796,7 +796,7 @@ TCPEndpoint::SendData(net_buffer *buffer)
return EDESTADDRREQ; return EDESTADDRREQ;
if (!is_writable(fState) && !is_establishing(fState)) { if (!is_writable(fState) && !is_establishing(fState)) {
// we only send signals when called from userland // we only send signals when called from userland
if (gStackModule->is_syscall() && ((flags & MSG_NOSIGNAL) != 0)) if (gStackModule->is_syscall() && ((flags & MSG_NOSIGNAL) == 0))
send_signal(find_thread(NULL), SIGPIPE); send_signal(find_thread(NULL), SIGPIPE);
return EPIPE; return EPIPE;
} }