diff options
author | Dave Korn <dave.korn@artimi.com> | 2009-06-25 12:32:10 +0000 |
---|---|---|
committer | Dave Korn <dave.korn@artimi.com> | 2009-06-25 12:32:10 +0000 |
commit | 14798489afb6560d94c0c438b641544628da72a8 (patch) | |
tree | 3249387af10a68cbaf3d43b2776f751972032401 /bfd/plugin.c | |
parent | ef91e810b447515a595bf4b201ffcf1be39174ac (diff) | |
download | binutils-redhat-14798489afb6560d94c0c438b641544628da72a8.tar.gz |
2009-06-25 Rafael Avila de Espindola <espindola@google.com>
* plugin.c (load_plugin): Use stat and S_ISREG instead of the d_type
field of struct dirent.
Diffstat (limited to 'bfd/plugin.c')
-rw-r--r-- | bfd/plugin.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bfd/plugin.c b/bfd/plugin.c index ca47ab620f..053fdd1bd7 100644 --- a/bfd/plugin.c +++ b/bfd/plugin.c @@ -203,11 +203,11 @@ load_plugin (void) while ((ent = readdir (d))) { char *full_name; - if (ent->d_type != DT_REG && ent->d_type != DT_LNK) - continue; + struct stat s; full_name = concat (p, "/", ent->d_name, NULL); - found = try_load_plugin (full_name); + if (stat(full_name, &s) == 0 && S_ISREG (s.st_mode)) + found = try_load_plugin (full_name); free (full_name); if (found) break; |