linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] debugfs: add matching fclose
@ 2009-09-28 10:51 Peng Tao
  2009-10-04  2:30 ` Theodore Tso
  0 siblings, 1 reply; 2+ messages in thread
From: Peng Tao @ 2009-09-28 10:51 UTC (permalink / raw)
  To: linux-ext4; +Cc: Theodore Ts'o

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


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] debugfs: add matching fclose
  2009-09-28 10:51 [PATCH] debugfs: add matching fclose Peng Tao
@ 2009-10-04  2:30 ` Theodore Tso
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Tso @ 2009-10-04  2:30 UTC (permalink / raw)
  To: Peng Tao; +Cc: linux-ext4

On Mon, Sep 28, 2009 at 06:51:53PM +0800, Peng Tao wrote:
> 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>

Applied to the maint branch, thanks.

					- Ted

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-10-04  2:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-28 10:51 [PATCH] debugfs: add matching fclose Peng Tao
2009-10-04  2:30 ` Theodore Tso

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).