From 12dd69f5ff95517037736f39104262d720d1edee Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Thu, 17 Apr 2003 21:55:38 -0400 Subject: [PATCH] e2fsck/rehash.c (name_cmp): Sort the deleted inodes to the end of the list, for portability to systems that whose qsort does not perform a stable sort. --- e2fsck/ChangeLog | 12 ++++++++++-- e2fsck/rehash.c | 2 +- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 60f0c66b..71693431 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,9 @@ +2003-04-17 Theodore Ts'o + + * rehash.c (name_cmp): Sort the deleted inodes to the end of the + list, for portability to systems that whose qsort does not + perform a stable sort. + 2003-04-16 Theodore Ts'o * unix.c: Bracket progress bar output with control-A and control-B @@ -6,7 +12,8 @@ progress bar. (PRS): Use setvbuf instead of setbuf to force stdout and stderr to be non-buffered when the stdout/stderr are a pipe. - This fixes a cosmetic problem when using e2fsck under logsave. + This fixes a cosmetic problem when using e2fsck under + logsave. 2003-04-12 Theodore Ts'o @@ -35,7 +42,8 @@ 2003-03-14 Theodore Ts'o - * problem.c, problem.h (PR_2_REPORT_DUP_DIRENT): Add new problem code. + * problem.c, problem.h (PR_2_REPORT_DUP_DIRENT): Add new problem + code. * pass2.c (check_dir_block): Check for duplicate filenames within a single directory block (because this is the easy case; diff --git a/e2fsck/rehash.c b/e2fsck/rehash.c index fbb206f2..81d4976c 100644 --- a/e2fsck/rehash.c +++ b/e2fsck/rehash.c @@ -175,7 +175,7 @@ static EXT2_QSORT_TYPE name_cmp(const void *a, const void *b) else if (he_a->dir->name_len < he_b->dir->name_len) ret = -1; else - ret = 0; + ret = he_b->dir->inode - he_a->dir->inode; } return ret; }