From ef6f20cad489481b1fcc610d4503baf96b62a204 Mon Sep 17 00:00:00 2001 From: Josef Weidendorfer Date: Tue, 18 Sep 2007 19:12:57 +0000 Subject: [PATCH] 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 --- callgrind/callgrind_control.in | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; } -- 2.47.2