summaryrefslogtreecommitdiff
path: root/sysutils/gkrellm/patches/patch-ap
blob: f24e14e09227355aa0e192e037815ad7625e17e1 (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
$NetBSD: patch-ap,v 1.3 2009/10/10 12:52:40 jmmv Exp $

--- src/client.c.orig	2006-09-27 22:29:18.000000000 +0100
+++ 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);
 	}
@@ -1598,7 +1604,7 @@ KeyTable	update_table[] =
 
 
 static gint
-getline(gint fd, gchar *buf, gint len)
+xgetline(gint fd, gchar *buf, gint len)
 	{
 	fd_set			read_fds;
 	struct timeval	tv;
@@ -1690,7 +1696,7 @@ read_server_setup(gint fd)
 
 	while (1)
 		{
-		getline(fd, buf, sizeof(buf));
+		xgetline(fd, buf, sizeof(buf));
 		if (!strcmp(buf, "</gkrellmd_setup>"))
 			break;
 		process_server_line(&setup_table[0], table_size, buf);
@@ -1706,7 +1712,7 @@ read_server_setup(gint fd)
 	table_size = sizeof(update_table) / sizeof(KeyTable);
 	while (1)
 		{
-		getline(fd, buf, sizeof(buf));
+		xgetline(fd, buf, sizeof(buf));
 		if (!strcmp(buf, "</initial_update>"))
 			break;
 		process_server_line(&update_table[0], table_size, buf);