From: Julian Seward Date: Tue, 12 Jul 2011 06:58:55 +0000 (+0000) Subject: Allow selection of an alternative location for temporary files at X-Git-Tag: svn/VALGRIND_3_7_0~356 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d0958fc38270386f117abfaa3436eb328e4b3d4;p=thirdparty%2Fvalgrind.git Allow selection of an alternative location for temporary files at 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 --- diff --git a/coregrind/m_libcfile.c b/coregrind/m_libcfile.c index 4017d11d11..a38df075d9 100644 --- a/coregrind/m_libcfile.c +++ b/coregrind/m_libcfile.c @@ -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); diff --git a/coregrind/m_main.c b/coregrind/m_main.c index d724d53e1f..97fed583cd 100644 --- a/coregrind/m_main.c +++ b/coregrind/m_main.c @@ -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; }