Commit 9cd72574 by Janne Blomqvist

PR47296 Segfault when running out of file descriptors

From-SVN: r168888
parent 124b5e36
2011-01-17 Janne Blomqvist <jb@gcc.gnu.org>
PR libfortran/47296
* io/unix.c (tempfile): Set opp->file and opp->file_len also if an
error occurs.
2011-01-16 Jakub Jelinek <jakub@redhat.com> 2011-01-16 Jakub Jelinek <jakub@redhat.com>
PR fortran/46625 PR fortran/46625
......
/* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 /* Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
2011
Free Software Foundation, Inc. Free Software Foundation, Inc.
Contributed by Andy Vaught Contributed by Andy Vaught
F2003 I/O support contributed by Jerry DeLisle F2003 I/O support contributed by Jerry DeLisle
...@@ -1084,13 +1085,8 @@ tempfile (st_parameter_open *opp) ...@@ -1084,13 +1085,8 @@ tempfile (st_parameter_open *opp)
while (fd == -1 && errno == EEXIST); while (fd == -1 && errno == EEXIST);
#endif /* HAVE_MKSTEMP */ #endif /* HAVE_MKSTEMP */
if (fd < 0) opp->file = template;
free (template); opp->file_len = strlen (template); /* Don't include trailing nul */
else
{
opp->file = template;
opp->file_len = strlen (template); /* Don't include trailing nul */
}
return fd; return fd;
} }
......
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