summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-06 22:57:46 +0000
committerfxcoudert <fxcoudert@138bc75d-0d04-0410-961f-82ee72b054a4>2005-08-06 22:57:46 +0000
commitac09d5cc38ac15bd275d0e2e14b6942266750d93 (patch)
tree6498749cbf2e63a2b2e64c446f2702bb36c40f32 /libgfortran
parent0d820f372ef0d71c008e1709524ad18f8e8bb6e7 (diff)
downloadgcc-ac09d5cc38ac15bd275d0e2e14b6942266750d93.tar.gz
* io/io.h: Change DEFAULT_TEMPDIR to /tmp instead of /var/tmp.
* io/unix.c (tempfile): Look at the TEMP environment variable to find the temporary files directory. Whitespace correction. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@102822 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog8
-rw-r--r--libgfortran/io/io.h2
-rw-r--r--libgfortran/io/unix.c4
3 files changed, 11 insertions, 3 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 79e8f9bfe58..cff23fabcee 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,4 +1,10 @@
-2005-08-04 Francois-Xavier Coudert <coudert@clipper.ens.fr>
+2005-08-07 Francois-Xavier Coudert <coudert@clipper.ens.fr>
+
+ * io/io.h: Change DEFAULT_TEMPDIR to /tmp instead of /var/tmp.
+ * io/unix.c (tempfile): Look at the TEMP environment variable
+ to find the temporary files directory. Whitespace correction.
+
+2005-08-06 Francois-Xavier Coudert <coudert@clipper.ens.fr>
* io/unix.c: Add O_RDWR to open() call.
diff --git a/libgfortran/io/io.h b/libgfortran/io/io.h
index 37bdb3ebdfa..3c932fc6303 100644
--- a/libgfortran/io/io.h
+++ b/libgfortran/io/io.h
@@ -33,7 +33,7 @@ Boston, MA 02111-1307, USA. */
#include <setjmp.h>
#include "libgfortran.h"
-#define DEFAULT_TEMPDIR "/var/tmp"
+#define DEFAULT_TEMPDIR "/tmp"
/* Basic types used in data transfers. */
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c
index 56df254d380..e6b0478af23 100644
--- a/libgfortran/io/unix.c
+++ b/libgfortran/io/unix.c
@@ -984,6 +984,8 @@ tempfile (void)
if (tempdir == NULL)
tempdir = getenv ("TMP");
if (tempdir == NULL)
+ tempdir = getenv ("TEMP");
+ if (tempdir == NULL)
tempdir = DEFAULT_TEMPDIR;
template = get_mem (strlen (tempdir) + 20);
@@ -998,7 +1000,7 @@ tempfile (void)
if (mktemp (template))
do
- fd = open (template, O_RDWR |O_CREAT | O_EXCL, S_IREAD | S_IWRITE);
+ fd = open (template, O_RDWR | O_CREAT | O_EXCL, S_IREAD | S_IWRITE);
while (!(fd == -1 && errno == EEXIST) && mktemp (template));
else
fd = -1;