From: Dave Korn Date: Thu, 25 Jun 2009 12:32:10 +0000 (+0000) Subject: 2009-06-25 Rafael Avila de Espindola X-Git-Tag: dje-cgen-play1-branchpoint~28 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c41ba836f2cfd3e9abe2e7b19613eb96e6428feb;p=external%2Fbinutils.git 2009-06-25 Rafael Avila de Espindola * plugin.c (load_plugin): Use stat and S_ISREG instead of the d_type field of struct dirent. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index f5cbe71..0ac2820 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,8 @@ +2009-06-25 Rafael Avila de Espindola + + * plugin.c (load_plugin): Use stat and S_ISREG instead of the d_type + field of struct dirent. + 2009-06-23 Tristan Gingold * vms.c (vms_get_synthetic_symtab): Remove duplicate definition diff --git a/bfd/plugin.c b/bfd/plugin.c index ca47ab6..053fdd1 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;