From 6272a2b485f22fd021541d21bc2c2d4831bd2864 Mon Sep 17 00:00:00 2001 From: Dominik Schmidt Date: Mon, 20 Feb 2012 18:27:23 +0100 Subject: [PATCH] Use stat if lstat is not available --- ConfigureChecks.cmake | 2 ++ config.h.cmake | 1 + src/std/c_private.h | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index eda34361a3..bf55d3a2bb 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -50,4 +50,6 @@ check_function_exists(strerror_r HAVE_STRERROR_R) check_function_exists(utimes HAVE_UTIMES) +check_function_exists(lstat HAVE_LSTAT) + set(CSYNC_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CACHE INTERNAL "csync required system libraries") diff --git a/config.h.cmake b/config.h.cmake index ff7321c4c2..53073ad0e7 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -13,3 +13,4 @@ #cmakedefine WITH_LOG4C 1 #cmakedefine HAVE_STRERROR_R #cmakedefine HAVE_UTIMES +#cmakedefine HAVE_LSTAT \ No newline at end of file diff --git a/src/std/c_private.h b/src/std/c_private.h index 3cc6ee25a5..0b11cf3cec 100644 --- a/src/std/c_private.h +++ b/src/std/c_private.h @@ -47,5 +47,10 @@ #define strerror_r(errnum, buf, buflen) snprintf(buf, buflen, "%s", strerror(errnum)) #endif +#ifndef HAVE_LSTAT +#define lstat _stat +#endif + #endif //_C_PRIVATE_H + /* vim: set ft=c.doxygen ts=8 sw=2 et cindent: */