linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Peng Tao <bergwolf@gmail.com>
To: linux-ext4@vger.kernel.org
Cc: Theodore Ts'o <tytso@mit.edu>
Subject: [PATCH] debugfs: add matching fclose
Date: Mon, 28 Sep 2009 18:51:53 +0800	[thread overview]
Message-ID: <1254135113-28212-1-git-send-email-bergwolf@gmail.com> (raw)

If the cmd_file is not stdin, we should close the file handle via fclose().
Thanks David Binderman to point this out.

Addresses-Novell-Bugzilla: #524526

Signed-off-by: Peng Tao <bergwolf@gmail.com>
---
 debugfs/debugfs.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
index 93227e3..7f75788 100644
--- a/debugfs/debugfs.c
+++ b/debugfs/debugfs.c
@@ -2133,6 +2133,8 @@ static int source_file(const char *cmd_file, int sci_idx)
 			exit_status++;
 		}
 	}
+	if (f != stdin)
+		fclose(f);
 	return exit_status;
 }
 
-- 
1.6.5.rc2.262.g5224f


             reply	other threads:[~2009-09-28 10:52 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-28 10:51 Peng Tao [this message]
2009-10-04  2:30 ` [PATCH] debugfs: add matching fclose Theodore Tso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1254135113-28212-1-git-send-email-bergwolf@gmail.com \
    --to=bergwolf@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).