summaryrefslogtreecommitdiffstats
path: root/main/util-linux/util-linux-posix.patch
blob: 3fd93cd0a69dbbad80bc823d52db9eaeed6f78ed (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
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 <stdlib.h>
 #include <termios.h>
 #include <limits.h>
+#include "ttydefaults.h"
 #ifdef HAVE_SYS_IOCTL_H
 #include <sys/ioctl.h>
 #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 <linux/unistd.h>
 #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 <sys/types.h>
+#include <sys/param.h>
 #include <sys/uio.h>
 #include <signal.h>
 #include <fcntl.h>
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 <sys/types.h>
 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 <sys/ioctl.h>
 #endif
-#include <sys/termios.h>
+#include <termios.h>
 #include <fcntl.h>
 #include <regex.h>
 #include <stdio.h>