Changeset View
Changeset View
Standalone View
Standalone View
usr.sbin/kldxref/kldxref.c
Show First 20 Lines • Show All 679 Lines • ▼ Show 20 Lines | compare(const FTSENT *const *a, const FTSENT *const *b) | ||||
return (strcmp((*a)->fts_name, (*b)->fts_name)); | return (strcmp((*a)->fts_name, (*b)->fts_name)); | ||||
} | } | ||||
int | int | ||||
main(int argc, char *argv[]) | main(int argc, char *argv[]) | ||||
{ | { | ||||
FTS *ftsp; | FTS *ftsp; | ||||
FTSENT *p; | FTSENT *p; | ||||
char *dot = NULL; | |||||
int opt, fts_options, ival; | int opt, fts_options, ival; | ||||
struct stat sb; | struct stat sb; | ||||
fts_options = FTS_PHYSICAL; | fts_options = FTS_PHYSICAL; | ||||
while ((opt = getopt(argc, argv, "Rdf:v")) != -1) { | while ((opt = getopt(argc, argv, "Rdf:v")) != -1) { | ||||
switch (opt) { | switch (opt) { | ||||
case 'd': /* no hint file, only print on stdout */ | case 'd': /* no hint file, only print on stdout */ | ||||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | if (p->fts_info == FTS_D && !dflag) { | ||||
ftsp->fts_path, xref_file); | ftsp->fts_path, xref_file); | ||||
fxref = maketempfile(tempname, ftsp->fts_path); | fxref = maketempfile(tempname, ftsp->fts_path); | ||||
if (fxref == NULL) | if (fxref == NULL) | ||||
err(1, "can't create %s", tempname); | err(1, "can't create %s", tempname); | ||||
ival = 1; | ival = 1; | ||||
fwrite(&ival, sizeof(ival), 1, fxref); | fwrite(&ival, sizeof(ival), 1, fxref); | ||||
reccnt = 0; | reccnt = 0; | ||||
} | } | ||||
/* skip non-files and separate debug files */ | /* skip non-files.. */ | ||||
if (p->fts_info != FTS_F) | if (p->fts_info != FTS_F) | ||||
continue; | continue; | ||||
if (p->fts_namelen >= 6 && | /* and separate .debug, .symbol and .pkgsave files | ||||
strcmp(p->fts_name + p->fts_namelen - 6, ".debug") == 0) | by skipping all files with 2 dots */ | ||||
imp: This should be
```
/*
* Skip files that generate errors like .debug, .symbol and .pkgsave
*… | |||||
continue; | dot = strchr(p->fts_name, '.'); | ||||
if (p->fts_namelen >= 8 && | if (dot && strchr(dot+1, '.') != NULL) | ||||
Done Inline ActionsI think we can safely drop .symbols from this list, @emaste transitioned to .debug in 05117b57a54a -- surely enough time has passed that we can stop explicitly caring about or referencing them, hopefully... kevans: I think we can safely drop .symbols from this list, @emaste transitioned to .debug in… | |||||
strcmp(p->fts_name + p->fts_namelen - 8, ".symbols") == 0) | |||||
continue; | continue; | ||||
read_kld(p->fts_path, p->fts_name); | read_kld(p->fts_path, p->fts_name); | ||||
} | } | ||||
fts_close(ftsp); | fts_close(ftsp); | ||||
return (0); | return (0); | ||||
} | } |
This should be
since it's a multi-line comment.