diff options
Diffstat (limited to 'meta/recipes-kernel/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch')
-rw-r--r-- | meta/recipes-kernel/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/meta/recipes-kernel/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch b/meta/recipes-kernel/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch index ab1fe96db2..8bb4fc49ad 100644 --- a/meta/recipes-kernel/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch +++ b/meta/recipes-kernel/kexec/kexec-tools/kexec-tools-Refine-kdump-device_tree-sort.patch @@ -46,37 +46,3 @@ index 4121c7d..cc04b04 100644 return strcmp(str1, str2); } -diff --git a/kexec/fs2dt.c b/kexec/fs2dt.c -index 5e6b98d..1c0345b 100644 ---- a/kexec/fs2dt.c -+++ b/kexec/fs2dt.c -@@ -475,6 +475,9 @@ static int comparefunc(const struct dirent **dentry1, - { - char *str1 = (*(struct dirent **)dentry1)->d_name; - char *str2 = (*(struct dirent **)dentry2)->d_name; -+ char* ptr1 = strchr(str1, '@'); -+ char* ptr2 = strchr(str2, '@'); -+ int len1, len2; - - /* - * strcmp scans from left to right and fails to idetify for some -@@ -482,9 +485,13 @@ static int comparefunc(const struct dirent **dentry1, - * Therefore, we get the wrong sorted order like memory@10000000 and - * memory@f000000. - */ -- if (strchr(str1, '@') && strchr(str2, '@') && -- (strlen(str1) > strlen(str2))) -- return 1; -+ if (ptr1 && ptr2) { -+ len1 = ptr1 - str1; -+ len2 = ptr2 - str2; -+ if (!strncmp(str1, str2, len1 >len2 ? len1: len2) && -+ (strlen(str1) > strlen(str2))) -+ return 1; -+ } - - return strcmp(str1, str2); - } --- -1.7.9.5 - |