patch taken from sabotage linux -- https://github.com/rofl0r/sabotage diff -aur util-linux-2.23.1.org/fdisks/cfdisk.c util-linux-2.23.1/fdisks/cfdisk.c --- util-linux-2.23.1.org/fdisks/cfdisk.c 2013-07-01 21:37:58.508000002 +0000 +++ util-linux-2.23.1/fdisks/cfdisk.c 2013-07-01 22:00:23.042000002 +0000 @@ -325,7 +325,7 @@ int logical = 0; long long logical_sectors[MAXIMUM_PARTS]; -__sighandler_t old_SIGINT, old_SIGTERM; +sighandler_t old_SIGINT, old_SIGTERM; int arrow_cursor = FALSE; int display_units = MEGABYTES; diff -aur util-linux-2.23.1.org/fdisks/fdisksunlabel.c util-linux-2.23.1/fdisks/fdisksunlabel.c --- util-linux-2.23.1.org/fdisks/fdisksunlabel.c 2013-07-01 21:37:58.508000002 +0000 +++ util-linux-2.23.1/fdisks/fdisksunlabel.c 2013-07-01 21:59:43.721000002 +0000 @@ -383,9 +383,11 @@ } } -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 @@ 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")); diff -aur util-linux-2.23.1.org/include/ttyutils.h util-linux-2.23.1/include/ttyutils.h --- util-linux-2.23.1.org/include/ttyutils.h 2013-07-01 21:37:58.433000002 +0000 +++ util-linux-2.23.1/include/ttyutils.h 2013-07-01 21:48:42.328000002 +0000 @@ -10,6 +10,7 @@ #include #include #include +#include "ttydefaults.h" #ifdef HAVE_SYS_IOCTL_H #include #endif diff -aur util-linux-2.23.1.org/term-utils/setterm.c util-linux-2.23.1/term-utils/setterm.c --- util-linux-2.23.1.org/term-utils/setterm.c 2013-07-01 21:37:58.442000002 +0000 +++ util-linux-2.23.1/term-utils/setterm.c 2013-07-01 22:02:54.244000002 +0000 @@ -123,7 +123,7 @@ #include "nls.h" #include "closestream.h" -#if __GNU_LIBRARY__ < 5 +#if defined(__GLIBC__) && __GNU_LIBRARY__ < 5 #ifndef __alpha__ # include #define __NR_klogctl __NR_syslog diff -aur util-linux-2.23.1.org/term-utils/ttymsg.c util-linux-2.23.1/term-utils/ttymsg.c --- util-linux-2.23.1.org/term-utils/ttymsg.c 2013-07-01 21:37:58.442000002 +0000 +++ util-linux-2.23.1/term-utils/ttymsg.c 2013-07-01 22:07:02.788000002 +0000 @@ -41,6 +41,7 @@ */ #include +#include #include #include #include diff -aur util-linux-2.23.1.org/text-utils/hexdump.h util-linux-2.23.1/text-utils/hexdump.h --- util-linux-2.23.1.org/text-utils/hexdump.h 2013-07-01 21:37:58.437000002 +0000 +++ util-linux-2.23.1/text-utils/hexdump.h 2013-07-01 22:01:27.005000002 +0000 @@ -32,7 +32,7 @@ * * @(#)hexdump.h 5.4 (Berkeley) 6/1/90 */ - +#include typedef struct _pr { struct _pr *nextpr; /* next print unit */ #define F_ADDRESS 0x001 /* print offset */ diff -aur util-linux-2.23.1.org/text-utils/pg.c util-linux-2.23.1/text-utils/pg.c --- util-linux-2.23.1.org/text-utils/pg.c 2013-07-01 21:37:58.437000002 +0000 +++ util-linux-2.23.1/text-utils/pg.c 2013-07-01 22:01:55.831000002 +0000 @@ -37,7 +37,7 @@ #ifndef TIOCGWINSZ # include #endif -#include +#include #include #include #include