]> git.decadent.org.uk Git - nfs-utils.git/commitdiff
Fix a number of the easier compile warnings: unused variables,
authorGreg Banks <gnb@melbourne.sgi.com>
Thu, 22 Jun 2006 08:01:10 +0000 (18:01 +1000)
committerGreg Banks <gnb@melbourne.sgi.com>
Thu, 22 Jun 2006 08:01:10 +0000 (18:01 +1000)
unused labels, constness, signedness.

support/export/client.c
support/nfs/conn.c
support/nfs/rpcmisc.c
utils/idmapd/idmapd.c
utils/mountd/cache.c
utils/mountd/mountd.c
utils/statd/monitor.c
utils/statd/statd.c
utils/statd/statd.h
utils/statd/state.c

index c09e7620eacb12e782f3e635cb09baa8e48b6c68..33dfdb004efac38fa08269906abbf4b045351d45 100644 (file)
@@ -15,6 +15,7 @@
 #include <arpa/inet.h>
 #include <stdlib.h>
 #include <string.h>
 #include <arpa/inet.h>
 #include <stdlib.h>
 #include <string.h>
+#include <ctype.h>
 #include <netdb.h>
 #include "xmalloc.h"
 #include "misc.h"
 #include <netdb.h>
 #include "xmalloc.h"
 #include "misc.h"
index a020394c86b7dc1541b58b3dcd823eaeefe8d6ff..bf2afad678c71ad3b6e39b740f8745e09d387af8 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <errno.h>
  */
 
 #include <errno.h>
+#include <unistd.h>
 #include <rpc/rpc.h>
 #include <rpc/pmap_prot.h>
 #include <rpc/pmap_clnt.h>
 #include <rpc/rpc.h>
 #include <rpc/pmap_prot.h>
 #include <rpc/pmap_clnt.h>
