diff options
author | Dave Korn <dave.korn@artimi.com> | 2009-06-25 12:32:09 +0000 |
---|---|---|
committer | Dave Korn <dave.korn@artimi.com> | 2009-06-25 12:32:09 +0000 |
commit | bf7f4d2b131aad3a125f7a364251efac27b1c5dc (patch) | |
tree | 69d813527fe3f481fa8956d63d4b5db013b1eba7 | |
parent | 78de5596364746c448627d4fdb9870942f8e0a49 (diff) | |
download | gdb-bf7f4d2b131aad3a125f7a364251efac27b1c5dc.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.
-rw-r--r-- | bfd/ChangeLog | 5 | ||||
-rw-r--r-- | bfd/plugin.c | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index f5cbe7119e4..0ac28206a7f 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +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. + 2009-06-23 Tristan Gingold <gingold@adacore.com> * vms.c (vms_get_synthetic_symtab): Remove duplicate definition diff --git a/bfd/plugin.c b/bfd/plugin.c index ca47ab620f2..053fdd1bd70 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; |