From fca475f1366bb36175137b032cd71786f155701d Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Fri, 16 Jan 2015 19:14:07 +0100 Subject: [PATCH] Remove device sorting to keep the original order --- cmdline/unix.c | 25 ------------------------- 1 file changed, 25 deletions(-) diff --git a/cmdline/unix.c b/cmdline/unix.c index 3fde6c95..291c1125 100644 --- a/cmdline/unix.c +++ b/cmdline/unix.c @@ -734,22 +734,6 @@ static int devdown(dev_t device) } #endif -/** - * Compare two device entries. - */ -static int devcompare(const void* void_a, const void* void_b) -{ - const devinfo_t* a = void_a; - const devinfo_t* b = void_b; - - if (a->device < b->device) - return -1; - if (a->device > b->device) - return 1; - - return strcmp(a->mount, b->mount); -} - /** * Spin up a device. * @@ -979,15 +963,6 @@ int devquery(tommy_list* high, tommy_list* low, int operation) } } - /* sort the high */ - tommy_list_sort(low, devcompare); - - /* removes duplicates */ - for (i = tommy_list_head(low); i != 0; i = i->next) { - while (i->next != 0 && devcompare(i->data, i->next->data) == 0) - free(tommy_list_remove_existing(low, i->next)); - } - #if HAVE_LINUX_DEVICE /* add other devices */ if (operation == DEVICE_SMART) {