lkml.org 
[lkml]   [2009]   [Dec]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/6] perf trace/scripting: check return val of perl_run()
Date
The return value from perl_run() is currently ignored, but it should
be checked and used to exit perf if there are problems loading the
script.

Signed-off-by: Tom Zanussi <tzanussi@gmail.com>
---
tools/perf/util/trace-event-perl.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/tools/perf/util/trace-event-perl.c b/tools/perf/util/trace-event-perl.c
index 6f10e76..6d6d76b 100644
--- a/tools/perf/util/trace-event-perl.c
+++ b/tools/perf/util/trace-event-perl.c
@@ -379,7 +379,11 @@ static int perl_start_script(const char *script, int argc, const char **argv)
goto error;
}

- perl_run(my_perl);
+ if (perl_run(my_perl)) {
+ err = -1;
+ goto error;
+ }
+
if (SvTRUE(ERRSV)) {
err = -1;
goto error;
--
1.6.4.GIT


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