[sanitizer] Make test compatible with Darwin
authorVitaly Buka <vitalybuka@google.com>
Mon, 26 Mar 2018 01:29:48 +0000 (01:29 +0000)
committerVitaly Buka <vitalybuka@google.com>
Mon, 26 Mar 2018 01:29:48 +0000 (01:29 +0000)
llvm-svn: 328467

compiler-rt/test/sanitizer_common/TestCases/Posix/access.cc
compiler-rt/test/sanitizer_common/TestCases/Posix/devname_r.cc

index 92c2a9f..8623645 100644 (file)
@@ -2,4 +2,4 @@
 
 #include <unistd.h>
 
-int main(void) { return access("/root", F_OK); }
+int main(void) { return access("/dev/null", F_OK); }
index f7925f5..826b7c9 100644 (file)
@@ -9,7 +9,7 @@
 
 int main(void) {
   struct stat st;
-  char name[10];
+  char name[100];
   mode_t type;
 
   if (stat("/dev/null", &st))
@@ -17,7 +17,7 @@ int main(void) {
 
   type = S_ISCHR(st.st_mode) ? S_IFCHR : S_IFBLK;
 
-  if (devname_r(st.st_rdev, type, name, sizeof(name)))
+  if (!devname_r(st.st_rdev, type, name, sizeof(name)))
     exit(1);
 
   printf("%s\n", name);