]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Allow selection of an alternative location for temporary files at
authorJulian Seward <jseward@acm.org>
Tue, 12 Jul 2011 06:58:55 +0000 (06:58 +0000)
committerJulian Seward <jseward@acm.org>
Tue, 12 Jul 2011 06:58:55 +0000 (06:58 +0000)
configure time, via the --with-tmpdir flag.  The configure.in part of
this was mistakenly committed already in r11872 as first hunk of the
configure.in change.  Bug 266035 comment 11.  (Kenny Root,
kroot@google.com)

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

coregrind/m_libcfile.c
coregrind/m_main.c

index 4017d11d119b2f976fe54a0fc266043c88b108ce..a38df075d9a51a1fd50b657ba424a297ee0936f4 100644 (file)
@@ -614,8 +614,8 @@ Int VG_(mkstemp) ( HChar* part_of_name, /*OUT*/HChar* fullname )
    while (True) {
       if (tries++ > 10) 
          return -1;
-      VG_(sprintf)( buf, "/tmp/valgrind_%s_%08x", 
-                         part_of_name, VG_(random)( &seed ));
+      VG_(sprintf)( buf, "%s/valgrind_%s_%08x", 
+                         VG_TMPDIR, part_of_name, VG_(random)( &seed ));
       if (0)
          VG_(printf)("VG_(mkstemp): trying: %s\n", buf);
 
index d724d53e1f4cecb7b3d87884059443e220aae5c5..97fed583cd9e25b28292990009a13aba3ddb7937 100644 (file)
@@ -1723,7 +1723,7 @@ Int valgrind_main ( Int argc, HChar **argv, HChar **envp )
       VG_(sprintf)(buf, "proc_%d_cmdline", VG_(getpid)());
       fd = VG_(mkstemp)( buf, buf2 );
       if (fd == -1)
-         VG_(err_config_error)("Can't create client cmdline file in /tmp.");
+         VG_(err_config_error)("Can't create client cmdline file in " VG_TMPDIR);
 
       nul[0] = 0;
       exename = VG_(args_the_exename) ? VG_(args_the_exename)
@@ -1744,7 +1744,7 @@ Int valgrind_main ( Int argc, HChar **argv, HChar **envp )
       /* Now delete it, but hang on to the fd. */
       r = VG_(unlink)( buf2 );
       if (r)
-         VG_(err_config_error)("Can't delete client cmdline file in /tmp.");
+         VG_(err_config_error)("Can't delete client cmdline file in " VG_TMPDIR);
 
       VG_(cl_cmdline_fd) = fd;
    }