From 48d19f6961475b2633a8c14a4966bde981820735 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Mon, 26 Mar 2018 01:29:48 +0000 Subject: [PATCH] [sanitizer] Make test compatible with Darwin llvm-svn: 328467 --- compiler-rt/test/sanitizer_common/TestCases/Posix/access.cc | 2 +- .../test/sanitizer_common/TestCases/Posix/devname_r.cc | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/access.cc b/compiler-rt/test/sanitizer_common/TestCases/Posix/access.cc index 92c2a9fd847a..8623645f8bdf 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/Posix/access.cc +++ b/compiler-rt/test/sanitizer_common/TestCases/Posix/access.cc @@ -2,4 +2,4 @@ #include -int main(void) { return access("/root", F_OK); } +int main(void) { return access("/dev/null", F_OK); } diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/devname_r.cc b/compiler-rt/test/sanitizer_common/TestCases/Posix/devname_r.cc index f7925f55597d..826b7c92ef2f 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/Posix/devname_r.cc +++ b/compiler-rt/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);