diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc index 94ab8d9a7068..d14ab5bb53cc 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc @@ -7306,8 +7306,6 @@ INTERCEPTOR(int, setvbuf, __sanitizer_FILE *stream, char *buf, int mode, int ret = REAL(setvbuf)(stream, buf, mode, size); if (buf) COMMON_INTERCEPTOR_WRITE_RANGE(ctx, buf, size); - if (ret == 0) - unpoison_file(stream); return ret; } #define INIT_SETVBUF COMMON_INTERCEPT_FUNCTION(setvbuf) diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h index 6d81611ec00c..b1b69c466d6b 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h @@ -516,8 +516,7 @@ #define SANITIZER_INTERCEPT_TTYENT SI_NETBSD #define SANITIZER_INTERCEPT_PROTOENT SI_NETBSD #define SANITIZER_INTERCEPT_NETENT SI_NETBSD -#define SANITIZER_INTERCEPT_SETVBUF (SI_NETBSD || SI_FREEBSD || \ - SI_LINUX || SI_MAC) +#define SANITIZER_INTERCEPT_SETVBUF SI_NETBSD #define SANITIZER_INTERCEPT_GETMNTINFO SI_NETBSD #define SANITIZER_INTERCEPT_MI_VECTOR_HASH SI_NETBSD diff --git a/compiler-rt/test/sanitizer_common/TestCases/Posix/setvbuf.cc b/compiler-rt/test/sanitizer_common/TestCases/NetBSD/setvbuf.cc similarity index 85% rename from compiler-rt/test/sanitizer_common/TestCases/Posix/setvbuf.cc rename to compiler-rt/test/sanitizer_common/TestCases/NetBSD/setvbuf.cc index f7c0123e49a3..9a63100c2bf4 100644 --- a/compiler-rt/test/sanitizer_common/TestCases/Posix/setvbuf.cc +++ b/compiler-rt/test/sanitizer_common/TestCases/NetBSD/setvbuf.cc @@ -1,7 +1,5 @@ // RUN: %clangxx -O0 -g %s -o %t && %run %t 2>&1 | FileCheck %s -// UNSUPPORTED: solaris - #include <stdio.h> void print_something() { @@ -9,9 +7,6 @@ void print_something() { printf("Hello world %zu\n", i); } -// setbuffer/setlinebuf/setbuf uses setvbuf -// internally on NetBSD -#if defined(__NetBSD__) void test_setbuf() { char buf[BUFSIZ]; @@ -41,7 +36,6 @@ void test_setlinebuf() { print_something(); } -#endif void test_setvbuf() { char buf[BUFSIZ]; @@ -62,11 +56,9 @@ void test_setvbuf() { int main(void) { printf("setvbuf\n"); -#if defined(__NetBSD__) test_setbuf(); test_setbuffer(); test_setlinebuf(); -#endif test_setvbuf(); // CHECK: setvbuf