pkgsrc/sysutils/gkrellm/patches/patch-ap
jmmv 35b113deb9 Rename auxiliary getline function which collides with the new prototype in
NetBSD current.  Found on NetBSD/macppc 5.99.19.
2009-10-10 12:52:40 +00:00

87 lines
2.4 KiB
Text

$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);