From patchwork Mon Feb 25 22:54:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Sandeen X-Patchwork-Id: 2182171 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 3DAAFDFE86 for ; Mon, 25 Feb 2013 21:55:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759801Ab3BYVzr (ORCPT ); Mon, 25 Feb 2013 16:55:47 -0500 Received: from nat-pool-rdu.redhat.com ([66.187.233.202]:23440 "EHLO bp-05.lab.msp.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1759460Ab3BYVzR (ORCPT ); Mon, 25 Feb 2013 16:55:17 -0500 Received: by bp-05.lab.msp.redhat.com (Postfix, from userid 0) id C69431E0A9A; Mon, 25 Feb 2013 16:54:54 -0600 (CST) From: Eric Sandeen To: linux-btrfs@vger.kernel.org Cc: Eric Sandeen Subject: [PATCH 10/17] btrfs-progs: don't call close on error fd Date: Mon, 25 Feb 2013 16:54:43 -0600 Message-Id: <1361832890-40921-11-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 In the error case where fd < 0, close(fd) is the wrong thing to do. Signed-off-by: Eric Sandeen --- btrfs-show-super.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/btrfs-show-super.c b/btrfs-show-super.c index 3614c52..f587f10 100644 --- a/btrfs-show-super.c +++ b/btrfs-show-super.c @@ -97,7 +97,6 @@ int main(int argc, char **argv) fd = open(filename, O_RDONLY, 0666); if (fd < 0) { fprintf(stderr, "Could not open %s\n", filename); - close(fd); exit(1); }