summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
authorNeil Brown <neilb@suse.de>2007-07-29 17:20:10 +1000
committerNeil Brown <neilb@suse.de>2007-07-29 17:20:10 +1000
commit5835b1eec5a1f1e463c0762c510c6643fa2bff62 (patch)
tree7a8b95c1b9b1273be2272a2dd9302265f9839e4d /utils
parentdd087896285da9e160e13ee9f7d75381b67895e3 (diff)
downloadnfs-utils-5835b1eec5a1f1e463c0762c510c6643fa2bff62.tar.gz
nfs-utils-5835b1eec5a1f1e463c0762c510c6643fa2bff62.tar.xz
nfs-utils-5835b1eec5a1f1e463c0762c510c6643fa2bff62.zip
Add -Wstrict-prototypes to compiler args, and fix warnings caused.
Diffstat (limited to 'utils')
-rw-r--r--utils/mount/mount.c2
-rw-r--r--utils/mount/nfsmount.c2
-rw-r--r--utils/mount/nfsumount.c2
-rw-r--r--utils/mount/nfsumount.h2
-rw-r--r--utils/showmount/showmount.c14
-rw-r--r--utils/statd/log.c2
-rw-r--r--utils/statd/log.h2
-rw-r--r--utils/statd/monitor.c2
-rw-r--r--utils/statd/sm-notify.c4
-rw-r--r--utils/statd/statd.c4
-rw-r--r--utils/statd/statd.h1
11 files changed, 16 insertions, 21 deletions
diff --git a/utils/mount/mount.c b/utils/mount/mount.c
index 7a4912e..92ed2bc 100644
--- a/utils/mount/mount.c
+++ b/utils/mount/mount.c
@@ -267,7 +267,7 @@ fail_unlock:
return result;
}
-void mount_usage()
+void mount_usage(void)
{
printf("usage: %s remotetarget dir [-rvVwfnh] [-o nfsoptions]\n",
progname);
diff --git a/utils/mount/nfsmount.c b/utils/mount/nfsmount.c
index 6949b50..b2b1992 100644
--- a/utils/mount/nfsmount.c
+++ b/utils/mount/nfsmount.c
@@ -93,7 +93,7 @@ extern char *progname;
extern int verbose;
extern int sloppy;
-extern int linux_version_code();
+extern int linux_version_code(void);
static inline enum clnt_stat
nfs3_mount(CLIENT *clnt, mnt3arg_t *mnt3arg, mnt3res_t *mnt3res)
diff --git a/utils/mount/nfsumount.c b/utils/mount/nfsumount.c
index 303b485..aa68dee 100644
--- a/utils/mount/nfsumount.c
+++ b/utils/mount/nfsumount.c
@@ -236,7 +236,7 @@ static struct option umount_longopts[] =
{ NULL, 0, 0, 0 }
};
-void umount_usage()
+void umount_usage(void)
{
printf("usage: %s dir [-fvnrlh]\n", progname);
printf("options:\n\t-f\t\tforce unmount\n");
diff --git a/utils/mount/nfsumount.h b/utils/mount/nfsumount.h
index e37eaff..7548912 100644
--- a/utils/mount/nfsumount.h
+++ b/utils/mount/nfsumount.h
@@ -6,6 +6,6 @@
int nfsumount(int, char **);
int nfs_call_umount(clnt_addr_t *, dirpath *);
-void umount_usage();
+void umount_usage(void);
#endif
diff --git a/utils/showmount/showmount.c b/utils/showmount/showmount.c
index f3ac671..4e10a29 100644
--- a/utils/showmount/showmount.c
+++ b/utils/showmount/showmount.c
@@ -62,16 +62,14 @@ static struct option longopts[] =
#define MAXHOSTLEN 256
-int dump_cmp(p, q)
-char **p;
-char **q;
+static int dump_cmp(const void *pv, const void *qv)
{
+ const char **p = (const char **)pv;
+ const char **q = (const char **)qv;
return strcmp(*p, *q);
}
-static void usage(fp, n)
-FILE *fp;
-int n;
+static void usage(FILE *fp, int n)
{
fprintf(fp, "Usage: %s [-adehv]\n", program_name);
fprintf(fp, " [--all] [--directories] [--exports]\n");
@@ -249,9 +247,7 @@ static unsigned short getport(struct sockaddr_in *addr,
return htons(port);
}
-int main(argc, argv)
-int argc;
-char **argv;
+int main(int argc, char **argv)
{
char hostname_buf[MAXHOSTLEN];
char *hostname;
diff --git a/utils/statd/log.c b/utils/statd/log.c
index bf2a926..a6ca996 100644
--- a/utils/statd/log.c
+++ b/utils/statd/log.c
@@ -33,7 +33,7 @@ static pid_t mypid;
static int opt_debug = 0; /* Will be command-line option, eventually */
#endif
-void log_init()
+void log_init(void)
{
if (!(run_mode & MODE_LOG_STDERR))
openlog(name_p, LOG_PID | LOG_NDELAY, LOG_DAEMON);
diff --git a/utils/statd/log.h b/utils/statd/log.h
index 49f801a..fc55d3c 100644
--- a/utils/statd/log.h
+++ b/utils/statd/log.h
@@ -16,7 +16,7 @@
#include <syslog.h>
-void log_init();
+void log_init(void);
void log_background(void);
void log_enable(int facility);
int log_enabled(int facility);
diff --git a/utils/statd/monitor.c b/utils/statd/monitor.c
index e40ff7d..eadc434 100644
--- a/utils/statd/monitor.c
+++ b/utils/statd/monitor.c
@@ -280,7 +280,7 @@ void load_state(void)
b = strchr(buf, '\n');
if (b) *b = 0;
sscanf(buf, "%x %x %x %x ",
- &addr, &prog, &vers, &proc, myname);
+ &addr, &prog, &vers, &proc);
b = buf+36;
for (i=0; i<SM_PRIV_SIZE; i++) {
sscanf(b, "%2x", &p);
diff --git a/utils/statd/sm-notify.c b/utils/statd/sm-notify.c
index 98c03f9..bb67c37 100644
--- a/utils/statd/sm-notify.c
+++ b/utils/statd/sm-notify.c
@@ -86,7 +86,7 @@ static int addr_get_port(nsm_address *);
static void addr_set_port(nsm_address *, int);
static struct addrinfo *host_lookup(int, const char *);
void nsm_log(int fac, const char *fmt, ...);
-static int record_pid();
+static int record_pid(void);
static void drop_privs(void);
static void set_kernel_nsm_state(int state);
@@ -730,7 +730,7 @@ nsm_log(int fac, const char *fmt, ...)
* program exits.
* If file already exists, fail.
*/
-static int record_pid()
+static int record_pid(void)
{
char pid[20];
int fd;
diff --git a/utils/statd/statd.c b/utils/statd/statd.c
index 8337b64..ea985e6 100644
--- a/utils/statd/statd.c
+++ b/utils/statd/statd.c
@@ -148,7 +148,7 @@ static void log_modes(void)
* help the occasional admin.
*/
static void
-usage()
+usage(void)
{
fprintf(stderr,"usage: %s [options]\n", name_p);
fprintf(stderr," -h, -?, --help Print this help screen.\n");
@@ -445,7 +445,7 @@ int main (int argc, char **argv)
/* Child. */
- log_init (name_p,version_p);
+ log_init (/*name_p,version_p*/);
log_modes();
diff --git a/utils/statd/statd.h b/utils/statd/statd.h
index b7ea40b..5d06d88 100644
--- a/utils/statd/statd.h
+++ b/utils/statd/statd.h
@@ -45,7 +45,6 @@ extern char * SM_STAT_PATH;
* Function prototypes.
*/
extern void change_state(void);
-extern void do_regist(u_long, void (*)());
extern void my_svc_run(void);
extern void notify_hosts(void);
extern void shuffle_dirs(void);