[compiler-rt] a0879f2 - [NFC][sanitizer] Skip O_TMPFILE if FS does not support it

Vitaly Buka via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 22 18:13:17 PDT 2024


Author: Vitaly Buka
Date: 2024-09-22T18:12:59-07:00
New Revision: a0879f2054bbd7278ff729c8b5e8442c0e5c7f00

URL: https://github.com/llvm/llvm-project/commit/a0879f2054bbd7278ff729c8b5e8442c0e5c7f00
DIFF: https://github.com/llvm/llvm-project/commit/a0879f2054bbd7278ff729c8b5e8442c0e5c7f00.diff

LOG: [NFC][sanitizer] Skip O_TMPFILE if FS does not support it

Added: 
    

Modified: 
    compiler-rt/test/sanitizer_common/TestCases/Posix/variadic-open.cpp

Removed: 
    


################################################################################
diff  --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/variadic-open.cpp b/compiler-rt/test/sanitizer_common/TestCases/Posix/variadic-open.cpp
index 62fcab0316f78f..81696680c549ea 100644
--- a/compiler-rt/test/sanitizer_common/TestCases/Posix/variadic-open.cpp
+++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/variadic-open.cpp
@@ -4,6 +4,7 @@
 // RUN: %run %t 2
 
 #include <assert.h>
+#include <errno.h>
 #include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -13,8 +14,11 @@
 
 void test(const char *path, int flags) {
   int fd = open(path, flags, 0600);
-  if (fd == -1)
+  if (fd == -1) {
     perror(path);
+    if (errno == EOPNOTSUPP)
+      return;
+  }
   assert(fd != -1);
   struct stat info;
   int result = fstat(fd, &info);


        


More information about the llvm-commits mailing list