]> git.pld-linux.org Git - packages/util-linux.git/blob - util-linux-diet.patch
- copied from util-linux-ng
[packages/util-linux.git] / util-linux-diet.patch
1 --- util-linux-ng-2.18/shlibs/mount/src/fs.c~   2010-06-08 10:44:20.000000000 +0200
2 +++ util-linux-ng-2.18/shlibs/mount/src/fs.c    2010-08-26 11:12:31.326572794 +0200
3 @@ -17,6 +17,9 @@
4  #include <errno.h>
5  #include <blkid.h>
6  #include <stddef.h>
7 +#ifdef __dietlibc__
8 +#include <sys/stat.h> /* for major and minor macros */
9 +#endif
10  
11  #include "nls.h"
12  #include "mountP.h"
13 --- util-linux-ng-2.18/shlibs/mount/src/tab_parse.c~    2010-06-07 12:35:06.000000000 +0200
14 +++ util-linux-ng-2.18/shlibs/mount/src/tab_parse.c     2010-08-26 11:16:35.762572782 +0200
15 @@ -9,6 +9,9 @@
16  #include <dirent.h>
17  #include <fcntl.h>
18  #include <unistd.h>
19 +#ifdef __dietlibc__
20 +#include <sys/stat.h> /* for makedev macro */
21 +#endif
22  
23  #include "nls.h"
24  #include "mangle.h"
25 --- util-linux-ng-2.18/lib/tt.c~        2010-06-07 11:44:06.000000000 +0200
26 +++ util-linux-ng-2.18/lib/tt.c 2010-08-26 11:32:34.886572774 +0200
27 @@ -54,7 +54,7 @@
28  };
29  
30  #else /* !HAVE_WIDECHAR */
31 -# define mbs_width       strlen(_s)
32 +# define mbs_width(_s) strlen(_s)
33  #endif /* !HAVE_WIDECHAR */
34  
35  #define is_last_column(_tb, _cl) \
36 --- util-linux-2.19/lib/strutils.c~     2011-01-31 16:43:47.000000000 +0100
37 +++ util-linux-2.19/lib/strutils.c      2011-02-10 12:49:12.221843465 +0100
38 @@ -12,6 +12,9 @@
39  #include <sys/stat.h>
40  #include <locale.h>
41  #include <string.h>
42 +#ifdef __dietlibc__
43 +#include <stdint.h>
44 +#endif
45  
46  static int do_scale_by_power (uintmax_t *x, int base, int power)
47  {
48 --- util-linux-2.19/shlibs/mount/src/utils.c~   2011-01-24 23:46:29.000000000 +0100
49 +++ util-linux-2.19/shlibs/mount/src/utils.c    2011-02-10 20:12:00.499611392 +0100
50 @@ -398,7 +398,11 @@
51         int rc = -1;
52          struct passwd pwd;
53         struct passwd *pw;
54 +#ifdef _SC_GETPW_R_SIZE_MAX
55         size_t sz = sysconf(_SC_GETPW_R_SIZE_MAX);
56 +#else
57 +       size_t sz = 0;
58 +#endif
59         char *buf;
60  
61         if (!username || !uid)
62 @@ -427,7 +431,11 @@
63         int rc = -1;
64          struct group grp;
65         struct group *gr;
66 +#ifdef _SC_GETGR_R_SIZE_MAX
67         size_t sz = sysconf(_SC_GETGR_R_SIZE_MAX);
68 +#else
69 +       size_t sz = 0;
70 +#endif
71         char *buf;
72  
73         if (!groupname || !gid)
74 --- util-linux-2.19/shlibs/mount/src/tab_update.c~      2011-02-09 14:23:48.000000000 +0100
75 +++ util-linux-2.19/shlibs/mount/src/tab_update.c       2011-02-10 20:26:15.846797059 +0100
76 @@ -610,8 +610,14 @@
77  
78         DBG(UPDATE, mnt_debug("%s: locking", lfile));
79  
80 -       fd = open(lfile, O_RDONLY|O_CREAT|O_CLOEXEC, S_IWUSR|
81 -                                                    S_IRUSR|S_IRGRP|S_IROTH);
82 +       fd = open(lfile,
83 +#ifdef O_CLOEXEC
84 +               O_RDONLY|O_CREAT|O_CLOEXEC,
85 +#else
86 +               O_RDONLY|O_CREAT,
87 +#endif
88 +               S_IWUSR|S_IRUSR|S_IRGRP|S_IROTH);
89 +
90         free(lfile);
91  
92         if (fd < 0)
93 --- util-linux-2.19/lib/at.c~   2011-01-31 16:43:47.000000000 +0100
94 +++ util-linux-2.19/lib/at.c    2011-02-10 20:30:37.336797058 +0100
95 @@ -7,6 +7,7 @@
96  #include <stdlib.h>
97  #include <fcntl.h>
98  #include <sys/stat.h>
99 +#include <limits.h>
100  
101  #include "at.h"
102  
103 --- util-linux-2.19/shlibs/mount/src/utils.c~   2011-02-10 20:32:07.906797058 +0100
104 +++ util-linux-2.19/shlibs/mount/src/utils.c    2011-02-10 20:49:24.336797058 +0100
105 @@ -664,7 +664,15 @@
106         if (rc <= 0)
107                 return -errno;
108  
109 +#ifndef HAVE_MKOSTEMP
110 +       if ( mktemp( n ) == NULL ) {
111 +               free(n);
112 +               return -errno;
113 +       }
114 +       fd = open(n, flags | O_EXCL);
115 +#else
116         fd = mkostemp(n, flags | O_EXCL);
117 +#endif
118         if (fd >= 0 && name)
119                 *name = n;
120         else
121 --- util-linux-2.19/misc-utils/findmnt.c~       2011-01-31 16:43:47.000000000 +0100
122 +++ util-linux-2.19/misc-utils/findmnt.c        2011-02-10 20:54:23.100130391 +0100
123 @@ -30,6 +30,9 @@
124  #include <sys/ioctl.h>
125  #endif
126  #include <assert.h>
127 +#ifdef __dietlibc__
128 +#include <sys/stat.h> /* for major and minor macros */
129 +#endif
130  
131  #define USE_UNSTABLE_LIBMOUNT_API
132  #include <libmount.h>
133 --- util-linux-2.19/fsck/fsck.c~        2011-02-07 16:19:29.000000000 +0100
134 +++ util-linux-2.19/fsck/fsck.c 2011-02-10 21:09:27.024658725 +0100
135 @@ -270,7 +270,13 @@
136         if (verbose)
137                 printf(_("Locking disk %s ... "), diskname);
138  
139 -       inst->lock = open(diskname, O_CLOEXEC | O_RDONLY);
140 +       inst->lock = open(diskname,
141 +#ifdef O_CLOEXEC
142 +                       O_CLOEXEC | O_RDONLY
143 +#else
144 +                       O_RDONLY
145 +#endif
146 +                       );
147         if (inst->lock >= 0) {
148                 int rc = -1;
149  
150 --- util-linux-2.19/configure.ac~       2011-02-10 21:28:23.395401725 +0100
151 +++ util-linux-2.19/configure.ac        2011-02-10 22:12:29.997898392 +0100
152 @@ -188,6 +188,8 @@
153         lchown \
154         llseek \
155         lseek64 \
156 +       mkostemp \
157 +       versionsort \
158         strtoull \
159         sysconf \
160         getdtablesize \
161 --- util-linux-2.19/misc-utils/findfs.c~        2011-01-31 16:43:47.000000000 +0100
162 +++ util-linux-2.19/misc-utils/findfs.c 2011-02-10 22:24:39.615735924 +0100
163 @@ -12,6 +12,7 @@
164  
165  #include <blkid.h>
166  
167 +#include "c.h"
168  #include "nls.h"
169  
170  static void __attribute__((__noreturn__)) usage(int rc)
171 --- util-linux-2.19/misc-utils/scriptreplay.c~  2011-01-31 16:43:47.000000000 +0100
172 +++ util-linux-2.19/misc-utils/scriptreplay.c   2011-02-10 22:26:22.019069258 +0100
173 @@ -28,6 +28,7 @@
174  #include <unistd.h>
175  #include <err.h>
176  
177 +#include "c.h"
178  #include "nls.h"
179  
180  #define SCRIPT_MIN_DELAY 0.0001                /* from original sripreplay.pl */
181 --- util-linux-2.19/shlibs/mount/src/tab_parse.c~       2011-02-10 23:28:02.091461025 +0100
182 +++ util-linux-2.19/shlibs/mount/src/tab_parse.c        2011-02-10 23:29:04.934794359 +0100
183 @@ -422,7 +422,13 @@
184  
185         /* TODO: it would be nice to have a scandir() implementaion that
186          *       is able to use already opened directory */
187 -       n = scandir(dirname, &namelist, NULL, versionsort);
188 +       n = scandir(dirname, &namelist, NULL,
189 +#ifdef HAVE_VERSIONSORT
190 +                       versionsort
191 +#else
192 +                       alphasort
193 +#endif
194 +                       );
195         if (n <= 0)
196                 return 0;
197  
This page took 0.05971 seconds and 4 git commands to generate.