From 10c682a0cb57e9ed0d5bb47a20af7932486b56a5 Mon Sep 17 00:00:00 2001 From: Francois-Xavier Coudert Date: Sat, 27 Aug 2005 18:01:54 +0200 Subject: acinclude.m4 (LIBGFOR_CHECK_UNLINK_OPEN_FILE): Add check to see if target can unlink open files. * acinclude.m4 (LIBGFOR_CHECK_UNLINK_OPEN_FILE): Add check to see if target can unlink open files. * configure.ac: Use this new test. * config.h.in: Regenerate. * configure: Regenerate. * Makefile.in: Regenerate. * aclocal.ac: Regenerate. * io/io.h: Add prototype for unpack_filename. * io/close.c (st_close): Delete file after closing unit if HAVE_UNLINK_OPEN_FILE is not defined. * io/unix.c (unpack_filename): Unlink scratch file after opening it only if HAVE_UNLINK_OPEN_FILE is defined. From-SVN: r103566 --- libgfortran/io/unix.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'libgfortran/io/unix.c') diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c index bcf50f3..a0ed7b6 100644 --- a/libgfortran/io/unix.c +++ b/libgfortran/io/unix.c @@ -952,7 +952,7 @@ unit_to_fd(int unit) * buffer that is PATH_MAX characters, convert the fortran string to a * C string in the buffer. Returns nonzero if this is not possible. */ -static int +int unpack_filename (char *cstring, const char *fstring, int len) { len = fstrlen (fstring, len); @@ -1136,8 +1136,11 @@ open_external (unit_flags *flags) fd = tempfile (); if (flags->action == ACTION_UNSPECIFIED) flags->action = ACTION_READWRITE; + +#if HAVE_UNLINK_OPEN_FILE /* We can unlink scratch files now and it will go away when closed. */ unlink (ioparm.file); +#endif } else { -- cgit v1.1