summaryrefslogtreecommitdiff
path: root/sysutils/gkrellm/patches/patch-ap
blob: b0d4362c0703944504bba14c5144cb2588e6c055 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
$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);
 	}