Skip to content

Commit

Permalink
fix return value fcntl F_SETFL
Browse files Browse the repository at this point in the history
  • Loading branch information
tlhc committed Aug 27, 2014
1 parent 9b0fe11 commit f8a1d2c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/chinadns.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,7 @@ static int setnonblock(int sock) {
ERR("fcntl");
return -1;
}
fcntl(sock, F_SETFL, flags | O_NONBLOCK);
if(flags == -1) {
if(fcntl(sock, F_SETFL, flags | O_NONBLOCK) == -1) {
ERR("fcntl");
return -1;
}
Expand Down

0 comments on commit f8a1d2c

Please sign in to comment.