]> git.pld-linux.org Git - packages/util-linux.git/blame - util-linux-blk.patch
- use functions
[packages/util-linux.git] / util-linux-blk.patch
CommitLineData
d2741bb5
AM
1diff -urN util-linux-2.12q.org/disk-utils/blockdev.c util-linux-2.12q/disk-utils/blockdev.c
2--- util-linux-2.12q.org/disk-utils/blockdev.c 2004-08-18 19:52:20.000000000 +0200
3+++ util-linux-2.12q/disk-utils/blockdev.c 2005-02-27 19:35:19.000000000 +0100
4@@ -9,9 +9,14 @@
5 #include <string.h>
be265cc8 6 #include <unistd.h>
d2741bb5 7 #include <sys/ioctl.h>
be265cc8
MM
8+#include <linux/version.h>
9
d2741bb5 10 #include "nls.h"
440614a9 11
d2741bb5 12+#ifdef LIBC_HEADERS_VERSION
be265cc8
MM
13+/* Fixed headers detected */
14+#include <linux/fs.h>
15+#else
d2741bb5
AM
16 /* Since it is impossible to include <linux/fs.h>, let us
17 give the ioctls explicitly. */
18
19@@ -28,6 +33,7 @@
20 #define BLKBSZSET _IOW(0x12,113,size_t)
21 #define BLKGETSIZE64 _IOR(0x12,114,size_t)
22 #endif
be265cc8 23+#endif
440614a9 24
d2741bb5
AM
25 /* Maybe <linux/hdreg.h> could be included */
26 #ifndef HDIO_GETGEO
27diff -urN util-linux-2.12q.org/disk-utils/elvtune.c util-linux-2.12q/disk-utils/elvtune.c
28--- util-linux-2.12q.org/disk-utils/elvtune.c 2004-09-19 15:57:09.000000000 +0200
29+++ util-linux-2.12q/disk-utils/elvtune.c 2005-02-27 19:34:27.000000000 +0100
30@@ -29,6 +29,7 @@
be265cc8 31 #include <string.h>
be265cc8 32 #include <sys/ioctl.h>
d2741bb5 33 #include <sys/utsname.h>
be265cc8 34+#include <linux/version.h>
be265cc8
MM
35 #include "nls.h"
36
d2741bb5
AM
37 /* this has to match with the kernel structure */
38@@ -40,9 +41,14 @@
39 int max_bomb_segments;
40 } blkelv_ioctl_arg_t;
41
be265cc8
MM
42+#ifdef LIBC_HEADERS_VERSION
43+/* Fixed headers detected */
44+#include <linux/fs.h>
45+#else
d2741bb5
AM
46 /* ioctls introduced in 2.2.16, removed in 2.5.58 */
47 #define BLKELVGET _IOR(0x12,106,size_t)
48 #define BLKELVSET _IOW(0x12,107,size_t)
be265cc8 49+#endif
be265cc8 50
d2741bb5
AM
51 static void
52 usage(void) {
53diff -urN util-linux-2.12q.org/fdisk/common.h util-linux-2.12q/fdisk/common.h
54--- util-linux-2.12q.org/fdisk/common.h 2004-09-06 20:07:11.000000000 +0200
55+++ util-linux-2.12q/fdisk/common.h 2005-02-27 19:35:53.000000000 +0100
56@@ -3,11 +3,18 @@
57 /* including <linux/fs.h> fails */
58 #include <sys/types.h>
be265cc8
MM
59 #include <sys/ioctl.h>
60+#include <linux/version.h>
61+
62+#ifdef LIBC_HEADERS_VERSION
63+/* Fixed headers detected */
64+#include <linux/fs.h>
65+#else
66 #define BLKRRPART _IO(0x12,95) /* re-read partition table */
440614a9
JB
67 #define BLKGETSIZE _IO(0x12,96) /* return device size */
68 #define BLKFLSBUF _IO(0x12,97) /* flush buffer cache */
69 #define BLKSSZGET _IO(0x12,104) /* get block device sector size */
d2741bb5 70 #define BLKGETSIZE64 _IOR(0x12,114,size_t) /* size in bytes */
be265cc8 71+#endif
440614a9
JB
72
73 /* including <linux/hdreg.h> also fails */
74 struct hd_geometry {
This page took 0.052891 seconds and 4 git commands to generate.