From f692ee00757d38022d0f634e6c41072cf4814d1b Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 5 Oct 2023 17:11:03 +0200 Subject: [PATCH] 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 --- main.c | 5 +---- 1 file changed, 1 insertion(+), 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; }