diff options
author | Janne Blomqvist <jb@gcc.gnu.org> | 2012-05-05 09:30:51 +0300 |
---|---|---|
committer | Janne Blomqvist <jb@gcc.gnu.org> | 2012-05-05 09:30:51 +0300 |
commit | 68ee9c0807fd3c9a66c649aa7bd3bebacfb0dff0 (patch) | |
tree | ac63807666eaf2ebc05379c848806981ba536332 /gcc | |
parent | 9154c66213636f44954feb8d73257560370c11c2 (diff) | |
download | gcc-68ee9c0807fd3c9a66c649aa7bd3bebacfb0dff0.zip gcc-68ee9c0807fd3c9a66c649aa7bd3bebacfb0dff0.tar.gz gcc-68ee9c0807fd3c9a66c649aa7bd3bebacfb0dff0.tar.bz2 |
Fix handling of temporary files.
2012-05-05 Janne Blomqvist <jb@gcc.gnu.org>
* gfortran.texi (GFORTRAN_TMPDIR): Rename to TMPDIR, explain
algorithm for choosing temp directory.
2012-05-05 Janne Blomqvist <jb@gcc.gnu.org>
* config.h.in: Regenerated.
* configure: Regenerated.
* configure.ac: Add checks for getegid and __secure_getenv.
* io/unix.c (P_tmpdir): Fallback definition for macro.
(tempfile_open): New function.
(tempfile): Use secure_getenv, call tempfile_open to try each
directory in turn.
* libgfortran.h (DEFAULT_TMPDIR): Remove macro.
(secure_getenv): New macro/prototype.
* runtime/environ.c (secure_getenv): New function.
(variable_table): Rename GFORTRAN_TMPDIR to TMPDIR.
* runtime/main.c (find_addr2line): Use secure_getenv.
From-SVN: r187190
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/fortran/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/fortran/gfortran.texi | 31 |
2 files changed, 27 insertions, 9 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index bb4c22d4..d1cb429 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,8 @@ +2012-05-05 Janne Blomqvist <jb@gcc.gnu.org> + + * gfortran.texi (GFORTRAN_TMPDIR): Rename to TMPDIR, explain + algorithm for choosing temp directory. + 2012-05-04 Tobias Burnus <burnus@net-b.de> PR fortran/53175 diff --git a/gcc/fortran/gfortran.texi b/gcc/fortran/gfortran.texi index b1790c6..96662c4 100644 --- a/gcc/fortran/gfortran.texi +++ b/gcc/fortran/gfortran.texi @@ -576,10 +576,10 @@ environment variables. Malformed environment variables are silently ignored. @menu +* TMPDIR:: Directory for scratch files * GFORTRAN_STDIN_UNIT:: Unit number for standard input * GFORTRAN_STDOUT_UNIT:: Unit number for standard output * GFORTRAN_STDERR_UNIT:: Unit number for standard error -* GFORTRAN_TMPDIR:: Directory for scratch files * GFORTRAN_UNBUFFERED_ALL:: Do not buffer I/O for all units. * GFORTRAN_UNBUFFERED_PRECONNECTED:: Do not buffer I/O for preconnected units. * GFORTRAN_SHOW_LOCUS:: Show location for runtime errors @@ -590,6 +590,27 @@ Malformed environment variables are silently ignored. * GFORTRAN_ERROR_BACKTRACE:: Show backtrace on run-time errors @end menu +@node TMPDIR +@section @env{TMPDIR}---Directory for scratch files + +When opening a file with @code{STATUS='SCRATCH'}, GNU Fortran tries to +create the file in one of the potential directories by testing each +directory in the order below. + +@enumerate +@item +The environment variable @env{TMPDIR}, if it exists. + +@item +On the MinGW target, the directory returned by the @code{GetTempPath} +function. Alternatively, on the Cygwin target, the @env{TMP} and +@env{TEMP} environment variables, if they exist, in that order. + +@item +The @code{P_tmpdir} macro if it is defined, otherwise the directory +@file{/tmp}. +@end enumerate + @node GFORTRAN_STDIN_UNIT @section @env{GFORTRAN_STDIN_UNIT}---Unit number for standard input @@ -611,14 +632,6 @@ This environment variable can be used to select the unit number preconnected to standard error. This must be a positive integer. The default value is 0. -@node GFORTRAN_TMPDIR -@section @env{GFORTRAN_TMPDIR}---Directory for scratch files - -This environment variable controls where scratch files are -created. If this environment variable is missing, -GNU Fortran searches for the environment variable @env{TMP}, then @env{TEMP}. -If these are missing, the default is @file{/tmp}. - @node GFORTRAN_UNBUFFERED_ALL @section @env{GFORTRAN_UNBUFFERED_ALL}---Do not buffer I/O on all units |