index c7bff40ea2fc71aaa00176d5e8940f09723599bc..8c94ad93218cf4831a35d9a3d86e29d8b82f46a0 100644 (file)
@@ -228,10 +228,12 @@ rpc_logcall(struct svc_req *rqstp, char *xname, char *arg)
                break;
        case AUTH_UNIX: {
                struct authunix_parms *unix_cred;
                break;
        case AUTH_UNIX: {
                struct authunix_parms *unix_cred;
+               time_t time;
                struct tm *tm;
 
                unix_cred = (struct authunix_parms *) rqstp->rq_clntcred;
                struct tm *tm;
 
                unix_cred = (struct authunix_parms *) rqstp->rq_clntcred;
-               tm = localtime(&unix_cred->aup_time);
+               time = unix_cred->aup_time;
+               tm = localtime(&time);
                snprintf(sp, buflen, "UNIX %d/%d/%d %02d:%02d:%02d %s %d.%d",
                        tm->tm_year, tm->tm_mon + 1, tm->tm_mday,
                        tm->tm_hour, tm->tm_min, tm->tm_sec,
                snprintf(sp, buflen, "UNIX %d/%d/%d %02d:%02d:%02d %s %d.%d",
                        tm->tm_year, tm->tm_mon + 1, tm->tm_mday,
                        tm->tm_hour, tm->tm_min, tm->tm_sec,
index c8ce6b2db54e305d6cf57aeb8541584490b44e7f..16b1316c60096173d8e3bd9618b76f63ec85f1ed 100644 (file)
@@ -541,7 +541,8 @@ nfsdcb(int fd, short which, void *data)
        struct idmap_client *ic = data;
        struct idmap_msg im;
        u_char buf[IDMAP_MAXMSGSZ + 1];
        struct idmap_client *ic = data;
        struct idmap_msg im;
        u_char buf[IDMAP_MAXMSGSZ + 1];
-       size_t len, bsiz;
+       size_t len;
+       ssize_t bsiz;
        char *bp, typebuf[IDMAP_MAXMSGSZ],
                buf1[IDMAP_MAXMSGSZ], authbuf[IDMAP_MAXMSGSZ], *p;
        unsigned long tmp;
        char *bp, typebuf[IDMAP_MAXMSGSZ],
                buf1[IDMAP_MAXMSGSZ], authbuf[IDMAP_MAXMSGSZ], *p;
        unsigned long tmp;
@@ -558,7 +559,7 @@ nfsdcb(int fd, short which, void *data)
 
        /* Get rid of newline and terminate buffer*/
        buf[len - 1] = '\0';
 
        /* Get rid of newline and terminate buffer*/
        buf[len - 1] = '\0';
-       bp = buf;
+       bp = (char *)buf;
 
        memset(&im, 0, sizeof(im));
 
 
        memset(&im, 0, sizeof(im));
 
@@ -608,7 +609,7 @@ nfsdcb(int fd, short which, void *data)
        imconv(ic, &im);
 
        buf[0] = '\0';
        imconv(ic, &im);
 
        buf[0] = '\0';
-       bp = buf;
+       bp = (char *)buf;
        bsiz = sizeof(buf);
 
        /* Authentication name */
        bsiz = sizeof(buf);
 
        /* Authentication name */
index 5285e10d8fbcb85eb199d7fea01c29cc6a19e63d..c57d3b0a326a16adf01c4ee9b083f01df470fab3 100644 (file)
@@ -429,7 +429,7 @@ cache_get_filehandle(nfs_export *exp, int len, char *p)
        if (failed)
                return NULL;
        memset(fh.fh_handle, 0, sizeof(fh.fh_handle));
        if (failed)
                return NULL;
        memset(fh.fh_handle, 0, sizeof(fh.fh_handle));
-       fh.fh_size = qword_get(&bp, fh.fh_handle, NFS3_FHSIZE);
+       fh.fh_size = qword_get(&bp, (char *)fh.fh_handle, NFS3_FHSIZE);
        return &fh;
 }
 
        return &fh;
 }
 
index e402bf822d18849739396d5a091b5f62dee9f19f..c1d18d4cebc9b37b1f227d7de33fe1aaf4ccfaaf 100644 (file)
@@ -35,7 +35,7 @@ extern void my_svc_run(void);
 
 static void            usage(const char *, int exitcode);
 static exports         get_exportlist(void);
 
 static void            usage(const char *, int exitcode);
 static exports         get_exportlist(void);
-static struct nfs_fh_len *get_rootfh(struct svc_req *, dirpath *, int *, int v3);
+static struct nfs_fh_len *get_rootfh(struct svc_req *, dirpath *, mountstat3 *, int v3);
 
 int new_cache = 0;
 
 
 int new_cache = 0;
 
@@ -346,11 +346,11 @@ mount_mnt_3_svc(struct svc_req *rqstp, dirpath *path, mountres3 *res)
        struct nfs_fh_len *fh;
 
        xlog(D_CALL, "MNT3(%s) called", *path);
        struct nfs_fh_len *fh;
 
        xlog(D_CALL, "MNT3(%s) called", *path);
-       if ((fh = get_rootfh(rqstp, path, (int *) &res->fhs_status, 1)) != NULL) {
+       if ((fh = get_rootfh(rqstp, path, &res->fhs_status, 1)) != NULL) {
                struct mountres3_ok     *ok = &res->mountres3_u.mountinfo;
 
                ok->fhandle.fhandle3_len = fh->fh_size;
                struct mountres3_ok     *ok = &res->mountres3_u.mountinfo;
 
                ok->fhandle.fhandle3_len = fh->fh_size;
-               ok->fhandle.fhandle3_val = fh->fh_handle;
+               ok->fhandle.fhandle3_val = (char *)fh->fh_handle;
                ok->auth_flavors.auth_flavors_len
                        = sizeof(flavors)/sizeof(flavors[0]);
                ok->auth_flavors.auth_flavors_val = flavors;
                ok->auth_flavors.auth_flavors_len
                        = sizeof(flavors)/sizeof(flavors[0]);
                ok->auth_flavors.auth_flavors_val = flavors;
@@ -359,7 +359,7 @@ mount_mnt_3_svc(struct svc_req *rqstp, dirpath *path, mountres3 *res)
 }
 
 static struct nfs_fh_len *
 }
 
 static struct nfs_fh_len *
-get_rootfh(struct svc_req *rqstp, dirpath *path, int *error, int v3)
+get_rootfh(struct svc_req *rqstp, dirpath *path, mountstat3 *error, int v3)
 {
        struct sockaddr_in *sin =
                (struct sockaddr_in *) svc_getcaller(rqstp->rq_xprt);
 {
        struct sockaddr_in *sin =
                (struct sockaddr_in *) svc_getcaller(rqstp->rq_xprt);
index 834847341eb11044a87cd8c99a0b77cffa2169b0..98cbf4a5940ba660bda50aa944f01769b0ee9ea4 100644 (file)
@@ -268,7 +268,9 @@ sm_unmon_1_svc(struct mon_id *argp, struct svc_req *rqstp)
                        clnt = NL_NEXT(clnt);
        }
 
                        clnt = NL_NEXT(clnt);
        }
 
+#ifdef RESTRICTED_STATD
  failure:
  failure:
+#endif
        note(N_WARNING, "Received erroneous SM_UNMON request from %s for %s",
                my_name, mon_name);
        return (&result);
        note(N_WARNING, "Received erroneous SM_UNMON request from %s for %s",
                my_name, mon_name);
        return (&result);
@@ -336,6 +338,8 @@ sm_unmon_all_1_svc(struct my_id *argp, struct svc_req *rqstp)
                dprintf(N_DEBUG, "SM_UNMON_ALL request from %s with no "
                        "SM_MON requests from it.", my_name);
        }
                dprintf(N_DEBUG, "SM_UNMON_ALL request from %s with no "
                        "SM_MON requests from it.", my_name);
        }
