From e087fdd81c5f4bf07d629811f5cec2a27b8377f8 Mon Sep 17 00:00:00 2001 From: Francois-Xavier Coudert Date: Sun, 7 Aug 2005 00:57:46 +0200 Subject: io.h: Change DEFAULT_TEMPDIR to /tmp instead of /var/tmp. * 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. From-SVN: r102822 --- libgfortran/io/unix.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'libgfortran/io/unix.c') diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c index 56df254..e6b0478 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; -- cgit v1.1