From fed74298cbec64c44b03fd3c24b8daa50072221d Mon Sep 17 00:00:00 2001 From: Jay Foad Date: Thu, 23 Apr 2015 22:20:33 +0000 Subject: [PATCH] [Sanitizer] Fix getpwnam test on ppc64le Fedora 21. Summary: On ppc64le Fedora 21, getpwnam_r("no-such-user", ...) returns ENOENT instead of 0. Tolerate this in the test case. Reviewers: eugenis Reviewed By: eugenis Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9233 llvm-svn: 235654 --- .../test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/compiler-rt/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cc b/compiler-rt/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cc index a8b51d7..c0d6cfe 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cc +++ b/compiler-rt/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cc @@ -2,6 +2,7 @@ // RUN: %clangxx -O0 -g %s -o %t && %run %t #include +#include #include #include #include @@ -13,7 +14,7 @@ int main(void) { struct passwd *pwdres; char buf[10000]; int res = getpwnam_r("no-such-user", &pwd, buf, sizeof(buf), &pwdres); - assert(res == 0); + assert(res == 0 || res == ENOENT); assert(pwdres == 0); return 0; } -- 2.7.4