Commit 16b39f3c authored by Michal 'vorner' Vaner's avatar Michal 'vorner' Vaner
Browse files

[1705] Catch errors

parent fceb2a85
......@@ -111,7 +111,9 @@ recv_fd(const int sock) {
// one returned previously, even if that one is not closed yet. So,
// we just re-number every one we get, so they are unique.
int new_fd(dup(fd));
close(fd);
if (close(fd) == -1 || new_fd == -1) {
return (FD_SYSTEM_ERROR);
}
return (new_fd);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment