btrfs-progs: provide positive errno to strerror in cmd_restore
authorEric Sandeen <sandeen@redhat.com>
Mon, 25 Feb 2013 22:54:44 +0000 (16:54 -0600)
committerDavid Sterba <dsterba@suse.cz>
Wed, 27 Feb 2013 13:39:48 +0000 (14:39 +0100)
check_mounted returns a negative errno, so it needs to be flipped
again before passing to strerror.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
cmds-restore.c

index 12b2188..9385042 100644 (file)
@@ -836,7 +836,7 @@ int cmd_restore(int argc, char **argv)
 
        if ((ret = check_mounted(argv[optind])) < 0) {
                fprintf(stderr, "Could not check mount status: %s\n",
-                       strerror(ret));
+                       strerror(-ret));
                return ret;
        } else if (ret) {
                fprintf(stderr, "%s is currently mounted.  Aborting.\n", argv[optind]);