From: Julian Seward Date: Sat, 26 Apr 2003 22:29:25 +0000 (+0000) Subject: Don't call VG_(mash_LD_PRELOAD_and_LD_LIBRARY_PATH) if all we're doing X-Git-Tag: svn/VALGRIND_2_0_0~193 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=89b48351b8014d5cb169589de5a18dde8d8a19f5;p=thirdparty%2Fvalgrind.git Don't call VG_(mash_LD_PRELOAD_and_LD_LIBRARY_PATH) if all we're doing is exiting normally. There's no point, and it causes breakage when programs which write their environment variables, finish normally. MERGE TO STABLE git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1567 --- diff --git a/coregrind/vg_main.c b/coregrind/vg_main.c index 3ac5c331fd..43afb19074 100644 --- a/coregrind/vg_main.c +++ b/coregrind/vg_main.c @@ -1520,7 +1520,11 @@ void VG_(main) ( void ) /* Remove valgrind.so from a LD_PRELOAD=... string so child processes don't get traced into. Also mess up $libdir/valgrind so that our libpthread.so disappears from view. */ - if (!VG_(clo_trace_children)) { + /* 26 Apr 03: doing this often causes trouble for no reason, and is + pointless when we are just about to VgSrc_ExitSyscall. So don't + bother in that case. */ + if ((!VG_(clo_trace_children)) + && src != VgSrc_ExitSyscall) { VG_(mash_LD_PRELOAD_and_LD_LIBRARY_PATH)( VG_(getenv)("LD_PRELOAD"), VG_(getenv)("LD_LIBRARY_PATH")