From: Julian Seward Date: Mon, 4 Jan 2010 21:49:25 +0000 (+0000) Subject: Disable pid caching for print output: it's wrong in a child after X-Git-Tag: svn/VALGRIND_3_6_0~407 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c21cd2532a67cff2d952c0de7c89a81375beb13;p=thirdparty%2Fvalgrind.git Disable pid caching for print output: it's wrong in a child after a fork() and is very confusing. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11017 --- diff --git a/coregrind/m_libcprint.c b/coregrind/m_libcprint.c index 1782417d94..8cde39a36c 100644 --- a/coregrind/m_libcprint.c +++ b/coregrind/m_libcprint.c @@ -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);