From 35a3f462d9ccc5237f0200fcbeafaebb110b5134 Mon Sep 17 00:00:00 2001 From: Dean Deng Date: Mon, 1 Jun 2020 13:29:17 -0700 Subject: Fix inotify test. PiperOrigin-RevId: 314192441 --- test/syscalls/linux/inotify.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'test/syscalls/linux/inotify.cc') diff --git a/test/syscalls/linux/inotify.cc b/test/syscalls/linux/inotify.cc index 2306d9cab..ac5ef2e51 100644 --- a/test/syscalls/linux/inotify.cc +++ b/test/syscalls/linux/inotify.cc @@ -593,12 +593,12 @@ TEST(Inotify, SizeZeroReadWriteGeneratesNothing) { TEST(Inotify, FailedFileCreationGeneratesNoEvents) { const TempPath dir = ASSERT_NO_ERRNO_AND_VALUE(TempPath::CreateDir()); + const std::string dir_path = dir.path(); const FileDescriptor fd = ASSERT_NO_ERRNO_AND_VALUE(InotifyInit1(IN_NONBLOCK)); - ASSERT_NO_ERRNO_AND_VALUE( - InotifyAddWatch(fd.get(), dir.path(), IN_ALL_EVENTS)); + ASSERT_NO_ERRNO_AND_VALUE(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(mknod(p, S_IFIFO, 0777), SyscallFails()); ASSERT_THAT(symlink(p, p), SyscallFails()); -- cgit v1.2.3