diff options
| author | Jilles Tjoelker <jilles@FreeBSD.org> | 2013-10-04 21:25:55 +0000 |
|---|---|---|
| committer | Jilles Tjoelker <jilles@FreeBSD.org> | 2013-10-04 21:25:55 +0000 |
| commit | 6d9cb20bd705f3810600b638a395650cad159961 (patch) | |
| tree | bccb7f641d67b3773c014c01fcbf9fe8df730659 /usr.sbin/kldxref/kldxref.c | |
| parent | c28c09c1f0419175a34c1e721fa3b08da3ec7469 (diff) | |
Notes
Diffstat (limited to 'usr.sbin/kldxref/kldxref.c')
| -rw-r--r-- | usr.sbin/kldxref/kldxref.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/usr.sbin/kldxref/kldxref.c b/usr.sbin/kldxref/kldxref.c index 16b9058d4d88..e74be96a521a 100644 --- a/usr.sbin/kldxref/kldxref.c +++ b/usr.sbin/kldxref/kldxref.c @@ -274,6 +274,16 @@ usage(void) exit(1); } +int +compare(const FTSENT *const *a, const FTSENT *const *b) +{ + if ((*a)->fts_info == FTS_D && (*b)->fts_info != FTS_D) + return 1; + if ((*a)->fts_info != FTS_D && (*b)->fts_info == FTS_D) + return -1; + return strcmp((*a)->fts_name, (*b)->fts_name); +} + int main(int argc, char *argv[]) { @@ -315,7 +325,7 @@ main(int argc, char *argv[]) err(1, "%s", argv[0]); } - ftsp = fts_open(argv, fts_options, 0); + ftsp = fts_open(argv, fts_options, compare); if (ftsp == NULL) exit(1); |
