]> git.pld-linux.org Git - packages/util-linux.git/blob - util-linux-blk.patch
- TODO added
[packages/util-linux.git] / util-linux-blk.patch
1 --- util-linux-2.12/disk-utils/elvtune.c.orig   2002-03-08 23:57:49.000000000 +0100
2 +++ util-linux-2.12/disk-utils/elvtune.c        2004-02-23 23:07:41.428306200 +0100
3 @@ -27,6 +27,7 @@
4  #include <unistd.h>
5  #include <stdlib.h>
6  #include "nls.h"
7 +#include <linux/version.h>
8  
9  /* this has to match with the kernel structure */
10  /* current version for ac19 and 2.2.16 */
11 @@ -37,8 +38,13 @@
12         int max_bomb_segments;
13  } blkelv_ioctl_arg_t;
14  
15 -#define BLKELVGET   _IOR(0x12,106,sizeof(blkelv_ioctl_arg_t))
16 -#define BLKELVSET   _IOW(0x12,107,sizeof(blkelv_ioctl_arg_t))
17 +#ifdef LIBC_HEADERS_VERSION 
18 +/* Fixed headers detected */
19 +#include <linux/fs.h>
20 +#else
21 +#define BLKELVGET   _IOR(0x12,106,size_t) /* blkelv_ioctl_arg_t broken by sizeof */
22 +#define BLKELVSET   _IOW(0x12,107,size_t) /* blkelv_ioctl_arg_t broken by sizeof */
23 +#endif
24  
25  static void
26  usage(void) {
27 --- util-linux-2.12/disk-utils/blockdev.c.orig  2002-03-08 23:57:02.000000000 +0100
28 +++ util-linux-2.12/disk-utils/blockdev.c       2004-02-23 23:08:09.053106592 +0100
29 @@ -9,12 +9,14 @@
30  #include <string.h>
31  #include <unistd.h>
32  #include <sys/ioctl.h>
33 +#include <linux/version.h>
34  
35  #include "nls.h"
36  
37 -/* Since it is impossible to include <linux/fs.h>, let us
38 -   give the ioctls explicitly. */
39 -
40 +#ifdef LIBC_HEADERS_VERSION
41 +/* Fixed headers detected */
42 +#include <linux/fs.h>
43 +#else
44  #ifndef BLKROSET
45  #define BLKROSET   _IO(0x12,93)
46  #define BLKROGET   _IO(0x12,94)
47 @@ -24,8 +26,9 @@
48  #define BLKRASET   _IO(0x12,98)
49  #define BLKRAGET   _IO(0x12,99)
50  #define BLKSSZGET  _IO(0x12,104)
51 -#define BLKBSZGET  _IOR(0x12,112,sizeof(int))
52 -#define BLKBSZSET  _IOW(0x12,113,sizeof(int))
53 +#define BLKBSZGET  _IOR(0x12,112,size_t) /* int broken by sizeof */
54 +#define BLKBSZSET  _IOW(0x12,113,size_t) /* int broken by sizeof */
55 +#endif
56  #endif
57  
58  /* Maybe <linux/hdreg.h> could be included */
59 --- util-linux-2.12/fdisk/common.h.orig 2003-07-13 15:59:53.000000000 +0200
60 +++ util-linux-2.12/fdisk/common.h      2004-02-23 23:09:39.330382360 +0100
61 @@ -1,12 +1,18 @@
62  /* common stuff for fdisk, cfdisk, sfdisk */
63  
64 -/* including <linux/fs.h> fails */
65  #include <sys/ioctl.h>
66 +#include <linux/version.h>
67 +
68 +#ifdef LIBC_HEADERS_VERSION
69 +/* Fixed headers detected */
70 +#include <linux/fs.h>
71 +#else
72  #define BLKRRPART    _IO(0x12,95)    /* re-read partition table */
73  #define BLKGETSIZE   _IO(0x12,96)    /* return device size */
74  #define BLKFLSBUF    _IO(0x12,97)    /* flush buffer cache */
75  #define BLKSSZGET    _IO(0x12,104)   /* get block device sector size */
76 -#define BLKGETSIZE64 _IOR(0x12,114,8)  /* 8 = sizeof(u64) */
77 +#define BLKGETSIZE64 _IOR(0x12,114,size_t)     /* u64 broken by sizeof; NOT 8(==int)!!! */
78 +#endif
79  
80  /* including <linux/hdreg.h> also fails */
81  struct hd_geometry {
This page took 0.054236 seconds and 3 git commands to generate.