Skip to content

Commit

Permalink
Merge pull request #5 from Zewo/SO_LINGER_on_fix
Browse files Browse the repository at this point in the history
set SO_LINGER to on
  • Loading branch information
paulofaria authored Nov 7, 2017
2 parents e675989 + 5ca5f11 commit 89cd675
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ void fd_close(int s) {
be set, never mind and continue anyway. */
struct linger lng;
lng.l_onoff=1;
lng.l_linger=0;
lng.l_linger=1;
setsockopt(s, SOL_SOCKET, SO_LINGER, (void*)&lng, sizeof(lng));
/* We are not checking the error here. close() has inconsistent behaviour
and leaking a file descriptor is better than crashing the entire
Expand Down

0 comments on commit 89cd675

Please sign in to comment.