summaryrefslogtreecommitdiff
path: root/test/sanitizer_common
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2018-03-26 01:29:48 +0000
committerVitaly Buka <vitalybuka@google.com>2018-03-26 01:29:48 +0000
commit1e64638ed164f0981d2c8987c104590339fbff3d (patch)
tree91b071fd93f2d89f067494ab0558e4db176623d1 /test/sanitizer_common
parentc98416104dcbc5b7a6251ab9a0ccbc929d9c7868 (diff)
[sanitizer] Make test compatible with Darwin
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@328467 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/sanitizer_common')
-rw-r--r--test/sanitizer_common/TestCases/Posix/access.cc2
-rw-r--r--test/sanitizer_common/TestCases/Posix/devname_r.cc4
2 files changed, 3 insertions, 3 deletions
diff --git a/test/sanitizer_common/TestCases/Posix/access.cc b/test/sanitizer_common/TestCases/Posix/access.cc
index 92c2a9fd8..8623645f8 100644
--- a/test/sanitizer_common/TestCases/Posix/access.cc
+++ b/test/sanitizer_common/TestCases/Posix/access.cc
@@ -2,4 +2,4 @@
#include <unistd.h>
-int main(void) { return access("/root", F_OK); }
+int main(void) { return access("/dev/null", F_OK); }
diff --git a/test/sanitizer_common/TestCases/Posix/devname_r.cc b/test/sanitizer_common/TestCases/Posix/devname_r.cc
index f7925f555..826b7c92e 100644
--- a/test/sanitizer_common/TestCases/Posix/devname_r.cc
+++ b/test/sanitizer_common/TestCases/Posix/devname_r.cc
@@ -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);