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>
master
Sergei Trofimovich 2011-08-28 14:23:24 +03:00 committed by Chris Mason
parent a8b624eae7
commit 3d7c94cfec
3 changed files with 3 additions and 3 deletions

View File

@ -75,7 +75,7 @@ int main(int ac, char **av)
radix_tree_init();
if((ret = check_mounted(av[optind])) < 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[optind]);

View File

@ -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]);

View File

@ -2838,7 +2838,7 @@ int main(int ac, char **av)
cache_tree_init(&root_cache);
if((ret = check_mounted(av[optind])) < 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[optind]);