mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 14:57:35 +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);
|
size_t peer_address_size = sizeof(peer_address);
|
||||||
int result = recvfrom(fd, &response, sizeof(response), 0, (sockaddr*)&peer_address, (socklen_t*)&peer_address_size);
|
int result = recvfrom(fd, &response, sizeof(response), 0, (sockaddr*)&peer_address, (socklen_t*)&peer_address_size);
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
if (result == EAGAIN)
|
if (errno == EAGAIN)
|
||||||
return -1;
|
return -1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue