mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 22:08:10 +00:00
Utilities: Fix incorrect error handling in traceroute
The result will be -1 on error, and the error value will be stored in errno. PVS-Studio found this because result it saw result < 0 and new EFAULT is < 0, so this could never be true.
This commit is contained in:
parent
7691c7abcb
commit
3590c55b69
1 changed files with 1 additions and 1 deletions
|
@ -114,7 +114,7 @@ int main(int argc, char** argv)
|
|||
size_t peer_address_size = sizeof(peer_address);
|
||||
int result = recvfrom(fd, &response, sizeof(response), 0, (sockaddr*)&peer_address, (socklen_t*)&peer_address_size);
|
||||
if (result < 0) {
|
||||
if (result == EAGAIN)
|
||||
if (errno == EAGAIN)
|
||||
return -1;
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue