diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-07-20 16:19:18 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-07-20 20:27:24 +0200 |
commit | df0ff127758809a45105893772de76082d12a26d (patch) | |
tree | 9deb3a960cf26b54beae6a0b60d376c6ba8efe9a /src/udev | |
parent | 5c30a6d2b805ae9b5dd0ad003b9ee86b8965bc47 (diff) | |
download | systemd-df0ff127758809a45105893772de76082d12a26d.tar.gz systemd-df0ff127758809a45105893772de76082d12a26d.tar.bz2 systemd-df0ff127758809a45105893772de76082d12a26d.zip |
tree-wide: make use of getpid_cached() wherever we can
This moves pretty much all uses of getpid() over to getpid_raw(). I
didn't specifically check whether the optimization is worth it for each
replacement, but in order to keep things simple and systematic I
switched over everything at once.
Diffstat (limited to 'src/udev')
-rw-r--r-- | src/udev/udevd.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/udev/udevd.c b/src/udev/udevd.c index acbddd4180..0e49e62688 100644 --- a/src/udev/udevd.c +++ b/src/udev/udevd.c @@ -174,7 +174,7 @@ static void event_free(struct event *event) { if (udev_list_node_is_empty(&event->manager->events)) { /* only clean up the queue from the process that created it */ - if (event->manager->pid == getpid()) { + if (event->manager->pid == getpid_cached()) { r = unlink("/run/udev/queue"); if (r < 0) log_warning_errno(errno, "could not unlink /run/udev/queue: %m"); @@ -593,9 +593,9 @@ static int event_queue_insert(Manager *manager, struct udev_device *dev) { /* only one process can add events to the queue */ if (manager->pid == 0) - manager->pid = getpid(); + manager->pid = getpid_cached(); - assert(manager->pid == getpid()); + assert(manager->pid == getpid_cached()); event = new0(struct event, 1); if (!event) |