Commit 12f300a8 by Janne Blomqvist

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
parent 3e68d6d7
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> 2011-11-29 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/40958 PR fortran/40958
......
...@@ -58,17 +58,9 @@ gfc_clear_ts (gfc_typespec *ts) ...@@ -58,17 +58,9 @@ gfc_clear_ts (gfc_typespec *ts)
FILE * FILE *
gfc_open_file (const char *name) gfc_open_file (const char *name)
{ {
struct stat statbuf;
if (!*name) if (!*name)
return stdin; return stdin;
if (stat (name, &statbuf) < 0)
return NULL;
if (!S_ISREG (statbuf.st_mode))
return NULL;
return fopen (name, "r"); return fopen (name, "r");
} }
......
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