]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Make -k/-K prune "source" subdirectory.
authorRoland McGrath <roland@redhat.com>
Fri, 9 Jan 2009 04:53:26 +0000 (20:53 -0800)
committerRoland McGrath <roland@redhat.com>
Fri, 9 Jan 2009 04:53:26 +0000 (20:53 -0800)
libdwfl/ChangeLog
libdwfl/linux-kernel-modules.c

index 0e3768628f74532ba88524c34e8735bfc9c036ab..2ddfc3afa682bf4bb4a8867a65e4efe2be5ece90 100644 (file)
@@ -1,3 +1,9 @@
+2009-01-08  Roland McGrath  <roland@redhat.com>
+
+       * linux-kernel-modules.c (dwfl_linux_kernel_report_offline):
+       Skip subdirectory named "source".
+       (dwfl_linux_kernel_find_elf): Likewise.
+
 2009-01-06  Roland McGrath  <roland@redhat.com>
 
        * linux-kernel-modules.c (check_suffix): New function.
index 753e9bc9141055a9bbde426430737036a2235524..e07073cdfc712d4d7d225bda64b87766880bfba2 100644 (file)
@@ -319,6 +319,15 @@ dwfl_linux_kernel_report_offline (Dwfl *dwfl, const char *release,
       FTSENT *f;
       while ((f = fts_read (fts)) != NULL)
        {
+         /* Skip a "source" subtree, which tends to be large.
+            This insane hard-coding of names is what depmod does too.  */
+         if (f->fts_namelen == sizeof "source" - 1
+             && !strcmp (f->fts_name, "source"))
+           {
+             fts_set (fts, f, FTS_SKIP);
+             continue;
+           }
+
          switch (f->fts_info)
            {
            case FTS_F:
@@ -682,6 +691,15 @@ dwfl_linux_kernel_find_elf (Dwfl_Module *mod,
   int error = ENOENT;
   while ((f = fts_read (fts)) != NULL)
     {
+      /* Skip a "source" subtree, which tends to be large.
+        This insane hard-coding of names is what depmod does too.  */
+      if (f->fts_namelen == sizeof "source" - 1
+         && !strcmp (f->fts_name, "source"))
+       {
+         fts_set (fts, f, FTS_SKIP);
+         continue;
+       }
+
       error = ENOENT;
       switch (f->fts_info)
        {