diff --git a/configure.ac b/configure.ac index 8b783a877..5c83e2a46 100644 --- a/configure.ac +++ b/configure.ac @@ -122,6 +122,8 @@ AC_CHECK_HEADERS([dlfcn.h string.h unistd.h sys/fcntl.h sys/ioctl.h linux/random [LIBBLOCKDEV_SOFT_FAILURE([Header file $ac_header not found.])], []) +AC_CHECK_FUNCS([strerror_l]) + AC_ARG_WITH([bcache], AS_HELP_STRING([--with-bcache], [support bcache @<:@default=yes@:>@]), [], diff --git a/src/plugins/crypto.c b/src/plugins/crypto.c index 8beae0985..f7646ec94 100644 --- a/src/plugins/crypto.c +++ b/src/plugins/crypto.c @@ -71,6 +71,13 @@ #define UNUSED __attribute__((unused)) +#if !defined(HAVE_STRERROR_L) +static char *strerror_l(int errnum, locale_t locale UNUSED) +{ + return strerror(errnum); +} +#endif + /** * SECTION: crypto * @short_description: plugin for operations with encrypted devices diff --git a/src/utils/module.c b/src/utils/module.c index 254ee251c..0870485ed 100644 --- a/src/utils/module.c +++ b/src/utils/module.c @@ -259,6 +259,14 @@ gboolean bd_utils_unload_kernel_module (const gchar *module_name, GError **error return TRUE; } +#define UNUSED __attribute__((unused)) + +#if !defined(HAVE_STRERROR_L) +static char *strerror_l(int errnum, locale_t locale UNUSED) +{ + return strerror(errnum); +} +#endif static BDUtilsLinuxVersion detected_linux_ver; static gboolean have_linux_ver = FALSE;