From: Roland McGrath Date: Fri, 9 Jan 2009 04:53:26 +0000 (-0800) Subject: Make -k/-K prune "source" subdirectory. X-Git-Tag: elfutils-0.139~31 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a4b1a95434b90ed147e33363d92e24a035b6b775;p=thirdparty%2Felfutils.git Make -k/-K prune "source" subdirectory. --- diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index 0e3768628..2ddfc3afa 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -1,3 +1,9 @@ +2009-01-08 Roland McGrath + + * linux-kernel-modules.c (dwfl_linux_kernel_report_offline): + Skip subdirectory named "source". + (dwfl_linux_kernel_find_elf): Likewise. + 2009-01-06 Roland McGrath * linux-kernel-modules.c (check_suffix): New function. diff --git a/libdwfl/linux-kernel-modules.c b/libdwfl/linux-kernel-modules.c index 753e9bc91..e07073cdf 100644 --- a/libdwfl/linux-kernel-modules.c +++ b/libdwfl/linux-kernel-modules.c @@ -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) {