From: Josef Weidendorfer Date: Tue, 18 Sep 2007 19:12:57 +0000 (+0000) Subject: callgrind_control: Fix behavior with callgrind runs of another user X-Git-Tag: svn/VALGRIND_3_3_0~204 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef6f20cad489481b1fcc610d4503baf96b62a204;p=thirdparty%2Fvalgrind.git callgrind_control: Fix behavior with callgrind runs of another user callgrind_control uses files /tmp/callgrind.info.* to be able to locate running callgrind processes. These files can be read only by the user which started callgrind. The callgrind_control script did not check for "permission denied" on opening these files, which resulted in some unexpected errors. Now, it is checked whether the "open" was successful, and if not, we skip the according callgrind process. Fixes bug 149963. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@6861 --- diff --git a/callgrind/callgrind_control.in b/callgrind/callgrind_control.in index d2e1ff57f6..f32a75dfb8 100644 --- a/callgrind/callgrind_control.in +++ b/callgrind/callgrind_control.in @@ -43,7 +43,8 @@ sub getCallgrindPids { close MAP; if ($found == 0) { next; } - open INFO, "<$f"; + $res = open INFO, "<$f"; + if (!$res) { next; } while() { if (/version: (\d+)/) { $mversion{$pid} = $1; } if (/cmd: (.+)$/) { $cmd{$pid} = $1; }