fix(env): skip uncatchable signals on OpenBSD when applying to all signals

This commit is contained in:
Sylvestre Ledru
2026-03-30 14:21:50 +02:00
parent 7265a11848
commit 0ab7479f5f
2 changed files with 11 additions and 1 deletions
+1
View File
@@ -279,3 +279,4 @@ Nofile
rprocess
statat
getdents
SIGTHR
+10 -1
View File
@@ -1080,7 +1080,16 @@ where
let Ok(sig) = signal_from_value(sig_value) else {
return Ok(());
};
signal_fn(sig)?;
match signal_fn(sig) {
Ok(()) => {}
Err(_) if !explicit => {
// When applying to all signals, silently skip signals that
// the OS refuses to change (e.g. SIGTHR on OpenBSD).
// GNU env also ignores these.
return Ok(());
}
Err(e) => return Err(e),
}
log.record(sig_value, action_kind, explicit);
// Set environment variable to communicate to Rust child processes