changeset 483:26db0cd433f3

Minor tweaks.
author Rob Landley <rob@landley.net>
date Sun, 19 Feb 2012 17:37:49 -0600
parents b4a9fd8773d6
children 4099d3026e56
files toys/swapon.c
diffstat 1 files changed, 5 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/toys/swapon.c	Sat Feb 18 15:33:27 2012 +0100
+++ b/toys/swapon.c	Sun Feb 19 17:37:49 2012 -0600
@@ -12,9 +12,9 @@
 	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 @@
 	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);
 }