From f26e1c7cb279051d83e0b671f48b30fe88c2c788 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo Date: Fri, 3 Jan 2014 16:54:12 -0300 Subject: perf evlist: Close fds on destructor Since it is safe to call perf_evlist__close() multiple times, autoclose it and remove the calls to the close from existing tools, reducing the tooling boilerplate. Cc: Adrian Hunter Cc: David Ahern Cc: Frederic Weisbecker Cc: Jiri Olsa Cc: Mike Galbraith Cc: Namhyung Kim Cc: Paul Mackerras Cc: Peter Zijlstra Cc: Stephane Eranian Link: http://lkml.kernel.org/n/tip-2kq9v7p1rude1tqxa0aue2tk@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/tests/open-syscall-tp-fields.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'tools/perf/tests/open-syscall-tp-fields.c') diff --git a/tools/perf/tests/open-syscall-tp-fields.c b/tools/perf/tests/open-syscall-tp-fields.c index 595b577172a6..0a00638a9ebb 100644 --- a/tools/perf/tests/open-syscall-tp-fields.c +++ b/tools/perf/tests/open-syscall-tp-fields.c @@ -54,7 +54,7 @@ int test__syscall_open_tp_fields(void) err = perf_evlist__mmap(evlist, UINT_MAX, false); if (err < 0) { pr_debug("perf_evlist__mmap: %s\n", strerror(errno)); - goto out_close_evlist; + goto out_delete_evlist; } perf_evlist__enable(evlist); @@ -112,8 +112,6 @@ out_ok: err = 0; out_munmap: perf_evlist__munmap(evlist); -out_close_evlist: - perf_evlist__close(evlist); out_delete_evlist: perf_evlist__delete(evlist); out: -- cgit v1.2.3