Skip to content

Commit

Permalink
fixup! dev_disconnect: new option to stop using connection, but don't…
Browse files Browse the repository at this point in the history
… close.
  • Loading branch information
cdecker committed May 26, 2021
1 parent 875d2c8 commit f7f6b60
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions common/dev_disconnect.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,11 @@ void dev_sabotage_fd(int fd, bool close_fd)
#endif

/* Move fd out the way if we don't want to close it. */
if (!close_fd)
dup(fd);
else
if (!close_fd) {
if (dup(fd) == -1) {
; /* -Wunused-result */
}
} else
/* Close other end of socket. */
close(fds[0]);

Expand Down

0 comments on commit f7f6b60

Please sign in to comment.