Fixed compilation without gtop2 lib.
authorJean-Philippe Orsini <jeanfi@gmail.com>
Sun, 26 May 2013 18:49:06 +0000 (18:49 +0000)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Sun, 26 May 2013 18:49:06 +0000 (18:49 +0000)
NEWS
src/server/server.c
src/server/server.h

diff --git a/NEWS b/NEWS
index 6d0a075..fe399e9 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@
 
 ** Switched to GtkColorChooserDialog instead of the
    deprecated widget GtkColorSelectionDialog.
+** psensor-server: fixed compilation without gtop2 lib.
 
 * v0.8.0.2
 
index 08a84a1..5431725 100644 (file)
@@ -325,7 +325,9 @@ int main(int argc, char *argv[])
 #endif
 
        server_data.www_dir = NULL;
+#ifdef HAVE_GTOP
        server_data.psysinfo.interfaces = NULL;
+#endif
        log_file = NULL;
        slog_file = NULL;
        slog_interval = 300;
index bc4f574..8ce56c2 100644 (file)
 #ifndef _PSENSOR_SERVER_H_
 #define _PSENSOR_SERVER_H_
 
+#include "config.h"
+
 #include "psensor.h"
+
+#ifdef HAVE_GTOP
 #include "sysinfo.h"
+#endif
 
 #define URL_BASE_API_1_1 "/api/1.1"
 #define URL_BASE_API_1_1_SENSORS "/api/1.1/sensors"
@@ -31,7 +36,9 @@
 struct server_data {
        struct psensor *cpu_usage;
        struct psensor **sensors;
+#ifdef HAVE_GTOP
        struct psysinfo psysinfo;
+#endif
        char *www_dir;
 };