test-tcp: Fix printing of "connection reset" when tcp connection closed
This commit is contained in:
parent
31568fc5a1
commit
f538dd5276
|
@ -99,10 +99,9 @@ int main(int argc, char** argv)
|
|||
{
|
||||
ssize_t nrecv = recv(socket, buffer, sizeof(buffer), 0);
|
||||
if (nrecv == -1)
|
||||
{
|
||||
perror("recv");
|
||||
if (nrecv <= 0)
|
||||
break;
|
||||
}
|
||||
write(STDOUT_FILENO, buffer, nrecv);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue