From fb60d7ef8d91cac45b51609cb22d0ecf31f225fd Mon Sep 17 00:00:00 2001 From: Emil Renner Berthing Date: Thu, 18 Sep 2014 15:24:48 +0200 Subject: [PATCH 17/31] shared/missing.h: check for missing canonicalize_file_name --- configure.ac | 3 ++- src/basic/missing.h | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 8ff9b97..423dab1 100644 --- a/configure.ac +++ b/configure.ac @@ -306,8 +306,9 @@ AC_SUBST(CAP_LIBS) AC_CHECK_FUNCS([memfd_create]) AC_CHECK_FUNCS([__secure_getenv secure_getenv]) -AC_CHECK_DECLS([gettid, pivot_root, name_to_handle_at, setns, getrandom, renameat2, kcmp, LO_FLAGS_PARTSCAN], +AC_CHECK_DECLS([gettid, pivot_root, canonicalize_file_name, name_to_handle_at, setns, getrandom, renameat2, kcmp, LO_FLAGS_PARTSCAN], [], [], [[ +#include #include #include #include diff --git a/src/basic/missing.h b/src/basic/missing.h index dc1f244..aaf017a 100644 --- a/src/basic/missing.h +++ b/src/basic/missing.h @@ -132,6 +132,12 @@ static inline int pivot_root(const char *new_root, const char *put_old) { } #endif +#if !HAVE_DECL_CANONICALIZE_FILE_NAME +static inline char *canonicalize_file_name(const char *path) { + return realpath(path, NULL); +} +#endif + #ifndef __NR_memfd_create # if defined __x86_64__ # define __NR_memfd_create 319 -- 2.5.2