summaryrefslogtreecommitdiffstats
path: root/contrib/gcc/choose-temp.c
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>1999-10-02 21:50:07 +0000
committerobrien <obrien@FreeBSD.org>1999-10-02 21:50:07 +0000
commita1342c30eda566a43048b28e86c7e88d790609e9 (patch)
tree665c67c3aebcaed2544b90e3bddd9607ef653ccc /contrib/gcc/choose-temp.c
parent2ce1fde8f9bae8e5ebee350015463261561df1cc (diff)
downloadFreeBSD-src-a1342c30eda566a43048b28e86c7e88d790609e9.zip
FreeBSD-src-a1342c30eda566a43048b28e86c7e88d790609e9.tar.gz
* We have /var/tmp, not /usr/tmp. So use that where EGCS used the latter.
* In the absence of the env vars TMPDIR, TMP, TEMP (which override this ordering), attempt to create temperary files in /tmp, P_tmpdir (/var/tmp), /usr/tmp, and . until successful.
Diffstat (limited to 'contrib/gcc/choose-temp.c')
-rw-r--r--contrib/gcc/choose-temp.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/contrib/gcc/choose-temp.c b/contrib/gcc/choose-temp.c
index 4629336..56b229e 100644
--- a/contrib/gcc/choose-temp.c
+++ b/contrib/gcc/choose-temp.c
@@ -22,6 +22,8 @@ Boston, MA 02111-1307, USA. */
/* This file lives in at least two places: libiberty and gcc.
Don't change one without the other. */
+/* $FreeBSD$ */
+
#if defined (IN_GCC) || defined (HAVE_CONFIG_H)
#include "config.h"
#endif
@@ -120,13 +122,14 @@ choose_temp_base ()
base = try (getenv ("TMP"), base);
base = try (getenv ("TEMP"), base);
+ base = try (tmp, base);
+
#ifdef P_tmpdir
base = try (P_tmpdir, base);
#endif
- /* Try /usr/tmp, then /tmp. */
+ /* Try /usr/tmp even though it usually doesn't exist on FreeBSD. */
base = try (usrtmp, base);
- base = try (tmp, base);
/* If all else fails, use the current directory! */
if (base == 0)
@@ -166,13 +169,14 @@ make_temp_file (suffix)
base = try (getenv ("TMP"), base);
base = try (getenv ("TEMP"), base);
+ base = try (tmp, base);
+
#ifdef P_tmpdir
base = try (P_tmpdir, base);
#endif
- /* Try /usr/tmp, then /tmp. */
+ /* Try /usr/tmp even though it usually doesn't exist on FreeBSD. */
base = try (usrtmp, base);
- base = try (tmp, base);
/* If all else fails, use the current directory! */
if (base == 0)
OpenPOWER on IntegriCloud