summaryrefslogtreecommitdiff
path: root/package/util-linux/patches/patch-fdisks_fdisksunlabel_c
blob: 35851b9b6365792edd6b55da9f0810dd97021d66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
patch taken from sabotage linux -- https://github.com/rofl0r/sabotage

--- util-linux-2.23.2.orig/fdisks/fdisksunlabel.c	2013-07-30 10:39:26.000000000 +0200
+++ util-linux-2.23.2/fdisks/fdisksunlabel.c	2013-08-14 12:38:12.000000000 +0200
@@ -383,9 +383,11 @@ static void fetch_sun(struct fdisk_conte
 	}
 }
 
-static int verify_sun_cmp(int *a, int *b, void *data)
+static void* cmp_data;
+static int verify_sun_cmp(const void *pa, const void *pb)
 {
-    unsigned int *verify_sun_starts = (unsigned int *) data;
+    const int *a = pa, *b = pb;
+    unsigned int *verify_sun_starts = (unsigned int *) cmp_data;	
 
     if (*a == -1)
 	    return 1;
@@ -449,9 +451,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);
+    cmp_data = verify_sun_starts;
+    qsort(array,ARRAY_SIZE(array),sizeof(array[0]), verify_sun_cmp);
 
     if (array[0] == -1) {
 	fdisk_info(cxt, _("No partitions defined"));