diff --git a/configure.ac b/configure.ac index 474f750..397bda4 100644 --- a/configure.ac +++ b/configure.ac @@ -66,6 +66,7 @@ AC_FUNC_FORK AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK AC_FUNC_STRNLEN AC_CHECK_FUNCS([atexit dup2 ftruncate getcwd gettimeofday localtime_r memchr memset mkdir rmdir setlocale socket strcasecmp strchr strdup strerror strncasecmp strndup strrchr strspn strstr strtol strtoul], , [AC_MSG_FAILURE([cannot find the $ac_func function, which i3lock requires])]) +AC_CHECK_FUNCS([explicit_bzero]) # Checks for libraries. diff --git a/i3lock.c b/i3lock.c index bab41e0..0c3f5b6 100644 --- a/i3lock.c +++ b/i3lock.c @@ -27,7 +27,6 @@ #include #endif #include -#include #include #include #include @@ -35,7 +34,7 @@ #include #include #include -#ifdef __OpenBSD__ +#ifdef HAVE_EXPLICIT_BZERO #include /* explicit_bzero(3) */ #endif #include @@ -175,7 +174,7 @@ static bool load_compose_table(const char *locale) { * */ static void clear_password_memory(void) { -#ifdef __OpenBSD__ +#ifdef HAVE_EXPLICIT_BZERO /* Use explicit_bzero(3) which was explicitly designed not to be * optimized out by the compiler. */ explicit_bzero(password, strlen(password));