From 31c2f82842118993bc32e27e9a19ba7b11792f0a Mon Sep 17 00:00:00 2001 From: Pavel Labath Date: Thu, 5 Jul 2012 16:41:58 +0200 Subject: [PATCH] Fall back to statfs if statfs64 not present mostly needed for the dragonfly port (sf.net #3289079) --- cmake/Conky.cmake | 3 +++ cmake/ConkyPlatformChecks.cmake | 1 + src/fs.cc | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/Conky.cmake b/cmake/Conky.cmake index d004ace3..a19295fa 100644 --- a/cmake/Conky.cmake +++ b/cmake/Conky.cmake @@ -64,6 +64,9 @@ find_package(Threads) set(conky_libs ${CMAKE_THREAD_LIBS_INIT}) set(conky_includes ${CMAKE_BINARY_DIR}) +add_definitions(-D_LARGEFILE64_SOURCE) # Standard definitions +set(CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS} -D_LARGEFILE64_SOURCE") + # Do version stuff set(VERSION_MAJOR "2") set(VERSION_MINOR "0") diff --git a/cmake/ConkyPlatformChecks.cmake b/cmake/ConkyPlatformChecks.cmake index 54b00f93..96eea54a 100644 --- a/cmake/ConkyPlatformChecks.cmake +++ b/cmake/ConkyPlatformChecks.cmake @@ -36,6 +36,7 @@ check_function_exists(strndup HAVE_STRNDUP) check_symbol_exists(pipe2 "unistd.h" HAVE_PIPE2) check_symbol_exists(O_CLOEXEC "fcntl.h" HAVE_O_CLOEXEC) +check_symbol_exists(statfs64 "sys/statfs.h" HAVE_STATFS64t) AC_SEARCH_LIBS(clock_gettime "time.h" CLOCK_GETTIME_LIB "rt") if(NOT CLOCK_GETTIME_LIB) diff --git a/src/fs.cc b/src/fs.cc index 8c47743e..18ccab9f 100644 --- a/src/fs.cc +++ b/src/fs.cc @@ -39,9 +39,11 @@ #include #include -/* linux */ #ifdef HAVE_SYS_STATFS_H #include +#ifndef HAVE_STATFS64 +#define statfs64 statfs +#endif #endif /* freebsd && netbsd */