From fa4e4bf174c3fa7e57812b124d5a118f17d60bb9 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Wed, 18 May 2016 22:12:07 +0200 Subject: [PATCH] Fix & simplify MADV_DO{NO}DUMP alternatives --- src/libsodium/sodium/utils.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/libsodium/sodium/utils.c b/src/libsodium/sodium/utils.c index 625b291a..c9f11baf 100644 --- a/src/libsodium/sodium/utils.c +++ b/src/libsodium/sodium/utils.c @@ -50,12 +50,9 @@ #if defined(HAVE_ALIGNED_MALLOC) && (defined(WINAPI_DESKTOP) || defined(HAVE_MPROTECT)) # define HAVE_PAGE_PROTECTION #endif -/* FreeBSD defines these with its own names */ -if !defined(MADV_DONTDUMP) && defined(HAVE_MADVISE) -# define MADV_DONTDUMP MADV_NOCORE -#endif -if !defined(MADV_DODUMP) && defined(HAVE_MADVISE) -# define MADV_DODUMP MADV_CORE +#if !defined(MADV_DODUMP) && defined(MADV_CORE) +# define MADV_DODUMP MADV_CORE +# define MADV_DONTDUMP MADV_NOCORE #endif static size_t page_size;