From: Sascha Wildner Date: Sat, 10 Apr 2010 08:10:49 +0000 (+0200) Subject: mount_portal(8): Raise WARNS to 6. X-Git-Tag: v2.7.1~37^2~3^2~6 X-Git-Url: http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/92f258c4649f7f3d978fb2bd73dc8087b536784d mount_portal(8): Raise WARNS to 6. --- diff --git a/sbin/mount_portal/Makefile b/sbin/mount_portal/Makefile index 456cccf..32ca9db 100644 --- a/sbin/mount_portal/Makefile +++ b/sbin/mount_portal/Makefile @@ -6,7 +6,6 @@ PROG= mount_portal SRCS= mount_portal.c activate.c conf.c getmntopts.c pt_conf.c \ pt_exec.c pt_file.c pt_tcp.c pt_tcplisten.c MAN= mount_portal.8 -WARNS?= 2 MOUNT= ${.CURDIR}/../mount CFLAGS+= -I${.CURDIR}/../../sys -I${MOUNT} diff --git a/sbin/mount_portal/activate.c b/sbin/mount_portal/activate.c index a00ab10..f2f5c55 100644 --- a/sbin/mount_portal/activate.c +++ b/sbin/mount_portal/activate.c @@ -87,7 +87,7 @@ get_request(int so, struct portal_cred *pcr, char *key, int klen) if (n < 0) return (errno); - if (n <= sizeof(*pcr)) + if ((size_t)n <= sizeof(*pcr)) return (EINVAL); n -= sizeof(*pcr); diff --git a/sbin/mount_portal/mount_portal.c b/sbin/mount_portal/mount_portal.c index 680ee2b..5cc39fb 100644 --- a/sbin/mount_portal/mount_portal.c +++ b/sbin/mount_portal/mount_portal.c @@ -61,7 +61,7 @@ struct mntopt mopts[] = { MOPT_STDOPTS, - { NULL } + { NULL, 0, 0, 0 } }; static void usage(void) __dead2; @@ -69,13 +69,13 @@ static void usage(void) __dead2; static sig_atomic_t readcf; /* Set when SIGHUP received */ static void -sighup(int sig) +sighup(int sig __unused) { readcf ++; } static void -sigchld(int sig) +sigchld(int sig __unused) { pid_t pid; @@ -205,7 +205,6 @@ main(int argc, char **argv) int so2; pid_t pid; fd_set fdset; - int rc; /* * Check whether we need to re-read the configuration file diff --git a/sbin/mount_portal/portald.h b/sbin/mount_portal/portald.h index 646d212..fc0bae3 100644 --- a/sbin/mount_portal/portald.h +++ b/sbin/mount_portal/portald.h @@ -59,7 +59,7 @@ struct qelem { typedef struct provider provider; struct provider { - char *pr_match; + const char *pr_match; int (*pr_func)(struct portal_cred *, char *key, char **v, int so, int *fdp); }; diff --git a/sbin/mount_portal/pt_exec.c b/sbin/mount_portal/pt_exec.c index 12b904e..619f9ae 100644 --- a/sbin/mount_portal/pt_exec.c +++ b/sbin/mount_portal/pt_exec.c @@ -47,7 +47,8 @@ #include "portald.h" int -portal_exec(struct portal_cred *pcr, char *key, char **v, int so, int *fdp) +portal_exec(struct portal_cred *pcr __unused, char *key __unused, + char **v __unused, int so __unused, int *fdp __unused) { return (ENOEXEC); } diff --git a/sbin/mount_portal/pt_file.c b/sbin/mount_portal/pt_file.c index 2e2aaf3..26d0b58 100644 --- a/sbin/mount_portal/pt_file.c +++ b/sbin/mount_portal/pt_file.c @@ -51,7 +51,8 @@ #include "portald.h" int -portal_file(struct portal_cred *pcr, char *key, char **v, int so, int *fdp) +portal_file(struct portal_cred *pcr, char *key, char **v, int so __unused, + int *fdp) { int fd; char pbuf[MAXPATHLEN]; diff --git a/sbin/mount_portal/pt_tcp.c b/sbin/mount_portal/pt_tcp.c index 3350beb..4357d20 100644 --- a/sbin/mount_portal/pt_tcp.c +++ b/sbin/mount_portal/pt_tcp.c @@ -62,7 +62,8 @@ * An unrecognized suffix is an error. */ int -portal_tcp(struct portal_cred *pcr, char *key, char **v, int kso, int *fdp) +portal_tcp(struct portal_cred *pcr, char *key, char **v, int kso __unused, + int *fdp) { char host[MAXHOSTNAMELEN]; char port[MAXHOSTNAMELEN]; @@ -78,7 +79,7 @@ portal_tcp(struct portal_cred *pcr, char *key, char **v, int kso, int *fdp) struct sockaddr_in sain; q = strchr(p, '/'); - if (q == 0 || q - p >= sizeof(host)) + if (q == 0 || (size_t)(q - p) >= sizeof(host)) return (EINVAL); *q = '\0'; strcpy(host, p); diff --git a/sbin/mount_portal/pt_tcplisten.c b/sbin/mount_portal/pt_tcplisten.c index 311abeb..f0c0ac8 100644 --- a/sbin/mount_portal/pt_tcplisten.c +++ b/sbin/mount_portal/pt_tcplisten.c @@ -70,8 +70,8 @@ * */ int -portal_tcplisten(struct portal_cred *pcr, char *key, char **v, int kso, - int *fdp) +portal_tcplisten(struct portal_cred *pcr, char *key, char **v, + int kso __unused, int *fdp) { char host[MAXHOSTNAMELEN]; char port[MAXHOSTNAMELEN]; @@ -87,7 +87,7 @@ portal_tcplisten(struct portal_cred *pcr, char *key, char **v, int kso, struct sockaddr_in sain; q = strchr(p, '/'); - if (q == 0 || q - p >= sizeof(host)) + if (q == 0 || (size_t)(q - p) >= sizeof(host)) return (EINVAL); *q = '\0'; snprintf(host, sizeof(host), "%s", p);