aboutsummaryrefslogtreecommitdiff
path: root/util-linux/swaponoff.c
diff options
context:
space:
mode:
authorErik Andersen <andersen@codepoet.org>2000-02-09 04:16:43 +0000
committerErik Andersen <andersen@codepoet.org>2000-02-09 04:16:43 +0000
commite132f4b09e5c9aedaef97f65279e8702633fd425 (patch)
tree50bfe1c027ff760e426ae31442da73e536dd4baa /util-linux/swaponoff.c
parente49d5ecbbe51718fa925b6890a735e5937cc2aa2 (diff)
downloadbusybox-e132f4b09e5c9aedaef97f65279e8702633fd425.tar.gz
Fixed the init problem where it wouldn't unmount filesystems
on reboot. Also fixed swapoff -a so it works. -Erik
Diffstat (limited to 'util-linux/swaponoff.c')
-rw-r--r--util-linux/swaponoff.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/util-linux/swaponoff.c b/util-linux/swaponoff.c
index 6bda22277..bc096ea95 100644
--- a/util-linux/swaponoff.c
+++ b/util-linux/swaponoff.c
@@ -36,13 +36,16 @@ static int whichApp;
static const char *appName;
static const char swapoff_usage[] =
+ "swapoff [OPTION] [device]\n\n"
+ "Stop swapping virtual memory pages on the given device.\n\n"
+ "Options:\n"
+ "\t-a\tStop swapping on all swap devices\n";
- "swapoff device\n"
- "\nStop swapping virtual memory pages on the given device.\n";
static const char swapon_usage[] =
-
- "swapon device\n"
- "\nStart swapping virtual memory pages on the given device.\n";
+ "swapon [OPTION] [device]\n\n"
+ "Start swapping virtual memory pages on the given device.\n\n"
+ "Options:\n"
+ "\t-a\tStart swapping on all swap devices\n";
#define SWAPON_APP 1
@@ -85,12 +88,6 @@ static void do_em_all()
extern int swap_on_off_main(int argc, char **argv)
{
- struct stat statBuf;
-
- if (stat("/etc/fstab", &statBuf) < 0)
- fprintf(stderr,
- "/etc/fstab file missing -- Please install one.\n\n");
-
if (strcmp(*argv, "swapon") == 0) {
appName = *argv;
whichApp = SWAPON_APP;
@@ -100,8 +97,9 @@ extern int swap_on_off_main(int argc, char **argv)
whichApp = SWAPOFF_APP;
}
- if (argc < 2)
+ if (argc != 2) {
goto usage_and_exit;
+ }
argc--;
argv++;
@@ -110,6 +108,7 @@ extern int swap_on_off_main(int argc, char **argv)
while (*++(*argv))
switch (**argv) {
case 'a':
+ whine_if_fstab_is_missing();
do_em_all();
break;
default: