Fix resource leak on test binary 82/176882/1 accepted/tizen/unified/20180424.165721 submit/tizen/20180424.064628
authorsangwan.kwon <sangwan.kwon@samsung.com>
Tue, 24 Apr 2018 06:15:41 +0000 (15:15 +0900)
committersangwan.kwon <sangwan.kwon@samsung.com>
Tue, 24 Apr 2018 06:15:41 +0000 (15:15 +0900)
Change-Id: Iba58129c65bbcdd1201158536b99c2f1f5429daf
Signed-off-by: sangwan.kwon <sangwan.kwon@samsung.com>
test/internals/test-file-system.cpp

index 4f60297..684b486 100644 (file)
@@ -70,9 +70,9 @@ void __createFile(const std::string &path)
                return; // already exist
 
        int fd = creat(path.c_str(), S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
-       BOOST_REQUIRE_MESSAGE(fd > 0, "Failed to create file: " << path);
+       BOOST_REQUIRE_MESSAGE(fd != -1, "Failed to create file: " << path);
 
-       if (fd > 0)
+       if (fd != -1)
                ::close(fd);
 }