summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux/open_create.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test/syscalls/linux/open_create.cc')
-rw-r--r--test/syscalls/linux/open_create.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/syscalls/linux/open_create.cc b/test/syscalls/linux/open_create.cc
index f8fbea79e..46f41de50 100644
--- a/test/syscalls/linux/open_create.cc
+++ b/test/syscalls/linux/open_create.cc
@@ -46,8 +46,10 @@ TEST(CreateTest, ExistingFile) {
TEST(CreateTest, CreateAtFile) {
auto dir = ASSERT_NO_ERRNO_AND_VALUE(TempPath::CreateDir());
auto dirfd = ASSERT_NO_ERRNO_AND_VALUE(Open(dir.path(), O_DIRECTORY, 0666));
- EXPECT_THAT(openat(dirfd.get(), "CreateAtFile", O_RDWR | O_CREAT, 0666),
+ int fd;
+ EXPECT_THAT(fd = openat(dirfd.get(), "CreateAtFile", O_RDWR | O_CREAT, 0666),
SyscallSucceeds());
+ EXPECT_THAT(close(fd), SyscallSucceeds());
}
TEST(CreateTest, HonorsUmask_NoRandomSave) {