]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Disable pid caching for print output: it's wrong in a child after
authorJulian Seward <jseward@acm.org>
Mon, 4 Jan 2010 21:49:25 +0000 (21:49 +0000)
committerJulian Seward <jseward@acm.org>
Mon, 4 Jan 2010 21:49:25 +0000 (21:49 +0000)
a fork() and is very confusing.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11017

coregrind/m_libcprint.c

index 1782417d94b277079aa981181ba8444104a17b96..8cde39a36cab50b687cd5d57cb789d2c0f00491c 100644 (file)
@@ -470,6 +470,8 @@ UInt VG_(vmessage) ( VgMsgKind kind, const HChar* format, va_list vargs )
 
    /* Cache the results of getpid just once, so we don't have to call
       getpid once for each line of text output. */
+   b->my_pid = -1; /* LATER: cacheing is confusing in presence of fork(),
+                      disable for now. */
    if (UNLIKELY(b->my_pid == -1)) {
       b->my_pid = VG_(getpid)();
       vg_assert(b->my_pid >= 0);