|
From: <sv...@va...> - 2011-07-12 07:03:47
|
Author: sewardj
Date: 2011-07-12 07:58:55 +0100 (Tue, 12 Jul 2011)
New Revision: 11881
Log:
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,
kr...@go...)
Modified:
trunk/coregrind/m_libcfile.c
trunk/coregrind/m_main.c
Modified: trunk/coregrind/m_libcfile.c
===================================================================
--- trunk/coregrind/m_libcfile.c 2011-07-12 06:29:00 UTC (rev 11880)
+++ trunk/coregrind/m_libcfile.c 2011-07-12 06:58:55 UTC (rev 11881)
@@ -614,8 +614,8 @@
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);
Modified: trunk/coregrind/m_main.c
===================================================================
--- trunk/coregrind/m_main.c 2011-07-12 06:29:00 UTC (rev 11880)
+++ trunk/coregrind/m_main.c 2011-07-12 06:58:55 UTC (rev 11881)
@@ -1723,7 +1723,7 @@
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 @@
/* 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;
}
|
|
From: Florian K. <br...@ac...> - 2011-07-12 13:28:58
|
On 07/12/2011 02:58 AM, sv...@va... wrote: > Author: sewardj > Date: 2011-07-12 07:58:55 +0100 (Tue, 12 Jul 2011) > New Revision: 11881 > > Log: > 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, > kr...@go...) > A related bug is 267020 which also asks for a configurable location for temp files. There is a patch there that looks at the TMPDIR environment variable to decide where to put temp files. So the location is configurable at runtime which, for a user, has the advantage of not requiring a compile step. I'm going to rework the patch there using the logic that TMPDIR takes precedence over VG_TMPDIR. Florian |
|
From: Julian S. <js...@ac...> - 2011-07-12 17:51:43
|
> I'm going to rework the patch there using the logic that TMPDIR takes > precedence over VG_TMPDIR. Sounds good to me. J |