aboutsummaryrefslogtreecommitdiffstats
path: root/package/utils/util-linux
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-06-09 13:47:48 +0000
committerFelix Fietkau <nbd@openwrt.org>2014-06-09 13:47:48 +0000
commit1874a9e3de8799f38fcadc08d6ac30edbb9595bd (patch)
treea65bc4a80f5174ea4192da7620f14cca165274fe /package/utils/util-linux
parent4ebb5e22683b1e5f456ac08451fd58f16e435641 (diff)
downloadmaster-187ad058-1874a9e3de8799f38fcadc08d6ac30edbb9595bd.tar.gz
master-187ad058-1874a9e3de8799f38fcadc08d6ac30edbb9595bd.tar.bz2
master-187ad058-1874a9e3de8799f38fcadc08d6ac30edbb9595bd.zip
util-linux: use qsort instead of qsort_r to fix compile error with musl
Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@41059 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/utils/util-linux')
-rw-r--r--package/utils/util-linux/patches/100-fdisk_use_qsort.patch36
1 files changed, 36 insertions, 0 deletions
diff --git a/package/utils/util-linux/patches/100-fdisk_use_qsort.patch b/package/utils/util-linux/patches/100-fdisk_use_qsort.patch
new file mode 100644
index 0000000000..5ed4806a29
--- /dev/null
+++ b/package/utils/util-linux/patches/100-fdisk_use_qsort.patch
@@ -0,0 +1,36 @@
+--- a/libfdisk/src/sun.c
++++ b/libfdisk/src/sun.c
+@@ -361,10 +361,10 @@ static void fetch_sun(struct fdisk_conte
+ }
+ }
+
+-static int verify_sun_cmp(int *a, int *b, void *data)
+-{
+- unsigned int *verify_sun_starts = (unsigned int *) data;
++static unsigned int *verify_sun_starts;
+
++static int verify_sun_cmp(int *a, int *b)
++{
+ if (*a == -1)
+ return 1;
+ if (*b == -1)
+@@ -379,7 +379,6 @@ static int sun_verify_disklabel(struct f
+ uint32_t starts[SUN_MAXPARTITIONS], lens[SUN_MAXPARTITIONS], start, stop;
+ uint32_t i,j,k,starto,endo;
+ int array[SUN_MAXPARTITIONS];
+- unsigned int *verify_sun_starts;
+
+ assert(cxt);
+ assert(cxt->label);
+@@ -427,9 +426,8 @@ static int sun_verify_disklabel(struct f
+ else
+ array[i] = -1;
+ }
+- qsort_r(array,ARRAY_SIZE(array),sizeof(array[0]),
+- (int (*)(const void *,const void *,void *)) verify_sun_cmp,
+- verify_sun_starts);
++ qsort(array,ARRAY_SIZE(array),sizeof(array[0]),
++ (int (*)(const void *,const void *)) verify_sun_cmp);
+
+ if (array[0] == -1) {
+ fdisk_info(cxt, _("No partitions defined."));