]> git.ipfire.org Git - thirdparty/systemd.git/commit
udev/spawn: continue to read stdout even if the result buffer is full
authorYu Watanabe <watanabe.yu+github@gmail.com>
Mon, 4 Aug 2025 17:44:18 +0000 (02:44 +0900)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Tue, 5 Aug 2025 08:37:02 +0000 (10:37 +0200)
commit406d8cb029db9801585e6779e9cefc29bf4b79e4
treeef5e53d102c9e1617835fc16ec2f58827b8602f0
parent1cca606c55399d067272ea8a150df77d22a79c1c
udev/spawn: continue to read stdout even if the result buffer is full

Previously, when the stdout of a spawned process (e.g. dmi_memory_id) is
truncated, the event source was not re-enabled, that will cause the process
to remain in a write-blocked state if the stdout buffer is full, and the
process will time out:
```
Spawned process 'dmi_memory_id' [1116] timed out after 2min 59s, killing.
Process 'dmi_memory_id' terminated by signal KILL.
```

The solution is to continue enabling the event source so that on_spawn_io()
can continue reading the stdout buffer. When the result buffer is full, the
local `buf` variable will be used to drain remaining stdout.

Co-authored-by: Deli Zhang <deli.zhang@cloud.com>
src/udev/udev-spawn.c