diff options
| author | Roland McGrath <[email protected]> | 2009-01-08 20:53:26 -0800 |
|---|---|---|
| committer | Roland McGrath <[email protected]> | 2009-01-08 20:53:26 -0800 |
| commit | a4b1a95434b90ed147e33363d92e24a035b6b775 (patch) | |
| tree | 83aabeae72d4777ba7a1c16e5a37d0c94cf365f3 /libdwfl/linux-kernel-modules.c | |
| parent | 7a647878b28ec3dee77c76cccc76330c1a05e58d (diff) | |
Make -k/-K prune "source" subdirectory.
Diffstat (limited to 'libdwfl/linux-kernel-modules.c')
| -rw-r--r-- | libdwfl/linux-kernel-modules.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libdwfl/linux-kernel-modules.c b/libdwfl/linux-kernel-modules.c index 753e9bc9..e07073cd 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) { |
