diff options
author | Francois-Xavier Coudert <coudert@clipper.ens.fr> | 2005-08-07 00:57:46 +0200 |
---|---|---|
committer | François-Xavier Coudert <fxcoudert@gcc.gnu.org> | 2005-08-06 22:57:46 +0000 |
commit | e087fdd81c5f4bf07d629811f5cec2a27b8377f8 (patch) | |
tree | 6498749cbf2e63a2b2e64c446f2702bb36c40f32 | |
parent | 9f6206d9df6963318e5bf2ea6ddc5c747f46ff37 (diff) | |
download | gcc-e087fdd81c5f4bf07d629811f5cec2a27b8377f8.zip gcc-e087fdd81c5f4bf07d629811f5cec2a27b8377f8.tar.gz gcc-e087fdd81c5f4bf07d629811f5cec2a27b8377f8.tar.bz2 |
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
-rw-r--r-- | libgfortran/ChangeLog | 8 | ||||
-rw-r--r-- | libgfortran/io/io.h | 2 | ||||
-rw-r--r-- | libgfortran/io/unix.c | 4 |
3 files changed, 11 insertions, 3 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 79e8f9b..cff23fab 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 37bdb3e..3c932fc 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 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; |