]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
ms_print ought to create temporary files in a proper directory as
authorFlorian Krohm <florian@eich-krohm.de>
Sat, 21 Jun 2014 20:25:30 +0000 (20:25 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Sat, 21 Jun 2014 20:25:30 +0000 (20:25 +0000)
specified with --with-tmpdir at configuration time or with TMPDIR
at runtime. Doing so fixes the symptom reported in BZ #332765.
Also fix an incorrect error message.

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

NEWS
configure.ac
docs/internals/3_9_BUGSTATUS.txt
massif/ms_print.in

diff --git a/NEWS b/NEWS
index 6c2cac107154a72e36dc02810f8b1cbb1b84f0af..f139f3cf56f6de8235e8b9c42a2e5d7b396bde28 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -143,6 +143,7 @@ where XXXXXX is the bug number as listed below.
         client requests
 332276  Implement additional Xen hypercalls
 332658  ldrd.w r1, r2, [PC, #imm] does not adjust for 32bit alignment
+332765  Fix ms_print to create temporary files in a proper directory
 333072  drd: Add semaphore annotations
 333145  Tests for missaligned PC+#imm access for arm
 333228  AAarch64 Missing instruction encoding: mrs %[reg], ctr_el0
index 14c4fbf2d0695b62638a346e2763919182650c48..e87a2e4c66a2f19c95def9257cbbef8ad246fa44 100644 (file)
@@ -801,6 +801,7 @@ AC_ARG_WITH(tmpdir,
    tmpdir="$withval",
    tmpdir="/tmp")
 AC_DEFINE_UNQUOTED(VG_TMPDIR, "$tmpdir", [Temporary files directory])
+AC_SUBST(VG_TMPDIR, [$tmpdir])
 
 
 #----------------------------------------------------------------------------
index 8b06171cce28f9e4f5166d8405b40c42dd90ba83..93263c8fccaf219e15011edd949cfb8b98bbefc9 100644 (file)
@@ -108,8 +108,6 @@ For bugs reported before this time, see 3_8_BUGSTATUS.txt
 
 === Tools/Massif =======================================================
 
-332765  ms_print reports bad error if temp file can't be created
-        in current directory
 
 === Tools/Cachegrind ===================================================
 
index e6ffdbff8d6f171ad45af7f5baed1f0f51056b62..5696653e0ab944c832e1ee5421e088da4ba2a857 100755 (executable)
@@ -51,8 +51,13 @@ my $graph_y = 20;
 # Input file name
 my $input_file = undef;
 
+# Where to create tmp files. See also function VG_(tmpdir) in m_libcfile.c.
+my $tmp_dir = $ENV{"TMPDIR"};
+$tmp_dir = "@VG_TMPDIR@" if (! $tmp_dir);
+$tmp_dir = "/tmp" if (! $tmp_dir);
+
 # Tmp file name.
-my $tmp_file = "ms_print.tmp.$$";
+my $tmp_file = "$tmp_dir/ms_print.tmp.$$";
 
 # Version number.
 my $version = "@VERSION@";
@@ -390,7 +395,7 @@ sub read_input_file()
     # Print snapshot list header to $tmp_file.
     #-------------------------------------------------------------------------
     open(TMPFILE, "> $tmp_file") 
-         || die "Cannot open $tmp_file for reading\n";
+         || die "Cannot open $tmp_file for writing\n";
 
     my $time_column = sprintf("%14s", "time($time_unit)");
     my $column_format = "%3s %14s %16s %16s %13s %12s\n";