merged from plib
[psensor.git] / src / server / server.c
index 08a84a1..55649b8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010-2013 jeanfi@gmail.com
+ * Copyright (C) 2010-2014 jeanfi@gmail.com
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  * 02110-1301 USA
  */
+#define _LARGEFILE_SOURCE 1
+#include "config.h"
+
 #include <locale.h>
 #include <libintl.h>
 #define _(str) gettext(str)
 
-#include "config.h"
-
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -41,7 +42,7 @@
 #include "cpu.h"
 #endif
 
-#include "log.h"
+#include <plog.h>
 #include "psensor_json.h"
 #include "url.h"
 #include "server.h"
@@ -149,7 +150,7 @@ file_reader(void *cls, uint64_t pos, char *buf, int max)
 {
        FILE *file = cls;
 
-       fseek(file, pos, SEEK_SET);
+       fseeko(file, pos, SEEK_SET);
        return fread(buf, 1, max, file);
 }
 
@@ -325,7 +326,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;