From patchwork Mon Feb 25 22:54:44 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 2182131 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 268473FCA4 for ; Mon, 25 Feb 2013 21:55:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759733Ab3BYVz3 (ORCPT ); Mon, 25 Feb 2013 16:55:29 -0500 Received: from nat-pool-rdu.redhat.com ([66.187.233.202]:37174 "EHLO bp-05.lab.msp.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1759571Ab3BYVzR (ORCPT ); Mon, 25 Feb 2013 16:55:17 -0500 Received: by bp-05.lab.msp.redhat.com (Postfix, from userid 0) id D2F391E0A9B; Mon, 25 Feb 2013 16:54:54 -0600 (CST) From: Eric Sandeen To: linux-btrfs@vger.kernel.org Cc: Eric Sandeen Subject: [PATCH 11/17] btrfs-progs: provide positive errno to strerror in cmd_restore Date: Mon, 25 Feb 2013 16:54:44 -0600 Message-Id: <1361832890-40921-12-git-send-email-sandeen@redhat.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1361832890-40921-1-git-send-email-sandeen@redhat.com> References: <1361832890-40921-1-git-send-email-sandeen@redhat.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org check_mounted returns a negative errno, so it needs to be flipped again before passing to strerror. Signed-off-by: Eric Sandeen --- cmds-restore.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 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]);