[libc-commits] [libc] [libc] Fix suseconds_t definition and utimes_test (PR #134326)

via libc-commits libc-commits at lists.llvm.org
Fri Apr 4 11:35:41 PDT 2025


================
@@ -17,14 +17,17 @@
 #include "test/UnitTest/ErrnoSetterMatcher.h"
 #include "test/UnitTest/Test.h"
 
+#include <sys/stat.h>
+
 // SUCCESS: Takes a file and successfully updates
 // its last access and modified times.
 TEST(LlvmLibcUtimesTest, ChangeTimesSpecific) {
   using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
 
   constexpr const char *FILE_PATH = "utimes_pass.test";
   auto TEST_FILE = libc_make_test_file_path(FILE_PATH);
-  int fd = LIBC_NAMESPACE::open(TEST_FILE, O_WRONLY | O_CREAT);
+  int fd = LIBC_NAMESPACE::open(TEST_FILE, O_WRONLY | O_CREAT, S_IRWXU);
+  ASSERT_ERRNO_SUCCESS();
----------------
lntue wrote:

Should we use the new `ErrnoCheckingTest` class for this test?

https://github.com/llvm/llvm-project/pull/134326


More information about the libc-commits mailing list