updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / netkit-rwho / netkit-rwho-0.17.patch
blob347df5615f7f308b875cb9e4c3c3cb509546d82d
1 --- netkit-rwho-0.17/rwhod/rwhod.c 2000-07-23 05:19:48.000000000 +0200
2 +++ netkit-rwho-0.17/rwhod/rwhod.c.ok 2006-09-24 15:35:26.000000000 +0200
3 @@ -69,6 +69,7 @@
4 #include <arpa/inet.h>
5 #include <pwd.h>
6 #include <grp.h>
7 +#include <time.h>
9 #include "daemon.h"
11 @@ -95,7 +96,7 @@
12 static void broadcaster(void);
13 static int configure(int s);
14 static int verify(const char *name);
15 -static int getloadavg(double ptr[3], int n);
16 +int getloadavg(double ptr[3], int n);
19 * We communicate with each neighbor in
20 @@ -273,7 +274,7 @@
21 wd.wd_hostname[sizeof(wd.wd_hostname)-1] = 0;
22 if (!verify(wd.wd_hostname)) {
23 syslog(LOG_WARNING, "malformed host name from %x",
24 - from.sin_addr);
25 + from.sin_addr.s_addr);
26 continue;
28 snprintf(path, sizeof(path), "whod.%s", wd.wd_hostname);
29 @@ -359,9 +360,9 @@
30 *cp = '\0';
31 mynamelen = strlen(myname);
32 if (mynamelen > sizeof(mywd.wd_hostname))
33 - mynamelen = sizeof(mywd.wd_hostname);
34 + mynamelen = sizeof(mywd.wd_hostname) - 1;
35 strncpy(mywd.wd_hostname, myname, mynamelen);
36 - mywd.wd_hostname[sizeof(mywd.wd_hostname)-1] = 0;
37 + mywd.wd_hostname[mynamelen] = 0;
39 getboottime(&mywd);