udev: drop mostly unused Manager.pid

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.
This commit is contained in:
Yu Watanabe
2023-07-31 23:23:00 +09:00
parent 8ebc7314e8
commit 79d2ecaf63
-6
View 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)