Don't call stat before opening a file.

2011-12-01  Janne Blomqvist  <jb@gcc.gnu.org>

	* misc.c (gfc_open_file): Don't call stat.

From-SVN: r181875
This commit is contained in:
Janne Blomqvist 2011-12-01 10:55:32 +02:00
parent 3e68d6d75a
commit 12f300a8aa
2 changed files with 4 additions and 8 deletions

View file

@ -1,3 +1,7 @@
2011-12-01 Janne Blomqvist <jb@gcc.gnu.org>
* misc.c (gfc_open_file): Don't call stat.
2011-11-29 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/40958

View file

@ -58,17 +58,9 @@ gfc_clear_ts (gfc_typespec *ts)
FILE *
gfc_open_file (const char *name)
{
struct stat statbuf;
if (!*name)
return stdin;
if (stat (name, &statbuf) < 0)
return NULL;
if (!S_ISREG (statbuf.st_mode))
return NULL;
return fopen (name, "r");
}