Commit e087fdd8 by Francois-Xavier Coudert Committed by François-Xavier Coudert

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
parent 9f6206d9
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. * io/unix.c: Add O_RDWR to open() call.
......
...@@ -33,7 +33,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -33,7 +33,7 @@ Boston, MA 02111-1307, USA. */
#include <setjmp.h> #include <setjmp.h>
#include "libgfortran.h" #include "libgfortran.h"
#define DEFAULT_TEMPDIR "/var/tmp" #define DEFAULT_TEMPDIR "/tmp"
/* Basic types used in data transfers. */ /* Basic types used in data transfers. */
......
...@@ -984,6 +984,8 @@ tempfile (void) ...@@ -984,6 +984,8 @@ tempfile (void)
if (tempdir == NULL) if (tempdir == NULL)
tempdir = getenv ("TMP"); tempdir = getenv ("TMP");
if (tempdir == NULL) if (tempdir == NULL)
tempdir = getenv ("TEMP");
if (tempdir == NULL)
tempdir = DEFAULT_TEMPDIR; tempdir = DEFAULT_TEMPDIR;
template = get_mem (strlen (tempdir) + 20); template = get_mem (strlen (tempdir) + 20);
...@@ -998,7 +1000,7 @@ tempfile (void) ...@@ -998,7 +1000,7 @@ tempfile (void)
if (mktemp (template)) if (mktemp (template))
do 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)); while (!(fd == -1 && errno == EEXIST) && mktemp (template));
else else
fd = -1; fd = -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment