From: Tom Zanussi Date: Tue, 15 Dec 2009 08:53:37 +0000 (-0600) Subject: perf trace/scripting: Check return val of perl_run() X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=8f11d85a0e7e9025acea7493e6864089c8b52f42;p=deliverable%2Flinux.git perf trace/scripting: Check return val of perl_run() 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 Cc: fweisbec@gmail.com Cc: rostedt@goodmis.org LKML-Reference: <1260867220-15699-4-git-send-email-tzanussi@gmail.com> Signed-off-by: Ingo Molnar --- diff --git a/tools/perf/util/trace-event-perl.c b/tools/perf/util/trace-event-perl.c index 6f10e7602452..6d6d76b8a21e 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;