+#ifdef RESTRICTED_STATD
  failure:
  failure:
+#endif
        return (&result);
 }
        return (&result);
 }
index 8ebb8083b5832545dc4ea2fee9e71a715fbd2d16..c92e12f29c3a72d1c4bb84a9f51b3c8f5e344e61 100644 (file)
@@ -51,7 +51,7 @@ int   run_mode = 0;           /* foreground logging mode */
  * two copies of each - one in main(), one static in log.c... 
  * It also eliminates the 256-char static in log.c */
 char *name_p = NULL;
  * two copies of each - one in main(), one static in log.c... 
  * It also eliminates the 256-char static in log.c */
 char *name_p = NULL;
-char *version_p = NULL;
+const char *version_p = NULL;
 
 /* PRC: a high-availability callout program can be specified with -H
  * When this is done, the program will receive callouts whenever clients
 
 /* PRC: a high-availability callout program can be specified with -H
  * When this is done, the program will receive callouts whenever clients
@@ -374,7 +374,7 @@ int main (int argc, char **argv)
 #endif
        
        if (!(run_mode & MODE_NODAEMON)) {
 #endif
        
        if (!(run_mode & MODE_NODAEMON)) {
-               int filedes, fdmax, tempfd;
+               int tempfd;
 
                if (pipe(pipefds)<0) {
                        perror("statd: unable to create pipe");
 
                if (pipe(pipefds)<0) {
                        perror("statd: unable to create pipe");
index 225cc8b433b9baf3e4a2b52b3548869a57d46421..ace2ce507043e113ec8c771098ded3c1f107252a 100644 (file)
@@ -88,6 +88,6 @@ extern int run_mode;
  * as to why they're global.
  */
 extern char *name_p;           /* program basename */
  * as to why they're global.
  */
 extern char *name_p;           /* program basename */
-extern char *version_p;                /* program version */
+extern const char *version_p;  /* program version */
 
 extern int             re_notify; /* time to re-read notify list */
 
 extern int             re_notify; /* time to re-read notify list */
index a6a4077718f21d66163ab21a85386f9138591e94..f46dae5d7e343ef1ac94b07bec72a7f056219fa8 100644 (file)
@@ -28,7 +28,6 @@ void
 change_state (void)
 {
   int fd, size;
 change_state (void)
 {
   int fd, size;
-  extern short int restart;
   
   if ((fd = open (SM_STAT_PATH, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR)) == -1)
     die ("open (%s): %s", SM_STAT_PATH, strerror (errno));
   
   if ((fd = open (SM_STAT_PATH, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR)) == -1)
     die ("open (%s): %s", SM_STAT_PATH, strerror (errno));