diff options
author | Lennart Poettering <lennart@poettering.net> | 2004-12-19 00:24:29 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2004-12-19 00:24:29 +0000 |
commit | 7835658313a752cdee17f2da2f1468063f6bb7c5 (patch) | |
tree | 106036347b4b8cbdfa7e1dd6d003b2b7eae23c80 /src | |
parent | 800f4322d7f2067b77cb00f2635ecf3125dc7e4c (diff) |
gcc 2.95 compat
git-svn-id: file:///home/lennart/svn/public/ifplugd/trunk@116 2bf48fe7-cfc1-0310-909f-d9042e1e0fef
Diffstat (limited to 'src')
-rw-r--r-- | src/ifmonitor.c | 6 | ||||
-rw-r--r-- | src/ifplugd.c | 5 | ||||
-rw-r--r-- | src/nlapi.c | 2 |
3 files changed, 8 insertions, 5 deletions
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; } |