summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2011-02-26 20:55:27 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2011-02-26 20:55:27 +0000
commit7c5d01e716298af3e82b47658d3c56424c346401 (patch)
tree9857739bf655adbbe927797e62e2290de93cfc30 /libgfortran
parent8ad1c03526de35b3b50b7c5661ae1f038d20e1e2 (diff)
downloadgcc-7c5d01e716298af3e82b47658d3c56424c346401.tar.gz
2011-02-26 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 170521 using svnmerge git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@170522 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog11
-rw-r--r--libgfortran/acinclude.m41
-rwxr-xr-xlibgfortran/configure1
-rw-r--r--libgfortran/io/unix.c8
4 files changed, 19 insertions, 2 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index fc7a2c4ca6d..bc85a6c9e0f 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,14 @@
+2011-02-26 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ PR libfortran/45165
+ * unix.c (fallback_access): Fix file descriptor leaks.
+
+2011-02-25 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
+
+ * acinclude.m4 (LIBGFOR_CHECK_FPSETMASK): Set shell variable
+ tested in configure.host.
+ * configure: Regenerate.
+
2011-02-24 Janne Blomqvist <jb@gcc.gnu.org>
PR libfortran/47802
diff --git a/libgfortran/acinclude.m4 b/libgfortran/acinclude.m4
index 1bc1c7bbbfd..395a1eabe99 100644
--- a/libgfortran/acinclude.m4
+++ b/libgfortran/acinclude.m4
@@ -244,6 +244,7 @@ AC_DEFUN([LIBGFOR_CHECK_FPSETMASK], [
eval "libgfor_cv_have_fpsetmask=yes", eval "libgfor_cv_have_fpsetmask=no")
])
if test x"$libgfor_cv_have_fpsetmask" = xyes; then
+ have_fpsetmask=yes
AC_DEFINE(HAVE_FPSETMASK, 1, [Define if you have fpsetmask.])
fi
])
diff --git a/libgfortran/configure b/libgfortran/configure
index 749cd000651..13a079f9f24 100755
--- a/libgfortran/configure
+++ b/libgfortran/configure
@@ -25395,6 +25395,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $libgfor_cv_have_fpsetmask" >&5
$as_echo "$libgfor_cv_have_fpsetmask" >&6; }
if test x"$libgfor_cv_have_fpsetmask" = xyes; then
+ have_fpsetmask=yes
$as_echo "#define HAVE_FPSETMASK 1" >>confdefs.h
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c
index 004e8606c0a..12536ca5cbe 100644
--- a/libgfortran/io/unix.c
+++ b/libgfortran/io/unix.c
@@ -144,11 +144,15 @@ typedef struct stat gfstat_t;
static int
fallback_access (const char *path, int mode)
{
- if ((mode & R_OK) && open (path, O_RDONLY) < 0)
+ int fd;
+
+ if ((mode & R_OK) && (fd = open (path, O_RDONLY)) < 0)
return -1;
+ close (fd);
- if ((mode & W_OK) && open (path, O_WRONLY) < 0)
+ if ((mode & W_OK) && (fd = open (path, O_WRONLY)) < 0)
return -1;
+ close (fd);
if (mode == F_OK)
{