patch-fdisks_fdisksunlabel_c 1.1 KB

123456789101112131415161718192021222324252627282930
  1. patch taken from sabotage linux -- https://github.com/rofl0r/sabotage
  2. --- util-linux-2.23.2.orig/fdisks/fdisksunlabel.c 2013-07-30 10:39:26.000000000 +0200
  3. +++ util-linux-2.23.2/fdisks/fdisksunlabel.c 2013-08-14 12:38:12.000000000 +0200
  4. @@ -383,9 +383,11 @@ static void fetch_sun(struct fdisk_conte
  5. }
  6. }
  7. -static int verify_sun_cmp(int *a, int *b, void *data)
  8. +static void* cmp_data;
  9. +static int verify_sun_cmp(const void *pa, const void *pb)
  10. {
  11. - unsigned int *verify_sun_starts = (unsigned int *) data;
  12. + const int *a = pa, *b = pb;
  13. + unsigned int *verify_sun_starts = (unsigned int *) cmp_data;
  14. if (*a == -1)
  15. return 1;
  16. @@ -449,9 +451,8 @@ static int sun_verify_disklabel(struct f
  17. else
  18. array[i] = -1;
  19. }
  20. - qsort_r(array,ARRAY_SIZE(array),sizeof(array[0]),
  21. - (int (*)(const void *,const void *,void *)) verify_sun_cmp,
  22. - verify_sun_starts);
  23. + cmp_data = verify_sun_starts;
  24. + qsort(array,ARRAY_SIZE(array),sizeof(array[0]), verify_sun_cmp);
  25. if (array[0] == -1) {
  26. fdisk_info(cxt, _("No partitions defined"));