]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Don't call VG_(mash_LD_PRELOAD_and_LD_LIBRARY_PATH) if all we're doing
authorJulian Seward <jseward@acm.org>
Sat, 26 Apr 2003 22:29:25 +0000 (22:29 +0000)
committerJulian Seward <jseward@acm.org>
Sat, 26 Apr 2003 22:29:25 +0000 (22:29 +0000)
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

coregrind/vg_main.c

index 3ac5c331fde822121cb287f3183c5c8e8d3ff0e3..43afb190743bfc8521f2a63702f02fe98f28250b 100644 (file)
@@ -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")