Enable environment variable TMPDIR to set the log temporary directory.
authorEric S. Raymond <esr@thyrsus.com>
Mon, 13 Sep 2010 15:49:11 +0000 (15:49 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Mon, 13 Sep 2010 15:49:11 +0000 (15:49 +0000)
doc/sst.xml
src/sst.py

index fa2074fc63ad3149f8490c6358f9985a10368aa6..bd7259b94545f1f2b0a3bfedf79cddf9b2b021b0 100644 (file)
@@ -66,19 +66,20 @@ mode (all features enabled).</para>
 <refsect1 id='files'><title>FILES</title>
 <variablelist>
 <varlistentry>
-<term>/usr/share/doc/sst/sst.doc</term>
+<term><filename>/usr/share/doc/sst/sst.doc</filename></term>
 <listitem>
 <para>Documentation file.</para>
 </listitem>
 </varlistentry>
 <varlistentry>
-<term>/usr/tmp/sst-input.log</term>
+<term><filename>$TMPDIR/sst-input.log</filename></term>
 <listitem>
-<para>Where user input is saved to (send this with your bug reports).</para>
+<para>Where user input is saved to (send this with your bug reports).
+If TMPDIR is not set is defaults to <filename>/tmp</filename>.</para>
 </listitem>
 </varlistentry>
 <varlistentry>
-<term>emsave.trk</term>
+<term><filename>emsave.trk</filename></term>
 <listitem>
 <para>Save file produced by EMEXIT command.</para>
 </listitem>
index 00f6df3dfa65ec08b449a6fa8c933283ebca08ca..9eaf77dc990a98fab700f7eb927dc613f1298a3c 100644 (file)
@@ -6197,8 +6197,12 @@ if __name__ == '__main__':
                 sys.stderr.write("usage: sst [-t] [-x] [startcommand...].\n")
                 raise SystemExit, 1
         # where to save the input in case of bugs
+        if "TMPDIR" in os.environ:
+            tmpdir = os.environ['TMPDIR']
+        else:
+            tmpdir = "/tmp"
         try:
-            logfp = open("/tmp/sst-input.log", "w")
+            logfp = open(os.path.join(tmpdir, "sst-input.log"), "w")
         except IOError:
             sys.stderr.write("sst: warning, can't open logfile\n")
             sys.exit(1)