summaryrefslogtreecommitdiffhomepage
path: root/test/syscalls/linux/lseek.cc
diff options
context:
space:
mode:
authorAdam Barth <abarth@google.com>2021-08-03 19:51:37 -0700
committergVisor bot <gvisor-bot@google.com>2021-08-03 19:54:35 -0700
commit681e5419042ba6b00d50c82d64c0d556e28de0c7 (patch)
treecb0cc3aa59a2661e652b83c608bcd84641300c30 /test/syscalls/linux/lseek.cc
parent8caf231cb14128938a08208a0580e37e20be1fc1 (diff)
Use GetAbsoluteTestTmpdir() rather than hard-code "/tmp"
This change makes these tests easier to run on systems that have their temp directory in another location. PiperOrigin-RevId: 388601202
Diffstat (limited to 'test/syscalls/linux/lseek.cc')
-rw-r--r--test/syscalls/linux/lseek.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/syscalls/linux/lseek.cc b/test/syscalls/linux/lseek.cc
index d4f89527c..dbc21833f 100644
--- a/test/syscalls/linux/lseek.cc
+++ b/test/syscalls/linux/lseek.cc
@@ -121,7 +121,8 @@ TEST(LseekTest, InvalidFD) {
}
TEST(LseekTest, DirCurEnd) {
- const FileDescriptor fd = ASSERT_NO_ERRNO_AND_VALUE(Open("/tmp", O_RDONLY));
+ const FileDescriptor fd = ASSERT_NO_ERRNO_AND_VALUE(
+ Open(GetAbsoluteTestTmpdir().c_str(), O_RDONLY));
ASSERT_THAT(lseek(fd.get(), 0, SEEK_CUR), SyscallSucceedsWithValue(0));
}