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 0caf809
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions common/dev_disconnect.c
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ enum dev_disconnect dev_disconnect(int pkt_type)

void dev_sabotage_fd(int fd, bool close_fd)
{
int fds[2];
int fds[2], dummy_fd;

if (socketpair(AF_UNIX, SOCK_STREAM, 0, fds) != 0)
err(1, "dev_sabotage_fd: creating socketpair");
Expand All @@ -108,7 +108,7 @@ void dev_sabotage_fd(int fd, bool close_fd)

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

0 comments on commit 0caf809

Please sign in to comment.