# HG changeset patch # User Rob Landley # Date 1329694669 21600 # Node ID 26db0cd433f3ce142ec956a7f7e5b9a8ececf1db # Parent b4a9fd8773d67083b4d086e07d01b2360b233963 Minor tweaks. diff -r b4a9fd8773d6 -r 26db0cd433f3 toys/swapon.c --- 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); }