|
From: <sv...@va...> - 2014-06-21 20:25:50
|
Author: florian
Date: Sat Jun 21 20:25:30 2014
New Revision: 14077
Log:
ms_print ought to create temporary files in a proper directory as
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.
Modified:
trunk/NEWS
trunk/configure.ac
trunk/docs/internals/3_9_BUGSTATUS.txt
trunk/massif/ms_print.in
Modified: trunk/NEWS
==============================================================================
--- trunk/NEWS (original)
+++ trunk/NEWS Sat Jun 21 20:25:30 2014
@@ -143,6 +143,7 @@
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
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Sat Jun 21 20:25:30 2014
@@ -801,6 +801,7 @@
tmpdir="$withval",
tmpdir="/tmp")
AC_DEFINE_UNQUOTED(VG_TMPDIR, "$tmpdir", [Temporary files directory])
+AC_SUBST(VG_TMPDIR, [$tmpdir])
#----------------------------------------------------------------------------
Modified: trunk/docs/internals/3_9_BUGSTATUS.txt
==============================================================================
--- trunk/docs/internals/3_9_BUGSTATUS.txt (original)
+++ trunk/docs/internals/3_9_BUGSTATUS.txt Sat Jun 21 20:25:30 2014
@@ -108,8 +108,6 @@
=== Tools/Massif =======================================================
-332765 ms_print reports bad error if temp file can't be created
- in current directory
=== Tools/Cachegrind ===================================================
Modified: trunk/massif/ms_print.in
==============================================================================
--- trunk/massif/ms_print.in (original)
+++ trunk/massif/ms_print.in Sat Jun 21 20:25:30 2014
@@ -51,8 +51,13 @@
# 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 @@
# 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";
|