1
0
mirror of git://git.suckless.org/ubase synced 2024-12-20 22:00:51 +00:00
ubase/swapoff.c
2013-08-14 14:40:49 +01:00

38 lines
532 B
C

/* See LICENSE file for copyright and license details. */
#include <sys/swap.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include "util.h"
static void
usage(void)
{
eprintf("usage: %s device\n", argv0);
}
int
main(int argc, char *argv[])
{
int i;
int ret = 0;
ARGBEGIN {
default:
usage();
} ARGEND;
if (argc < 1)
usage();
for (i = 0; i < argc; i++) {
ret = swapoff(argv[i]);
if (ret < 0) {
fprintf(stderr, "swapoff %s: %s\n",
argv[i], strerror(errno));
ret = 1;
}
}
return ret;
}