code style
authorJean-Philippe Orsini <jeanfi@gmail.com>
Thu, 1 Dec 2011 00:43:11 +0000 (00:43 +0000)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Thu, 1 Dec 2011 00:43:11 +0000 (00:43 +0000)
comment about sysinfo not available on kfreebsd
update NEWS

NEWS
configure.ac
src/server/server.c

diff --git a/NEWS b/NEWS
index 1f57c59..61ee159 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -1,5 +1,8 @@
 * v0.6.2.15
 
+** psensor-server: function 'sysinfo' is now optionnal to allow
+   compilation on kfreebsd. It fixes Debian bug #650533.
+
 * v0.6.2.14
 
 ** psensor: support of gtk>=2.18
index 12d201e..51f2670 100644 (file)
@@ -29,6 +29,8 @@ AC_FUNC_MALLOC
 AC_FUNC_REALLOC
 AC_CHECK_FUNCS([gettimeofday memmove socket strdup strtol])
 
+# Detects whether the function sysinfo is available
+# At least kfreebsd 6.0.3 does not provide it.
 SYSINFO_FCT=
 AC_CHECK_FUNC(sysinfo,
              [SYSINFO_FCT='1' AC_DEFINE([HAVE_SYSINFO_FCT],[1],[Use sysinfo])],
index fbafba5..d55ecf2 100644 (file)
@@ -151,13 +151,10 @@ create_response_api(const char *nurl,
        char *page = NULL;
 
        if (!strcmp(nurl, URL_BASE_API_1_0_SENSORS))  {
-
                page = sensors_to_json_string(server_data.sensors);
-
 #ifdef HAVE_GTOP
 #ifdef HAVE_SYSINFO_FCT
        } else if (!strcmp(nurl, URL_API_1_0_SYSINFO)) {
-
                page = sysinfo_to_json_string(&server_data.psysinfo);
 #endif
        } else if (!strcmp(nurl, URL_API_1_0_CPU_USAGE)) {