pkgsrc/sysutils/gkrellm/patches/patch-ap
2006-03-19 22:10:38 +00:00

60 lines
1.7 KiB
Text

$NetBSD: patch-ap,v 1.2 2006/03/19 22:10:38 joerg Exp $
--- src/client.c.orig 2005-05-24 04:28:22.000000000 +0000
+++ src/client.c
@@ -24,6 +24,8 @@
#include "gkrellm-private.h"
#include "gkrellm-sysdeps.h"
+#include <inttypes.h>
+
#if !defined(WIN32)
#include <sys/socket.h>
#include <utime.h>
@@ -46,6 +48,10 @@
#endif
#endif
+#if defined(__DragonFly__)
+#define HAVE_GETADDRINFO 1
+#endif
+
#if defined(__FreeBSD__)
#if __FreeBSD_version >= 400000
#define HAVE_GETADDRINFO 1
@@ -145,7 +151,7 @@ client_cpu_line_from_server(gchar *line)
gint n;
guint64 user, nice, sys, idle;
- sscanf(line, "%d %llu %llu %llu %llu", &n, &user, &nice, &sys, &idle);
+ sscanf(line, "%d %" PRIu64 " %" PRIu64 " %" PRIu64 " %" PRIu64, &n, &user, &nice, &sys, &idle);
for (list = cpu_list; list; list = list->next)
{
cpu = (Cpu *) list->data;
@@ -406,7 +412,7 @@ client_net_line_from_server(gchar *line)
gchar name[32];
guint64 rx, tx;
- sscanf(line, "%31s %llu %llu", name, &rx, &tx);
+ sscanf(line, "%31s %" PRIu64 " %" PRIu64, name, &rx, &tx);
for (list = net_list; list; list = list->next)
{
net = (NetData *) list->data;
@@ -680,7 +686,7 @@ struct
static void
client_mem_line_from_server(gchar *line)
{
- sscanf(line, "%llu %llu %llu %llu %llu %llu",
+ sscanf(line, "%" PRIu64 "%" PRIu64 " %" PRIu64 " %" PRIu64 " %" PRIu64 " %" PRIu64,
&mem.total, &mem.used, &mem.free,
&mem.shared, &mem.buffers, &mem.cached);
}
@@ -688,7 +694,7 @@ client_mem_line_from_server(gchar *line)
static void
client_swap_line_from_server(gchar *line)
{
- sscanf(line, "%llu %llu %lu %lu",
+ sscanf(line, "%" PRIu64 " %" PRIu64 " %lu %lu",
&mem.swap_total, &mem.swap_used,
&mem.swap_in, &mem.swap_out);
}