aboutsummaryrefslogtreecommitdiffstats
path: root/btrfs-zero-log.c
diff options
context:
space:
mode:
authorSergei Trofimovich <slyfox@gentoo.org>2011-08-28 14:23:24 +0300
committerChris Mason <chris.mason@oracle.com>2011-10-25 09:18:59 -0400
commit3d7c94cfec7347e663106d2ca9db2b60dc9d8213 (patch)
tree7159c5fe581a53402f418c5b4b5e670140a3d340 /btrfs-zero-log.c
parenta8b624eae7c358d67a35e847bd25c29f846046f9 (diff)
downloadbtrfs-progs-3d7c94cfec7347e663106d2ca9db2b60dc9d8213.tar.gz
btrfs-progs-3d7c94cfec7347e663106d2ca9db2b60dc9d8213.tar.xz
btrfs-progs-3d7c94cfec7347e663106d2ca9db2b60dc9d8213.zip
btrfsck: decode error properly
check_mounted() returns kernel-style negative errors. Patch drops sign for strerror(). Before the patch: check_mounted(): Could not open /dev/sdb2 Could not check mount status: Unknown error 18446744073709551603 After the patch: check_mounted(): Could not open /dev/sdb2 Could not check mount status: Permission denied Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Diffstat (limited to 'btrfs-zero-log.c')
-rw-r--r--btrfs-zero-log.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/btrfs-zero-log.c b/btrfs-zero-log.c
index f10438b..54d7858 100644
--- a/btrfs-zero-log.c
+++ b/btrfs-zero-log.c
@@ -50,7 +50,7 @@ int main(int ac, char **av)
radix_tree_init();
if((ret = check_mounted(av[1])) < 0) {
- fprintf(stderr, "Could not check mount status: %s\n", strerror(ret));
+ fprintf(stderr, "Could not check mount status: %s\n", strerror(-ret));
return ret;
} else if(ret) {
fprintf(stderr, "%s is currently mounted. Aborting.\n", av[1]);