Skip to content

Commit

Permalink
squashme: Don't leak a file descriptor in datadirectory test
Browse files Browse the repository at this point in the history
  • Loading branch information
laanwj committed Feb 15, 2018
1 parent 1084d09 commit 46d4632
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/test/util_tests.cpp
Expand Up @@ -636,6 +636,7 @@ static void TestOtherProcess(fs::path dirname, std::string lockname, int fd)
rv = write(fd, &ch, 1);
break;
case ExitCommand:
close(fd);
exit(0);
default:
assert(0);
Expand Down Expand Up @@ -725,6 +726,7 @@ BOOST_AUTO_TEST_CASE(test_LockDirectory)

// Restore SIGCHLD
signal(SIGCHLD, old_handler);
BOOST_CHECK_EQUAL(close(fd[1]), 0); // Close our side of the socketpair
#endif
// Clean up
ReleaseDirectoryLocks();
Expand Down

0 comments on commit 46d4632

Please sign in to comment.