summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2004-12-19 00:24:29 +0000
committerLennart Poettering <lennart@poettering.net>2004-12-19 00:24:29 +0000
commit7835658313a752cdee17f2da2f1468063f6bb7c5 (patch)
tree106036347b4b8cbdfa7e1dd6d003b2b7eae23c80
parent800f4322d7f2067b77cb00f2635ecf3125dc7e4c (diff)
gcc 2.95 compat
git-svn-id: file:///home/lennart/svn/public/ifplugd/trunk@116 2bf48fe7-cfc1-0310-909f-d9042e1e0fef
-rw-r--r--Makefile.am2
-rw-r--r--src/ifmonitor.c6
-rw-r--r--src/ifplugd.c5
-rw-r--r--src/nlapi.c2
4 files changed, 9 insertions, 6 deletions
diff --git a/Makefile.am b/Makefile.am
index eeabc3a..e000ed7 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -30,7 +30,7 @@ README:
homepage: all dist
test -d $$HOME/homepage/private
mkdir -p $$HOME/homepage/private/projects/ifplugd
- cp *.tar.gz $$HOME/homepage/private/projects/ifplugd
+ cp ifplugd-@PACKAGE_VERSION@.tar.gz $$HOME/homepage/private/projects/ifplugd
cp man/ifplugd.8.xml man/ifplugstatus.8.xml man/ifplugd.conf.5.xml man/xmltoman.css man/xmltoman.xsl man/xmltoman.dtd doc/README.html doc/style.css doc/NEWS $$HOME/homepage/private/projects/ifplugd
cp $$HOME/homepage/private/projects/ifplugd/README.html $$HOME/homepage/private/projects/ifplugd/index.html
diff --git a/src/ifmonitor.c b/src/ifmonitor.c
index 2edec4a..516bf4b 100644
--- a/src/ifmonitor.c
+++ b/src/ifmonitor.c
@@ -37,7 +37,7 @@
#include "nlapi.h"
static int callback(struct nlmsghdr *n, void *u) {
- int (*cb)(int b, int index, unsigned short type, const char *name) = u;
+ int (*cb)(int b, int index, unsigned short type, const char *name) = (int (*)(int b, int index, unsigned short type, const char *name)) u;
if (n->nlmsg_type == RTM_NEWLINK || n->nlmsg_type == RTM_DELLINK) {
struct rtattr *a;
@@ -54,7 +54,7 @@ static int callback(struct nlmsghdr *n, void *u) {
memset(&ifname, 0, sizeof(ifname));
- a = (void*) i + NLMSG_ALIGN(sizeof(struct ifinfomsg));
+ a = (struct rtattr*) ((char*) i + NLMSG_ALIGN(sizeof(struct ifinfomsg)));
la = NLMSG_PAYLOAD(n, sizeof(struct ifinfomsg));
while (RTA_OK(a, la)) {
@@ -78,5 +78,5 @@ static int callback(struct nlmsghdr *n, void *u) {
}
int ifmonitor_init(int (*cb) (int b, int index, unsigned short type, const char *name)) {
- return nlapi_register(callback, cb);
+ return nlapi_register(callback, (void*) cb);
}
diff --git a/src/ifplugd.c b/src/ifplugd.c
index 7d8bba3..3c07a5e 100644
--- a/src/ifplugd.c
+++ b/src/ifplugd.c
@@ -460,7 +460,10 @@ void work(void) {
interface_status_t s;
fd_set qfds = fds;
int d;
- struct timeval tv = { polltime, 0 };
+ struct timeval tv;
+
+ tv.tv_sec = polltime;
+ tv.tv_usec = 0;
if (select(FD_SETSIZE, &qfds, NULL, NULL, &tv) < 0) {
if (errno == EINTR)
diff --git a/src/nlapi.c b/src/nlapi.c
index 91865f5..52025ba 100644
--- a/src/nlapi.c
+++ b/src/nlapi.c
@@ -86,7 +86,7 @@ int nlapi_work(int block) {
for (; bytes > 0; p = NLMSG_NEXT(p, bytes)) {
struct callback_info *c;
- if (!NLMSG_OK(p, bytes) || bytes < sizeof(struct nlmsghdr) || bytes < p->nlmsg_len) {
+ if (!NLMSG_OK(p, bytes) || (size_t) bytes < sizeof(struct nlmsghdr) || (size_t) bytes < p->nlmsg_len) {
daemon_log(LOG_ERR, "NLAPI: Packet too small or truncated!\n");
return -1;
}