]> git.pld-linux.org Git - packages/systemd.git/blame - udev-uClibc.patch
- rel 2; leave floppy creation for core udev rules
[packages/systemd.git] / udev-uClibc.patch
CommitLineData
5341464c
JR
1diff -ur udev-150/extras/ata_id/ata_id.c udev-150-uclibc/extras/ata_id/ata_id.c
2--- udev-150/extras/ata_id/ata_id.c 2009-12-08 18:43:09.000000000 +0100
3+++ udev-150-uclibc/extras/ata_id/ata_id.c 2010-01-19 17:10:19.000000000 +0100
4@@ -168,7 +168,11 @@
5 uint16_t *p;
6
7 p = (uint16_t *) identify;
8+#ifdef __UCLIBC__
9+ p[offset_words] = __le16_to_cpu (p[offset_words]);
10+#else
11 p[offset_words] = le16toh (p[offset_words]);
12+#endif
13 }
14
15 /**
16diff -ur udev-150/udev/udevadm-info.c udev-150-uclibc/udev/udevadm-info.c
17--- udev-150/udev/udevadm-info.c 2009-12-24 20:40:34.000000000 +0100
18+++ udev-150-uclibc/udev/udevadm-info.c 2010-01-19 17:47:00.000000000 +0100
feda1938
JR
19@@ -200,8 +200,14 @@
20 return 0;
21 }
22
5341464c 23+#ifdef __UCLIBC__
feda1938
JR
24+static void cleanup_dir(DIR *dir, char *dirname, mode_t mask, int depth)
25+{
446024fe 26+ char filename[UTIL_PATH_SIZE];
feda1938
JR
27+#else
28 static void cleanup_dir(DIR *dir, mode_t mask, int depth)
29 {
5341464c 30+#endif
feda1938 31 struct dirent *dent;
5341464c 32
446024fe 33 if (depth <= 0)
446024fe 34@@ -212,7 +215,12 @@
5341464c 35
446024fe
JR
36 if (dent->d_name[0] == '.')
37 continue;
5341464c 38+#ifdef __UCLIBC__
feda1938
JR
39+ util_strscpyl(filename, sizeof(filename), dirname, "/", dent->d_name, NULL);
40+ if (lstat(filename, &stats) != 0)
5341464c 41+#else
446024fe 42 if (fstatat(dirfd(dir), dent->d_name, &stats, AT_SYMLINK_NOFOLLOW) != 0)
5341464c 43+#endif
446024fe
JR
44 continue;
45 if ((stats.st_mode & mask) != 0)
46 continue;
feda1938
JR
47@@ -229,7 +232,11 @@
48
49 dir2 = fdopendir(openat(dirfd(dir), dent->d_name, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC));
50 if (dir2 != NULL) {
51+#ifdef __UCLIBC__
52+ cleanup_dir(dir2, filename, mask, depth-1);
53+#else
54 cleanup_dir(dir2, mask, depth-1);
55+#endif
56 closedir(dir2);
57 }
58 unlinkat(dirfd(dir), dent->d_name, AT_REMOVEDIR);
59@@ -250,35 +257,55 @@
60 util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/data", NULL);
61 dir = opendir(filename);
62 if (dir != NULL) {
63+#ifdef __UCLIBC__
64+ cleanup_dir(dir, filename, S_ISVTX, 1);
65+#else
66 cleanup_dir(dir, S_ISVTX, 1);
67+#endif
68 closedir(dir);
69 }
70
71 util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/links", NULL);
72 dir = opendir(filename);
73 if (dir != NULL) {
74+#ifdef __UCLIBC__
75+ cleanup_dir(dir, filename, 0, 2);
76+#else
77 cleanup_dir(dir, 0, 2);
78+#endif
79 closedir(dir);
80 }
81
82 util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/tags", NULL);
83 dir = opendir(filename);
84 if (dir != NULL) {
85+#ifdef __UCLIBC__
86+ cleanup_dir(dir, filename, 0, 2);
87+#else
88 cleanup_dir(dir, 0, 2);
89+#endif
90 closedir(dir);
91 }
92
93 util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/watch", NULL);
94 dir = opendir(filename);
95 if (dir != NULL) {
96+#ifdef __UCLIBC__
97+ cleanup_dir(dir, filename, 0, 1);
98+#else
99 cleanup_dir(dir, 0, 1);
100+#endif
101 closedir(dir);
102 }
103
104 util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/firmware-missing", NULL);
105 dir = opendir(filename);
106 if (dir != NULL) {
107+#ifdef __UCLIBC__
108+ cleanup_dir(dir, filename, 0, 1);
109+#else
110 cleanup_dir(dir, 0, 1);
111+#endif
112 closedir(dir);
113 }
114 }
115--- udev-168/udev/udev-event.c.orig 2011-04-21 14:05:13.000000000 +0200
116+++ udev-168/udev/udev-event.c 2011-04-26 01:09:16.813273489 +0200
117@@ -508,12 +508,19 @@
118 if (fd_stdout < 0 && fd_stderr < 0)
119 return 0;
120
121+#ifdef __UCLIBC__
122+ fd_ep = epoll_create(1);
123+#else
124 fd_ep = epoll_create1(EPOLL_CLOEXEC);
125+#endif
126 if (fd_ep < 0) {
127 err = -errno;
128 err(udev, "error creating epoll fd: %m\n");
129 goto out;
130 }
131+#ifdef __UCLIBC__
132+ fcntl(fd_ep, F_SETFD, FD_CLOEXEC);
133+#endif
134
135 if (fd_stdout >= 0) {
136 memset(&ep_outpipe, 0, sizeof(struct epoll_event));
137@@ -698,9 +698,11 @@
138 } else if (WIFSTOPPED(status)) {
139 err(udev, "'%s' [%u] stopped\n", cmd, pid);
140 err = -1;
141+#ifdef WIFCONTINUED
142 } else if (WIFCONTINUED(status)) {
143 err(udev, "'%s' [%u] continued\n", cmd, pid);
144 err = -1;
145+#endif
146 } else {
147 err(udev, "'%s' [%u] exit with status 0x%04x\n", cmd, pid, status);
148 err = -1;
149@@ -759,18 +759,34 @@
150
151 /* pipes from child to parent */
152 if (result != NULL || udev_get_log_priority(udev) >= LOG_INFO) {
153+#ifdef __UCLIBC__
154+ if (pipe(outpipe) != 0) {
155+#else
156 if (pipe2(outpipe, O_NONBLOCK) != 0) {
157+#endif
158 err = -errno;
159 err(udev, "pipe failed: %m\n");
160 goto out;
161 }
162+#ifdef __UCLIBC__
163+ fcntl(outpipe[0], F_SETFL, O_NONBLOCK);
164+ fcntl(outpipe[1], F_SETFL, O_NONBLOCK);
165+#endif
166 }
167 if (udev_get_log_priority(udev) >= LOG_INFO) {
168+#ifdef __UCLIBC__
169+ if (pipe(errpipe) != 0) {
170+#else
171 if (pipe2(errpipe, O_NONBLOCK) != 0) {
172+#endif
173 err = -errno;
174 err(udev, "pipe failed: %m\n");
175 goto out;
176 }
177+#ifdef __UCLIBC__
178+ fcntl(errpipe[0], F_SETFL, O_NONBLOCK);
179+ fcntl(errpipe[1], F_SETFL, O_NONBLOCK);
180+#endif
181 }
182
183 /* allow programs in /lib/udev/ to be called without the path */
184--- udev-168/udev/udevd.c.orig 2011-04-21 14:05:13.000000000 +0200
185+++ udev-168/udev/udevd.c 2011-04-26 01:13:39.984103209 +0200
186@@ -256,12 +256,19 @@
187 goto out;
188 }
189
190+#ifdef __UCLIBC__
191+ fd_ep = epoll_create(1);
192+#else
193 fd_ep = epoll_create1(EPOLL_CLOEXEC);
194+#endif
195 if (fd_ep < 0) {
196 err(udev, "error creating epoll fd: %m\n");
197 rc = 3;
198 goto out;
199 }
200+#ifdef __UCLIBC__
201+ fcntl(fd_ep, F_SETFD, FD_CLOEXEC);
202+#endif
203
204 memset(&ep_signal, 0, sizeof(struct epoll_event));
205 ep_signal.events = EPOLLIN;
206@@ -826,8 +826,10 @@
207 pid, WTERMSIG(status), strsignal(WTERMSIG(status)));
208 } else if (WIFSTOPPED(status)) {
209 err(udev, "worker [%u] stopped\n", pid);
210+#ifdef WIFCONTINUED
211 } else if (WIFCONTINUED(status)) {
212 err(udev, "worker [%u] continued\n", pid);
213+#endif
214 } else {
215 err(udev, "worker [%u] exit with status 0x%04x\n", pid, status);
216 }
217@@ -1547,11 +1554,18 @@
218 ep_worker.events = EPOLLIN;
219 ep_worker.data.fd = fd_worker;
220
221+#ifdef __UCLIBC__
222+ fd_ep = epoll_create(1);
223+#else
224 fd_ep = epoll_create1(EPOLL_CLOEXEC);
225+#endif
226 if (fd_ep < 0) {
227 err(udev, "error creating epoll fd: %m\n");
228 goto exit;
229 }
230+#ifdef __UCLIBC__
231+ fcntl(fd_ep, F_SETFD, FD_CLOEXEC);
232+#endif
233 if (epoll_ctl(fd_ep, EPOLL_CTL_ADD, fd_ctrl, &ep_ctrl) < 0 ||
234 epoll_ctl(fd_ep, EPOLL_CTL_ADD, fd_inotify, &ep_inotify) < 0 ||
235 epoll_ctl(fd_ep, EPOLL_CTL_ADD, fd_signal, &ep_signal) < 0 ||
236--- udev-168/libudev/libudev-ctrl.c.orig 2011-04-26 01:20:36.150103207 +0200
237+++ udev-168/libudev/libudev-ctrl.c 2011-04-26 01:21:48.940103224 +0200
238@@ -15,6 +15,7 @@
239 #include <stddef.h>
240 #include <string.h>
241 #include <unistd.h>
242+#include <fcntl.h>
243 #include <sys/types.h>
244 #include <sys/poll.h>
245 #include <sys/socket.h>
606aa3b0 246@@ -187,13 +187,22 @@
feda1938
JR
247 conn->refcount = 1;
248 conn->uctrl = uctrl;
249
250+#ifdef __UCLIBC__
251+ conn->sock = accept(uctrl->sock, NULL, NULL);
252+#else
77a3f50d 253 conn->sock = accept4(uctrl->sock, NULL, NULL, SOCK_CLOEXEC|SOCK_NONBLOCK);
feda1938
JR
254+#endif
255 if (conn->sock < 0) {
77a3f50d
AM
256 if (errno != EINTR)
257 err(uctrl->udev, "unable to receive ctrl connection: %m\n");
606aa3b0 258 goto err;
feda1938 259 }
606aa3b0 260
feda1938
JR
261+#ifdef __UCLIBC__
262+ fcntl(conn->sock, F_SETFD, FD_CLOEXEC);
77a3f50d 263+ fcntl(conn->sock, F_SETFL, O_NONBLOCK);
feda1938 264+#endif
606aa3b0
AM
265+
266 /* check peer credential of connection */
267 slen = sizeof(ucred);
268 if (getsockopt(conn->sock, SOL_SOCKET, SO_PEERCRED, &ucred, &slen) < 0) {
feda1938
JR
269--- udev-168/udev/udevadm-monitor.c.orig 2011-04-26 01:53:44.361103209 +0200
270+++ udev-168/udev/udevadm-monitor.c 2011-04-26 01:54:41.946103207 +0200
271@@ -157,11 +157,18 @@
272 sigaddset(&mask, SIGTERM);
273 sigprocmask(SIG_UNBLOCK, &mask, NULL);
274
275+#ifdef __UCLIBC__
276+ fd_ep = epoll_create(1);
277+#else
278 fd_ep = epoll_create1(EPOLL_CLOEXEC);
279+#endif
280 if (fd_ep < 0) {
281 err(udev, "error creating epoll fd: %m\n");
282 goto out;
283 }
284+#ifdef __UCLIBC__
285+ fcntl(fd_ep, F_SETFD, FD_CLOEXEC);
286+#endif
287
288 printf("monitor will print the received events for:\n");
289 if (print_udev) {
This page took 0.194472 seconds and 4 git commands to generate.