aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2012-02-19 17:37:49 -0600
committerRob Landley <rob@landley.net>2012-02-19 17:37:49 -0600
commit4c9ac8ee7d85b630618ed0b7b87084d9d014ec00 (patch)
tree36f58cd571e833504873497e7bb7bbd0282ca324 /toys
parent2c162816e81ab49b43df565484f0d965f8984844 (diff)
downloadtoybox-4c9ac8ee7d85b630618ed0b7b87084d9d014ec00.tar.gz
Minor tweaks.
Diffstat (limited to 'toys')
-rw-r--r--toys/swapon.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/toys/swapon.c b/toys/swapon.c
index 36e4507b..16ce8d1f 100644
--- a/toys/swapon.c
+++ b/toys/swapon.c
@@ -12,9 +12,9 @@ config SWAPON
bool "swapon"
default y
help
- usage: swapon swapregion
+ usage: swapon [-p priority] filename
- Enable swapping on a given swapregion.
+ Enable swapping on a given device/file.
*/
#include "toys.h"
@@ -30,9 +30,8 @@ void swapon_main(void)
int flags = 0;
if (toys.optflags & 1)
- flags = SWAP_FLAG_PREFER |
- ((TT.priority & SWAP_FLAG_PRIO_MASK) << SWAP_FLAG_PRIO_SHIFT);
+ flags = SWAP_FLAG_PREFER | (TT.priority << SWAP_FLAG_PRIO_SHIFT);
- if (swapon(toys.optargs[0], flags))
- perror_exit("failed to enable swaparea");
+ if (swapon(*toys.optargs, flags))
+ perror_exit("Couldn't swapon '%s'", *toys.optargs);
}