From abdb5582bdc8eb22e0f2829feecd3d428312ea55 Mon Sep 17 00:00:00 2001 From: Magliano Andrea Date: Thu, 5 Jul 2012 11:27:45 +0200 Subject: [PATCH] Proper handle missing statfs64 statfs64 ist atm linux specific; wrap statfs around it. Also cleanup param.h and mount.h including: the assumption in fs.cc that their presence is a sign of *BSDs is wrong, as they exist in linux too with different meaning. Besides presence of mount.h isn't detected in Conky.cmake, so conditional including mount.h in fs.cc is useless. Is just works because mount.h and param.h are included in freebsd.h and dragonfly.h later on. They are unneded in linux. Just remove conditional including of mount.h and param.h in fs.cc, conditional wrap statfs64 in proper *BSD header files. --- cmake/config.h.in | 5 +++++ src/dragonfly.cc | 2 ++ src/freebsd.cc | 2 ++ src/fs.cc | 10 ---------- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/cmake/config.h.in b/cmake/config.h.in index 531a4b9c..b9a8b024 100644 --- a/cmake/config.h.in +++ b/cmake/config.h.in @@ -118,4 +118,9 @@ #cmakedefine BUILD_CMUS 1 +#cmakedefine HAVE_STATFS64 1 +#ifndef HAVE_STATFS64 +#define statfs64 statfs +#endif + #endif /* _conky_config_h_ */ diff --git a/src/dragonfly.cc b/src/dragonfly.cc index ab7c3007..f6a3341d 100644 --- a/src/dragonfly.cc +++ b/src/dragonfly.cc @@ -26,6 +26,8 @@ * */ +#include "config.h" + #include #include #include diff --git a/src/freebsd.cc b/src/freebsd.cc index 3b13636f..65be26ff 100644 --- a/src/freebsd.cc +++ b/src/freebsd.cc @@ -27,6 +27,8 @@ * */ +#include "config.h" + #include #include #include diff --git a/src/fs.cc b/src/fs.cc index 18ccab9f..6800ed4c 100644 --- a/src/fs.cc +++ b/src/fs.cc @@ -41,18 +41,8 @@ #ifdef HAVE_SYS_STATFS_H #include -#ifndef HAVE_STATFS64 -#define statfs64 statfs -#endif #endif -/* freebsd && netbsd */ -#ifdef HAVE_SYS_PARAM_H -#include -#endif -#ifdef HAVE_SYS_MOUNT_H -#include -#endif #if defined(__FreeBSD__) #include "freebsd.h" #elif defined(__DragonFly__)