Fix unused warning for IsFdOpen()

PiperOrigin-RevId: 282346983
Change-Id: I7010caf0e6f3ddb420ef992f6aa2554d540667a3
This commit is contained in:
Christian Blichmann 2019-11-25 06:43:49 -08:00 committed by Copybara-Service
parent 4f892864c8
commit 5c38f62ba7

View File

@ -79,16 +79,6 @@ int RunTestcase(const std::string& path, const std::vector<std::string>& args) {
} }
} }
bool IsFdOpen(int fd) {
int ret = fcntl(fd, F_GETFD);
if (ret == -1) {
VLOG(1) << "FD: " << fd << " is closed";
return false;
}
VLOG(1) << "FD: " << fd << " is open";
return true;
}
// Test that marking file descriptors as close-on-exec works. // Test that marking file descriptors as close-on-exec works.
TEST(SanitizerTest, TestMarkFDsAsCOE) { TEST(SanitizerTest, TestMarkFDsAsCOE) {
// Open a few file descriptors in non-close-on-exec mode. // Open a few file descriptors in non-close-on-exec mode.