From 084365f1a1ebed26f2a15e5fc57230a3d7bcdad7 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 7 May 2019 12:59:52 +0200 Subject: [PATCH] build-sys: use __SANITIZE_ADDRESS__ rather than custom USE_CLOSE_ATEXIT Signed-off-by: Karel Zak --- configure.ac | 3 --- include/closestream.h | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/configure.ac b/configure.ac index 93303469c2..c314edd650 100644 --- a/configure.ac +++ b/configure.ac @@ -156,10 +156,7 @@ AC_ARG_ENABLE([asan], AS_IF([test "x$enable_asan" = xyes], [ UL_WARN_ADD([-fsanitize=address]) ASAN_LDFLAGS="-fsanitize=address" -],[ - AC_DEFINE([USE_CLOSE_ATEXIT], [1], [close stdout at exit]) ]) - AC_SUBST([ASAN_LDFLAGS]) dnl libtool-2 diff --git a/include/closestream.h b/include/closestream.h index 0ce34fe52d..6a62e48e8a 100644 --- a/include/closestream.h +++ b/include/closestream.h @@ -57,7 +57,7 @@ close_stdout_atexit(void) /* * Note that close stdout at exit disables ASAN to report memory leaks */ -#ifdef USE_CLOSE_ATEXIT +#if !defined(__SANITIZE_ADDRESS__) atexit(close_stdout); #endif } -- 2.47.2