summaryrefslogtreecommitdiffstats
path: root/sbin/swapon
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1995-02-23 07:05:01 +0000
committerphk <phk@FreeBSD.org>1995-02-23 07:05:01 +0000
commit3b792acf3c414c8cb0241d2db03bc8a6854d114a (patch)
tree5e904cb700785ef18d093a34ce4a1cd2f492f52b /sbin/swapon
parent9bf4b628ff93fa5db7ac452eb1a86a0fb8015d3a (diff)
downloadFreeBSD-src-3b792acf3c414c8cb0241d2db03bc8a6854d114a.zip
FreeBSD-src-3b792acf3c414c8cb0241d2db03bc8a6854d114a.tar.gz
Fix -Wall warnings.
Yes I have better things to do, but just now I'm waiting...
Diffstat (limited to 'sbin/swapon')
-rw-r--r--sbin/swapon/swapon.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/sbin/swapon/swapon.c b/sbin/swapon/swapon.c
index 577219d..4c3c3e5 100644
--- a/sbin/swapon/swapon.c
+++ b/sbin/swapon/swapon.c
@@ -44,10 +44,14 @@ static char sccsid[] = "@(#)swapon.c 8.1 (Berkeley) 6/5/93";
#include <fstab.h>
#include <errno.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
-main(argc, argv)
- int argc;
- char **argv;
+void usage __P((void));
+int add __P((char *name, int ignoreebusy));
+
+int
+main(int argc, char **argv)
{
extern char *optarg;
extern int optind;
@@ -69,7 +73,7 @@ main(argc, argv)
stat = 0;
if (doall)
- while (fsp = getfsent()) {
+ while ((fsp = getfsent()) != NULL) {
if (strcmp(fsp->fs_type, FSTAB_SW))
continue;
if (add(fsp->fs_spec, 1))
@@ -85,9 +89,8 @@ main(argc, argv)
exit(stat);
}
-add(name, ignoreebusy)
- char *name;
- int ignoreebusy;
+int
+add(char *name, int ignoreebusy)
{
extern int errno;
@@ -113,6 +116,7 @@ add(name, ignoreebusy)
return(0);
}
+void
usage()
{
fprintf(stderr, "usage: swapon [-a] [special_file ...]\n");
OpenPOWER on IntegriCloud