]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
callgrind_control: Fix behavior with callgrind runs of another user
authorJosef Weidendorfer <Josef.Weidendorfer@gmx.de>
Tue, 18 Sep 2007 19:12:57 +0000 (19:12 +0000)
committerJosef Weidendorfer <Josef.Weidendorfer@gmx.de>
Tue, 18 Sep 2007 19:12:57 +0000 (19:12 +0000)
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

index d2e1ff57f6ae8c69d6004042b5ed6aa58186d4b1..f32a75dfb8a49f28c0d74ffe9546817c51f4e513 100644 (file)
@@ -43,7 +43,8 @@ sub getCallgrindPids {
     close MAP;
     if ($found == 0) { next; }
 
-    open INFO, "<$f";
+    $res = open INFO, "<$f";
+    if (!$res) { next; }
     while(<INFO>) {
       if (/version: (\d+)/) { $mversion{$pid} = $1; }
       if (/cmd: (.+)$/) { $cmd{$pid} = $1; }