summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-01-25 16:44:07 +0000
committerJim Meyering <jim@meyering.net>2003-01-25 16:44:07 +0000
commit431d1b624180925a9be02590d4c5af845b8e2fce (patch)
tree3ebc679e9ca181000e2d2794d979ba89b8f8e9b5 /lib
parent29faf21e9461eecd14cef2cd2d8e90f6aaab5cbf (diff)
downloadcoreutils-431d1b624180925a9be02590d4c5af845b8e2fce.tar.xz
(object_compare): Compare inode numbers before device numbers.
The former is much more likely to differ for any two given file objects.
Diffstat (limited to 'lib')
-rw-r--r--lib/ftw.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/ftw.c b/lib/ftw.c
index ef1e2a9d1..238691063 100644
--- a/lib/ftw.c
+++ b/lib/ftw.c
@@ -213,10 +213,10 @@ object_compare (const void *p1, const void *p2)
accidentally compare `holes' in the structure. */
const struct known_object *kp1 = p1, *kp2 = p2;
int cmp1;
- cmp1 = (kp1->dev > kp2->dev) - (kp1->dev < kp2->dev);
+ cmp1 = (kp1->ino > kp2->ino) - (kp1->ino < kp2->ino);
if (cmp1 != 0)
return cmp1;
- return (kp1->ino > kp2->ino) - (kp1->ino < kp2->ino);
+ return (kp1->dev > kp2->dev) - (kp1->dev < kp2->dev);
}