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:
parent
3e68d6d75a
commit
12f300a8aa
2 changed files with 4 additions and 8 deletions
|
@ -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
|
||||
|
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue