From patchwork Tue Aug 23 10:25:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Sterba X-Patchwork-Id: 9295433 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E5D0360757 for ; Tue, 23 Aug 2016 10:45:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D712228BBC for ; Tue, 23 Aug 2016 10:45:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB3EC28BE1; Tue, 23 Aug 2016 10:45:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8459828BBC for ; Tue, 23 Aug 2016 10:45:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757076AbcHWKpS (ORCPT ); Tue, 23 Aug 2016 06:45:18 -0400 Received: from mx2.suse.de ([195.135.220.15]:59414 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753768AbcHWKnp (ORCPT ); Tue, 23 Aug 2016 06:43:45 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 4F142AD9E for ; Tue, 23 Aug 2016 10:26:26 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 343CFDA89E; Tue, 23 Aug 2016 12:25:21 +0200 (CEST) From: David Sterba To: linux-btrfs@vger.kernel.org Cc: David Sterba Subject: [PATCH 13/13] btrfs-progs: mkfs: clean up make_image Date: Tue, 23 Aug 2016 12:25:17 +0200 Message-Id: <1471947917-5324-14-git-send-email-dsterba@suse.com> X-Mailer: git-send-email 2.7.1 In-Reply-To: <1471947917-5324-1-git-send-email-dsterba@suse.com> References: <1471947917-5324-1-git-send-email-dsterba@suse.com> Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The exact errors are printed, the removed message does not seem to be necessary. Return proper errors. Signed-off-by: David Sterba --- mkfs.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mkfs.c b/mkfs.c index ef0b099a58d7..2aa1d5d31523 100644 --- a/mkfs.c +++ b/mkfs.c @@ -1042,16 +1042,14 @@ static int make_image(char *source_dir, struct btrfs_root *root, int out_fd) { int ret; struct btrfs_trans_handle *trans; - struct stat root_st; - struct directory_name_entry dir_head; - struct directory_name_entry *dir_entry = NULL; ret = lstat(source_dir, &root_st); if (ret) { error("unable to lstat %s: %s", source_dir, strerror(errno)); + ret = -errno; goto out; } @@ -1080,8 +1078,7 @@ static int make_image(char *source_dir, struct btrfs_root *root, int out_fd) free(dir_entry); } out: - fprintf(stderr, "Making image is aborted.\n"); - return -1; + return ret; } /*