diff mbox

[11/17] btrfs-progs: provide positive errno to strerror in cmd_restore

Message ID 1361832890-40921-12-git-send-email-sandeen@redhat.com (mailing list archive)
State Under Review, archived
Headers show

Commit Message

Eric Sandeen Feb. 25, 2013, 10:54 p.m. UTC
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 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff mbox

Patch

diff --git a/cmds-restore.c b/cmds-restore.c
index 12b2188..9385042 100644
--- a/cmds-restore.c
+++ b/cmds-restore.c
@@ -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]);