This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix the plugin search in some file systems


> Attached patch ?-)

Oops :-)

Cheers,
-- 
Rafael Avila de Espindola

Google | Gordon House | Barrow Street | Dublin 4 | Ireland
Registered in Dublin, Ireland | Registration Number: 368047
diff --git a/bfd/plugin.c b/bfd/plugin.c
index ca47ab6..5c59751 100644
--- a/bfd/plugin.c
+++ b/bfd/plugin.c
@@ -203,11 +203,25 @@ load_plugin (void)
   while ((ent = readdir (d)))
     {
       char *full_name;
-      if (ent->d_type != DT_REG && ent->d_type != DT_LNK)
+      int is_file = 0;
+
+      if (ent->d_type != DT_REG && ent->d_type != DT_LNK
+	  && ent->d_type != DT_UNKNOWN)
 	continue;
 
       full_name = concat (p, "/", ent->d_name, NULL);
-      found = try_load_plugin (full_name);
+
+      if (ent->d_type == DT_REG)
+	is_file = 1;
+      else
+	{
+	  struct stat s;
+	  if (stat(full_name, &s) == 0 && S_ISREG (s.st_mode))
+	    is_file = 1;
+	}
+
+      if (is_file)
+	found = try_load_plugin (full_name);
       free (full_name);
       if (found)
 	break;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]