diff options
author | charnier <charnier@FreeBSD.org> | 1997-06-19 14:40:41 +0000 |
---|---|---|
committer | charnier <charnier@FreeBSD.org> | 1997-06-19 14:40:41 +0000 |
commit | 359e756ecf9eb74a7fe24632f8e087eeb4174643 (patch) | |
tree | 854c6009552d683f536d57de5fc9416ffd6b8ad9 | |
parent | 0c0624c76d2c7c4ba3a89d470ba05da36f847ca4 (diff) | |
download | FreeBSD-src-359e756ecf9eb74a7fe24632f8e087eeb4174643.zip FreeBSD-src-359e756ecf9eb74a7fe24632f8e087eeb4174643.tar.gz |
Use warn(3).
-rw-r--r-- | sbin/swapon/swapon.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sbin/swapon/swapon.c b/sbin/swapon/swapon.c index d2eebed..eb7e643 100644 --- a/sbin/swapon/swapon.c +++ b/sbin/swapon/swapon.c @@ -29,6 +29,8 @@ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. + * + * $Id$ */ #ifndef lint @@ -46,8 +48,10 @@ static char sccsid[] = "@(#)swapon.c 8.1 (Berkeley) 6/5/93"; #include <stdio.h> #include <stdlib.h> #include <unistd.h> +#include <string.h> +#include <err.h> -void usage __P((void)); +static void usage __P((void)); int add __P((char *name, int ignoreebusy)); int @@ -100,13 +104,10 @@ add(char *name, int ignoreebusy) switch (errno) { case EBUSY: if (!ignoreebusy) - fprintf(stderr, - "swapon: %s: device already in use\n", - name); + warnx("%s: device already in use", name); break; default: - fprintf(stderr, "swapon: %s: ", name); - perror((char *)NULL); + warn("%s", name); break; } return(1); @@ -114,7 +115,7 @@ add(char *name, int ignoreebusy) return(0); } -void +static void usage() { fprintf(stderr, "usage: swapon [-a] [special_file ...]\n"); |