aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Evans <dje@gnu.org>1996-04-17 18:27:45 +0000
committerDoug Evans <dje@gnu.org>1996-04-17 18:27:45 +0000
commit6524f6537cc038c96af638a6e5a319f18d583023 (patch)
tree9fa7f87beb0a329cdf2b52d436a60c808077db10
parent1ad2a62d1c61d5ca4f6f2a836cc743a5fbb0f8ba (diff)
downloadgcc-6524f6537cc038c96af638a6e5a319f18d583023.zip
gcc-6524f6537cc038c96af638a6e5a319f18d583023.tar.gz
gcc-6524f6537cc038c96af638a6e5a319f18d583023.tar.bz2
Don't include sys/file.h ifdef NO_SYS_FILE_H.
(choose_temp_base): Make tmp,usrtmp static locals. From-SVN: r11835
-rw-r--r--gcc/choose-temp.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/gcc/choose-temp.c b/gcc/choose-temp.c
index 4234b84..009147f 100644
--- a/gcc/choose-temp.c
+++ b/gcc/choose-temp.c
@@ -19,7 +19,7 @@ Boston, MA 02111-1307, USA. */
/* This file exports one function: choose_temp_base. */
-#ifndef _WIN32
+#if ! defined (_WIN32) && ! defined (NO_SYS_FILE_H)
#include <sys/file.h> /* May get R_OK, etc. on some systems. */
#endif
@@ -90,7 +90,8 @@ choose_temp_base ()
char *base = 0;
char *temp_filename;
int len;
- char usrtmp[sizeof ("/usr/tmp")],tmp[sizeof ("/tmp")];
+ static char tmp[] = { DIR_SEPARATOR, 't', 'm', 'p', 0 };
+ static char usrtmp[] = { DIR_SEPARATOR, 'u', 's', 'r', DIR_SEPARATOR, 't', 'm', 'p', 0 };
#ifndef MPW
base = try (getenv ("TMPDIR"), base);
@@ -102,9 +103,7 @@ choose_temp_base ()
#endif
/* Try /usr/tmp, then /tmp. */
- sprintf (usrtmp, "%cusr%ctmp", DIR_SEPARATOR, DIR_SEPARATOR);
base = try (usrtmp, base);
- sprintf (tmp, "%ctmp", DIR_SEPARATOR);
base = try (tmp, base);
/* If all else fails, use the current directory! */