lkml.org 
[lkml]   [2009]   [Dec]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH 3/3] perf trace: fix forgetting close file/dir
Fix forgetting close file/dir

Signed-off-by: Xiao Guangrong <xiaoguangrong@cn.fujitsu.com>
---
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 5dd5c81..2c84fb6 100644
--- a/tools/perf/util/trace-event-info.c
+++ b/tools/perf/util/trace-event-info.c
@@ -252,6 +252,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);
@@ -270,6 +272,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)
@@ -334,6 +337,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)
@@ -411,6 +415,7 @@ static void read_event_files(struct tracepoint_path *tps)
free(sys);
}

+ closedir(dir);
put_tracing_file(path);
}

--
1.6.1.2



\
 
 \ /
  Last update: 2009-12-28 09:53    [W:0.047 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site