Displaying 1 result from an estimated 1 matches for "is_swap_device".
2013 Feb 12
10
[PATCH] Btrfs-progs: check out if the swap device
...9 +++++++++++++++++++++++++++++++++++++++++++++++++
utils.h | 1 +
3 files changed, 68 insertions(+)
diff --git a/mkfs.c b/mkfs.c
index 2d3c2af..fdc3373 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -1366,6 +1366,15 @@ int main(int ac, char **av)
if (source_dir == 0) {
file = av[optind++];
+ ret = is_swap_device(file);
+ if (ret < 0) {
+ fprintf(stderr, "error checking %s status\n", file);
+ exit(1);
+ }
+ if (ret == 1) {
+ fprintf(stderr, "%s is a swap device\n", file);
+ exit(1);
+ }
ret = check_mounted(file);
if (ret < 0) {
fprintf(stderr, "error chec...