From: Neil Brown Date: Mon, 30 Jul 2007 06:33:39 +0000 (+1000) Subject: Fix more 'prototype' warnings and other warnings. X-Git-Tag: nfs-utils-1-1-1~109 X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=38145f5bceef1b3cf5ec44a752774f5bbccfbf4e;p=nfs-utils.git Fix more 'prototype' warnings and other warnings. Signed-off-by: Neil Brown --- diff --git a/utils/idmapd/atomicio.c b/utils/idmapd/atomicio.c index 93171a7..05e7147 100644 --- a/utils/idmapd/atomicio.c +++ b/utils/idmapd/atomicio.c @@ -36,11 +36,11 @@ * ensure all of data on socket comes through. f==read || f==write */ ssize_t -atomicio(f, fd, _s, n) - ssize_t (*f) (); - int fd; - void *_s; - size_t n; +atomicio( + ssize_t (*f) (int, void*, size_t), + int fd, + void *_s, + size_t n) { char *s = _s; ssize_t res, pos = 0; diff --git a/utils/idmapd/idmapd.c b/utils/idmapd/idmapd.c index b30b69e..a82cd0b 100644 --- a/utils/idmapd/idmapd.c +++ b/utils/idmapd/idmapd.c @@ -137,15 +137,16 @@ static void imconv(struct idmap_client *, struct idmap_msg *); static void idtonameres(struct idmap_msg *); static void nametoidres(struct idmap_msg *); -static int nfsdopen(); +static int nfsdopen(void); static int nfsdopenone(struct idmap_client *); static void nfsdreopen(void); size_t strlcat(char *, const char *, size_t); size_t strlcpy(char *, const char *, size_t); -ssize_t atomicio(ssize_t (*)(), int, void *, size_t); +ssize_t atomicio(ssize_t (*f) (int, void*, size_t), + int, void *, size_t); void mydaemon(int, int); -void release_parent(); +void release_parent(void); static int verbose = 0; #define DEFAULT_IDMAP_CACHE_EXPIRY 600 /* seconds */ @@ -677,7 +678,7 @@ nfsdcb(int fd, short which, void *data) bsiz = sizeof(buf) - bsiz; - if (atomicio(write, ic->ic_fd, buf, bsiz) != bsiz) + if (atomicio((void*)write, ic->ic_fd, buf, bsiz) != bsiz) idmapd_warnx("nfsdcb: write(%s) failed: errno %d (%s)", ic->ic_path, errno, strerror(errno)); @@ -743,7 +744,7 @@ nfscb(int fd, short which, void *data) if (im.im_status == IDMAP_STATUS_LOOKUPFAIL) im.im_status = IDMAP_STATUS_SUCCESS; - if (atomicio(write, ic->ic_fd, &im, sizeof(im)) != sizeof(im)) + if (atomicio((void*)write, ic->ic_fd, &im, sizeof(im)) != sizeof(im)) idmapd_warn("nfscb: write(%s)", ic->ic_path); out: event_add(&ic->ic_event, NULL); @@ -781,7 +782,7 @@ nfsdreopen() } static int -nfsdopen() +nfsdopen(void) { return ((nfsdopenone(&nfsd_ic[IC_NAMEID]) == 0 && nfsdopenone(&nfsd_ic[IC_IDNAME]) == 0) ? 0 : -1); @@ -1046,7 +1047,7 @@ mydaemon(int nochdir, int noclose) return; } void -release_parent() +release_parent(void) { int status; diff --git a/utils/idmapd/strlcat.c b/utils/idmapd/strlcat.c index 2c8b20a..daedd7a 100644 --- a/utils/idmapd/strlcat.c +++ b/utils/idmapd/strlcat.c @@ -46,10 +46,9 @@ static char *rcsid = "$OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp * If retval >= siz, truncation occurred. */ size_t -strlcat(dst, src, siz) - char *dst; - const char *src; - size_t siz; +strlcat(char *dst, + const char *src, + size_t siz) { register char *d = dst; register const char *s = src; diff --git a/utils/idmapd/strlcpy.c b/utils/idmapd/strlcpy.c index 528d4f1..a2653ee 100644 --- a/utils/idmapd/strlcpy.c +++ b/utils/idmapd/strlcpy.c @@ -44,10 +44,9 @@ static char *rcsid = "$OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp * Returns strlen(src); if retval >= siz, truncation occurred. */ size_t -strlcpy(dst, src, siz) - char *dst; - const char *src; - size_t siz; +strlcpy(char *dst, + const char *src, + size_t siz) { register char *d = dst; register const char *s = src; diff --git a/utils/mount/error.c b/utils/mount/error.c index 57608a5..bf056af 100644 --- a/utils/mount/error.c +++ b/utils/mount/error.c @@ -86,7 +86,8 @@ void mount_errors(char *server, int will_retry, int bg) "mount to NFS server '%s' failed: ", server); else pos = snprintf(tmp, (erreob - tmp), - "%s: mount to NFS server '%s' failed: ", server); + "%s: mount to NFS server '%s' failed: ", + progname, server); tmp = &errbuf[pos]; if (rpc_createerr.cf_stat == RPC_TIMEDOUT) {