Fix inotify test.

PiperOrigin-RevId: 314192441
This commit is contained in:
Dean Deng 2020-06-01 13:29:17 -07:00 committed by gVisor bot
parent 07c3b1dc55
commit 35a3f462d9
1 changed files with 3 additions and 3 deletions

View File

@ -593,12 +593,12 @@ TEST(Inotify, SizeZeroReadWriteGeneratesNothing) {
TEST(Inotify, FailedFileCreationGeneratesNoEvents) { TEST(Inotify, FailedFileCreationGeneratesNoEvents) {
const TempPath dir = ASSERT_NO_ERRNO_AND_VALUE(TempPath::CreateDir()); const TempPath dir = ASSERT_NO_ERRNO_AND_VALUE(TempPath::CreateDir());
const std::string dir_path = dir.path();
const FileDescriptor fd = const FileDescriptor fd =
ASSERT_NO_ERRNO_AND_VALUE(InotifyInit1(IN_NONBLOCK)); ASSERT_NO_ERRNO_AND_VALUE(InotifyInit1(IN_NONBLOCK));
ASSERT_NO_ERRNO_AND_VALUE( ASSERT_NO_ERRNO_AND_VALUE(InotifyAddWatch(fd.get(), dir_path, IN_ALL_EVENTS));
InotifyAddWatch(fd.get(), dir.path(), IN_ALL_EVENTS));
const char* p = dir.path().c_str(); const char* p = dir_path.c_str();
ASSERT_THAT(mkdir(p, 0777), SyscallFails()); ASSERT_THAT(mkdir(p, 0777), SyscallFails());
ASSERT_THAT(mknod(p, S_IFIFO, 0777), SyscallFails()); ASSERT_THAT(mknod(p, S_IFIFO, 0777), SyscallFails());
ASSERT_THAT(symlink(p, p), SyscallFails()); ASSERT_THAT(symlink(p, p), SyscallFails());