]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: drop mostly unused Manager.pid
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 18 Jul 2023 18:16:38 +0000 (03:16 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 31 Jul 2023 14:23:00 +0000 (23:23 +0900)
It is only used by the assertion in event_queue_insert().
We have similar check e.g. in sd-bus or sd-event, but udevd.c is not a
library code, hence such check is not necessary.

src/udev/udevd.c

index c93dc6905e415517c1886599ecac948a61ee7b8f..214fc17861a7a337bdb6236c53c58a53d17eb262 100644 (file)
@@ -97,7 +97,6 @@ typedef struct Manager {
         Hashmap *workers;
         LIST_HEAD(Event, events);
         char *cgroup;
-        pid_t pid; /* the process that originally allocated the manager object */
         int log_level;
 
         UdevRules *rules;
@@ -776,9 +775,6 @@ static int event_queue_insert(Manager *manager, sd_device *dev) {
         assert(manager);
         assert(dev);
 
-        /* only one process can add events to the queue */
-        assert(manager->pid == getpid_cached());
-
         /* We only accepts devices received by device monitor. */
         r = sd_device_get_seqnum(dev, &seqnum);
         if (r < 0)
@@ -1532,8 +1528,6 @@ static int manager_new(Manager **ret, int fd_ctrl, int fd_uevent) {
 static int main_loop(Manager *manager) {
         int fd_worker, r;
 
-        manager->pid = getpid_cached();
-
         /* unnamed socket from workers to the main daemon */
         r = socketpair(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0, manager->worker_watch);
         if (r < 0)