diff --git a/test/syscalls/linux/inotify.cc b/test/syscalls/linux/inotify.cc index 154a86522..07fd89c63 100644 --- a/test/syscalls/linux/inotify.cc +++ b/test/syscalls/linux/inotify.cc @@ -374,20 +374,27 @@ TEST(Inotify, NonBlockingReadReturnsEagain) { TEST(Inotify, AddWatchOnInvalidFdFails) { // Garbage fd. - EXPECT_THAT(inotify_add_watch(-1, "/tmp", IN_ALL_EVENTS), - SyscallFailsWithErrno(EBADF)); - EXPECT_THAT(inotify_add_watch(1337, "/tmp", IN_ALL_EVENTS), - SyscallFailsWithErrno(EBADF)); + EXPECT_THAT( + inotify_add_watch(-1, GetAbsoluteTestTmpdir().c_str(), IN_ALL_EVENTS), + SyscallFailsWithErrno(EBADF)); + EXPECT_THAT( + inotify_add_watch(1337, GetAbsoluteTestTmpdir().c_str(), IN_ALL_EVENTS), + SyscallFailsWithErrno(EBADF)); // Non-inotify fds. - EXPECT_THAT(inotify_add_watch(0, "/tmp", IN_ALL_EVENTS), - SyscallFailsWithErrno(EINVAL)); - EXPECT_THAT(inotify_add_watch(1, "/tmp", IN_ALL_EVENTS), - SyscallFailsWithErrno(EINVAL)); - EXPECT_THAT(inotify_add_watch(2, "/tmp", IN_ALL_EVENTS), - SyscallFailsWithErrno(EINVAL)); - const FileDescriptor fd = ASSERT_NO_ERRNO_AND_VALUE(Open("/tmp", O_RDONLY)); - EXPECT_THAT(inotify_add_watch(fd.get(), "/tmp", IN_ALL_EVENTS), + EXPECT_THAT( + inotify_add_watch(0, GetAbsoluteTestTmpdir().c_str(), IN_ALL_EVENTS), + SyscallFailsWithErrno(EINVAL)); + EXPECT_THAT( + inotify_add_watch(1, GetAbsoluteTestTmpdir().c_str(), IN_ALL_EVENTS), + SyscallFailsWithErrno(EINVAL)); + EXPECT_THAT( + inotify_add_watch(2, GetAbsoluteTestTmpdir().c_str(), IN_ALL_EVENTS), + SyscallFailsWithErrno(EINVAL)); + const FileDescriptor fd = ASSERT_NO_ERRNO_AND_VALUE( + Open(GetAbsoluteTestTmpdir().c_str(), O_RDONLY)); + EXPECT_THAT(inotify_add_watch(fd.get(), GetAbsoluteTestTmpdir().c_str(), + IN_ALL_EVENTS), SyscallFailsWithErrno(EINVAL)); }