Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752249AbZL1KMb (ORCPT ); Mon, 28 Dec 2009 05:12:31 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752174AbZL1KMa (ORCPT ); Mon, 28 Dec 2009 05:12:30 -0500 Received: from hera.kernel.org ([140.211.167.34]:48150 "EHLO hera.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751704AbZL1KM3 (ORCPT ); Mon, 28 Dec 2009 05:12:29 -0500 Date: Mon, 28 Dec 2009 10:09:52 GMT From: tip-bot for Xiao Guangrong Cc: linux-kernel@vger.kernel.org, paulus@samba.org, hpa@zytor.com, mingo@redhat.com, jkacur@redhat.com, williams@redhat.com, peterz@infradead.org, xiaoguangrong@cn.fujitsu.com, fweisbec@gmail.com, tglx@linutronix.de, mingo@elte.hu Reply-To: mingo@redhat.com, hpa@zytor.com, paulus@samba.org, linux-kernel@vger.kernel.org, jkacur@redhat.com, williams@redhat.com, peterz@infradead.org, xiaoguangrong@cn.fujitsu.com, fweisbec@gmail.com, tglx@linutronix.de, mingo@elte.hu In-Reply-To: <4B387122.7090801@cn.fujitsu.com> References: <4B387122.7090801@cn.fujitsu.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf trace: Fix forgotten close of file/dir Message-ID: Git-Commit-ID: 9967411e5b324a908e344d6ce66b77bd5d372c3e X-Mailer: tip-git-log-daemon MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2117 Lines: 63 Commit-ID: 9967411e5b324a908e344d6ce66b77bd5d372c3e Gitweb: http://git.kernel.org/tip/9967411e5b324a908e344d6ce66b77bd5d372c3e Author: Xiao Guangrong AuthorDate: Mon, 28 Dec 2009 16:49:38 +0800 Committer: Ingo Molnar CommitDate: Mon, 28 Dec 2009 10:36:36 +0100 perf trace: Fix forgotten close of file/dir Signed-off-by: Xiao Guangrong Cc: Peter Zijlstra Cc: Paul Mackerras Cc: Frederic Weisbecker Cc: Clark Williams Cc: John Kacur LKML-Reference: <4B387122.7090801@cn.fujitsu.com> Signed-off-by: Ingo Molnar --- tools/perf/util/trace-event-info.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/tools/perf/util/trace-event-info.c b/tools/perf/util/trace-event-info.c index 535176d..407fd65 100644 --- a/tools/perf/util/trace-event-info.c +++ b/tools/perf/util/trace-event-info.c @@ -253,6 +253,8 @@ static void read_header_files(void) write_or_die("header_page", 12); write_or_die(&size, 8); check_size = copy_file_fd(fd); + close(fd); + if (size != check_size) die("wrong size for '%s' size=%lld read=%lld", path, size, check_size); @@ -271,6 +273,7 @@ static void read_header_files(void) if (size != check_size) die("wrong size for '%s'", path); put_tracing_file(path); + close(fd); } static bool name_in_tp_list(char *sys, struct tracepoint_path *tps) @@ -337,6 +340,7 @@ static void copy_event_system(const char *sys, struct tracepoint_path *tps) free(format); } + closedir(dir); } static void read_ftrace_files(struct tracepoint_path *tps) @@ -407,6 +411,7 @@ static void read_event_files(struct tracepoint_path *tps) free(sys); } + closedir(dir); put_tracing_file(path); } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/