Magellan Linux

Contents of /trunk/systemd/patches/systemd-220-udevd-event-fix-event-queue-in-daemenozied-mode.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2587 - (show annotations) (download)
Thu Jun 18 13:12:27 2015 UTC (8 years, 10 months ago) by niro
File size: 1352 byte(s)
upstream fixes
1 From 040e689654ef08c63ab93bf0875865398e8d9c91 Mon Sep 17 00:00:00 2001
2 From: Tom Gundersen <teg@jklm.no>
3 Date: Sun, 24 May 2015 15:20:36 +0200
4 Subject: udevd: event - fix event queue in daemenozied mode
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 We would enforce that events could only be added to the queue from the
10 main process, but that brake in daemonized mode. Relax the restriction
11 to only allow one process to add events to the queue.
12
13 Reported by Mantas Mikulėnas.
14
15 diff --git a/src/udev/udevd.c b/src/udev/udevd.c
16 index 4a44b03..b33a262 100644
17 --- a/src/udev/udevd.c
18 +++ b/src/udev/udevd.c
19 @@ -564,7 +564,10 @@ static int event_queue_insert(Manager *manager, struct udev_device *dev) {
20 assert(manager);
21 assert(dev);
22
23 - /* only the main process can add events to the queue */
24 + /* only one process can add events to the queue */
25 + if (manager->pid == 0)
26 + manager->pid = getpid();
27 +
28 assert(manager->pid == getpid());
29
30 event = new0(struct event, 1);
31 @@ -1300,8 +1303,6 @@ static int manager_new(Manager **ret) {
32 if (!manager)
33 return log_oom();
34
35 - manager->pid = getpid();
36 -
37 manager->fd_ep = -1;
38 manager->fd_ctrl = -1;
39 manager->fd_uevent = -1;
40 --
41 cgit v0.10.2
42