summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2023-10-05 17:11:03 +0200
committerKenny Levinsen <kl@kl.wtf>2023-10-06 13:03:07 +0200
commitf692ee00757d38022d0f634e6c41072cf4814d1b (patch)
treee4a8a4ac33e86ac3b3daf889420975ca716692a3 /main.c
parent10df946671a12b4c0f4c13d4556a8bae6fc30394 (diff)
Don't send READY=1 for readiness notifications
Just send a singular newline like s6 expects. systemd doesn't support spawning a process with an FD to send readiness notifications to, instead it provides a socket name. IOW, this cannot be used directly with systemd after all. Closes: https://github.com/swaywm/swaylock/issues/312
Diffstat (limited to 'main.c')
-rw-r--r--main.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/main.c b/main.c
index d6eeae6..7d5f3bb 100644
--- a/main.c
+++ b/main.c
@@ -1251,10 +1251,7 @@ int main(int argc, char **argv) {
}
if (state.args.ready_fd >= 0) {
- // s6 wants a newline and ignores any text before that, systemd wants
- // READY=1, so use the least common denominator
- const char ready_str[] = "READY=1\n";
- if (write(state.args.ready_fd, ready_str, strlen(ready_str)) != strlen(ready_str)) {
+ if (write(state.args.ready_fd, "\n", 1) != 1) {
swaylock_log(LOG_ERROR, "Failed to send readiness notification");
return 2;
}