1 diff -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
7 p = (uint16_t *) identify;
9 + p[offset_words] = __le16_to_cpu (p[offset_words]);
11 p[offset_words] = le16toh (p[offset_words]);
16 diff -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
24 +static void cleanup_dir(DIR *dir, char *dirname, mode_t mask, int depth)
26 + char filename[UTIL_PATH_SIZE];
28 static void cleanup_dir(DIR *dir, mode_t mask, int depth)
36 if (dent->d_name[0] == '.')
39 + util_strscpyl(filename, sizeof(filename), dirname, "/", dent->d_name, NULL);
40 + if (lstat(filename, &stats) != 0)
42 if (fstatat(dirfd(dir), dent->d_name, &stats, AT_SYMLINK_NOFOLLOW) != 0)
45 if ((stats.st_mode & mask) != 0)
49 dir2 = fdopendir(openat(dirfd(dir), dent->d_name, O_RDONLY|O_NONBLOCK|O_DIRECTORY|O_CLOEXEC));
52 + cleanup_dir(dir2, filename, mask, depth-1);
54 cleanup_dir(dir2, mask, depth-1);
58 unlinkat(dirfd(dir), dent->d_name, AT_REMOVEDIR);
60 util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/data", NULL);
61 dir = opendir(filename);
64 + cleanup_dir(dir, filename, S_ISVTX, 1);
66 cleanup_dir(dir, S_ISVTX, 1);
71 util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/links", NULL);
72 dir = opendir(filename);
75 + cleanup_dir(dir, filename, 0, 2);
77 cleanup_dir(dir, 0, 2);
82 util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/tags", NULL);
83 dir = opendir(filename);
86 + cleanup_dir(dir, filename, 0, 2);
88 cleanup_dir(dir, 0, 2);
93 util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/watch", NULL);
94 dir = opendir(filename);
97 + cleanup_dir(dir, filename, 0, 1);
99 cleanup_dir(dir, 0, 1);
104 util_strscpyl(filename, sizeof(filename), udev_get_run_path(udev), "/firmware-missing", NULL);
105 dir = opendir(filename);
108 + cleanup_dir(dir, filename, 0, 1);
110 cleanup_dir(dir, 0, 1);
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)
122 + fd_ep = epoll_create(1);
124 fd_ep = epoll_create1(EPOLL_CLOEXEC);
128 err(udev, "error creating epoll fd: %m\n");
132 + fcntl(fd_ep, F_SETFD, FD_CLOEXEC);
135 if (fd_stdout >= 0) {
136 memset(&ep_outpipe, 0, sizeof(struct epoll_event));
138 } else if (WIFSTOPPED(status)) {
139 err(udev, "'%s' [%u] stopped\n", cmd, pid);
142 } else if (WIFCONTINUED(status)) {
143 err(udev, "'%s' [%u] continued\n", cmd, pid);
147 err(udev, "'%s' [%u] exit with status 0x%04x\n", cmd, pid, status);
149 @@ -759,18 +759,34 @@
151 /* pipes from child to parent */
152 if (result != NULL || udev_get_log_priority(udev) >= LOG_INFO) {
154 + if (pipe(outpipe) != 0) {
156 if (pipe2(outpipe, O_NONBLOCK) != 0) {
159 err(udev, "pipe failed: %m\n");
163 + fcntl(outpipe[0], F_SETFL, O_NONBLOCK);
164 + fcntl(outpipe[1], F_SETFL, O_NONBLOCK);
167 if (udev_get_log_priority(udev) >= LOG_INFO) {
169 + if (pipe(errpipe) != 0) {
171 if (pipe2(errpipe, O_NONBLOCK) != 0) {
174 err(udev, "pipe failed: %m\n");
178 + fcntl(errpipe[0], F_SETFL, O_NONBLOCK);
179 + fcntl(errpipe[1], F_SETFL, O_NONBLOCK);
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 @@
191 + fd_ep = epoll_create(1);
193 fd_ep = epoll_create1(EPOLL_CLOEXEC);
196 err(udev, "error creating epoll fd: %m\n");
201 + fcntl(fd_ep, F_SETFD, FD_CLOEXEC);
204 memset(&ep_signal, 0, sizeof(struct epoll_event));
205 ep_signal.events = EPOLLIN;
207 pid, WTERMSIG(status), strsignal(WTERMSIG(status)));
208 } else if (WIFSTOPPED(status)) {
209 err(udev, "worker [%u] stopped\n", pid);
211 } else if (WIFCONTINUED(status)) {
212 err(udev, "worker [%u] continued\n", pid);
215 err(udev, "worker [%u] exit with status 0x%04x\n", pid, status);
217 @@ -1547,11 +1554,18 @@
218 ep_worker.events = EPOLLIN;
219 ep_worker.data.fd = fd_worker;
222 + fd_ep = epoll_create(1);
224 fd_ep = epoll_create1(EPOLL_CLOEXEC);
227 err(udev, "error creating epoll fd: %m\n");
231 + fcntl(fd_ep, F_SETFD, FD_CLOEXEC);
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-172/udev/udev-ctrl.c.orig 2011-04-26 01:20:36.150103207 +0200
237 +++ udev-172/udev/udev-ctrl.c 2011-04-26 01:21:48.940103224 +0200
243 #include <sys/types.h>
244 #include <sys/poll.h>
245 #include <sys/socket.h>
246 @@ -187,13 +187,22 @@
251 + conn->sock = accept(uctrl->sock, NULL, NULL);
253 conn->sock = accept4(uctrl->sock, NULL, NULL, SOCK_CLOEXEC|SOCK_NONBLOCK);
255 if (conn->sock < 0) {
257 err(uctrl->udev, "unable to receive ctrl connection: %m\n");
262 + fcntl(conn->sock, F_SETFD, FD_CLOEXEC);
263 + fcntl(conn->sock, F_SETFL, O_NONBLOCK);
266 /* check peer credential of connection */
267 slen = sizeof(ucred);
268 if (getsockopt(conn->sock, SOL_SOCKET, SO_PEERCRED, &ucred, &slen) < 0) {
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);
276 + fd_ep = epoll_create(1);
278 fd_ep = epoll_create1(EPOLL_CLOEXEC);
281 err(udev, "error creating epoll fd: %m\n");
285 + fcntl(fd_ep, F_SETFD, FD_CLOEXEC);
288 printf("monitor will print the received events for:\n");