summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls
diff options
context:
space:
mode:
authorDean Deng <deandeng@google.com>2020-06-01 13:29:17 -0700
committergVisor bot <gvisor-bot@google.com>2020-06-01 13:35:30 -0700
commit35a3f462d9ccc5237f0200fcbeafaebb110b5134 (patch)
tree2bc7b5c88dc9588c158bc17e9b76426c1c0a7a72 /test/syscalls
parent07c3b1dc5561f8ceb376cba1d79a41cd4b7a2533 (diff)
Fix inotify test.
PiperOrigin-RevId: 314192441
Diffstat (limited to 'test/syscalls')
-rw-r--r--test/syscalls/linux/inotify.cc6
1 files changed, 3 insertions, 3 deletions
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());