Commit Graph
20 Commits
Author SHA1 Message Date
Lennart Poettering 0e077d3eea process-util: introduce proc_set_comm() helper
This operation is done at a bunch of places, let's add a type-safe
helper for it.
2026-07-13 15:39:16 +02:00
Daan De Meyer 52ecf376fa tree-wide: Migrate to pidref_safe_fork()
Let's migrate all remaining callers of safe_fork()
to pidref_safe_fork() and get rid of safe_fork().
2026-01-02 20:08:41 +01:00
Daan De Meyer 69a283c5f2 shared: Clean up includes
Split out of #37344.
2025-05-24 14:00:44 +02:00
Daan De Meyer 3041e377a8 async: Port to PidRef 2025-03-05 10:50:36 +01:00
Yu Watanabe b0e5cde687 async: voidify call of fsync()
Fixes CID#1564787.
2025-03-04 05:18:15 +09:00
Mike Yuan 4a5b06c5d1 shared/async: introduce asynchronous_close_many() helper 2025-02-26 13:02:28 +01:00
Mike Yuan 7eaf5ded61 async: block SIGTERM in asynchronous_rm_rf()
See justifications at https://github.com/systemd/systemd/pull/32235#issuecomment-2062327783
2024-11-14 12:21:25 +00:00
Lennart Poettering 13b5225d62 shutdown: teach sync_with_progress() to optionally sync a specific fd only
This is preparation for reusing the logic for syncing DM and other
devices with a timeout applied.
2024-09-09 19:12:31 +02:00
Mike Yuan 3760416ee8 shared/async: use safe_close where appropriate 2023-12-28 18:26:52 +08:00
Yu Watanabe 627cdcc785 tree-wide: fix typos reported by Fossies Codespell report 2023-07-12 10:14:50 +09:00
Mike Yuan 898f4da326 shared/async: don't use WEXITED for waitpid()
Follow-up for c26d7837bb

waitpid() doesn't support WEXITED and returns -1 (EINVAL),
which results in the intermediate close process not getting
reaped.

Fixes https://github.com/systemd/systemd/issues/26744#issuecomment-1628240782
2023-07-11 12:08:09 +08:00
Mike Yuan f7b1d37c77 shared/async: prefix process name with sd- 2023-07-11 12:08:09 +08:00
Lennart Poettering 530f6ada2e async: use FORK_DETACH for asynchronous syncs
To get proper "fire-and-forget" feeling we really want to make sure
noone has to reap the forked off process.
2023-06-23 10:05:16 +02:00
Lennart Poettering 78b680f99b async: drop the now unused asynchronous_job() 2023-06-23 10:05:16 +02:00
Lennart Poettering 437f3e35b4 async: add generic implementation of asynchronous_rm_rf()
This one doesn't use threads anymore. This is the last use of threads in
PID 1. Yay!

Fixes: #27287
2023-06-23 10:05:16 +02:00
Lennart Poettering 7e14a308cf shared: move async.[ch] from src/basic/ → src/shared/
That way we can later add an async wrapper for rm_rf() which is in
src/shared/, too.
2023-06-23 10:02:15 +02:00
Kay Sievers a095315b3c build-sys: split internal basic/ library from shared/
basic/      can be used by everything
            cannot use anything outside of basic/

libsystemd/ can use basic/
            cannot use shared/

shared/     can use libsystemd/
2015-06-11 10:52:46 +02:00
Zbigniew Jędrzejewski-Szmek c1d630d5fd shared/async: simplify asynchronous_job a bit 2015-02-02 20:31:18 -05:00
Lennart Poettering 5ed1227238 util: make asynchronous_close() really work like an asynchronous version of safe_close()
Save/restore errno, like we do in safe_close(). And don't fork a thread
if the parameter is already negative.
2014-08-21 17:24:21 +02:00
Lennart Poettering 76cf10dab7 build-sys: move async.[ch] to src/shared
So that we can use it at multiple places.
2014-05-05 21:19:06 +02:00