diff options
| author | NRK <nrk@disroot.org> | 2022-09-09 14:50:12 +0600 |
|---|---|---|
| committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2025-03-09 10:02:34 +0100 |
| commit | a70d5d2429abf8dcb70a8817990975dc9a621d27 (patch) | |
| tree | 71974caf51ee08f075b8436050d26bca237e5795 /LICENSE | |
| parent | a34d8fb4327bbb1afd92e7527c53fcaad547a495 (diff) | |
| download | slock-a70d5d2429abf8dcb70a8817990975dc9a621d27.tar.gz slock-a70d5d2429abf8dcb70a8817990975dc9a621d27.tar.xz | |
simplify post-lock cmd and die if it fails
this patch does two things:
0. simplify the code by using posix_spawn()
1. unify the behavior of what happens if the post-lock cmd fails.
currently, if `fork()` fails, slock will die without locking the screen.
HOWEVER if `execvp()` fails it prints a message to stderr (which the
user cannot see since the screen has been locked already) and only exits
the child while the parent locks the screen.
to reproduce:
# slock some_bin_that_doesnt_exist
this behavior is inconsistent, if the idea is that post-lock cmd is
_not_ important then we shouldn't `die()` on `fork()` failure either.
and if we assume that the post-lock cmd _is_ important, then we should
die on exec failure as well.
this patch assumes the latter and calls `die()` if `posix_spawn()`
fails.
Diffstat (limited to 'LICENSE')
0 files changed, 0 insertions, 0 deletions
