From 6ec8fe53c5c178fca3fde6ec63257e65f53dc58a Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Thu, 18 Jun 2026 05:53:03 +0000 Subject: Add enable/disable/start/stop/kill shortcuts and live reset --- src/libs6f/s6f_report_state_change.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/libs6f') diff --git a/src/libs6f/s6f_report_state_change.c b/src/libs6f/s6f_report_state_change.c index 9cb718b..6a34724 100644 --- a/src/libs6f/s6f_report_state_change.c +++ b/src/libs6f/s6f_report_state_change.c @@ -1,7 +1,5 @@ /* ISC license. */ -#include - #include #include #include @@ -12,7 +10,9 @@ void s6f_report_state_change (uint32_t n, unsigned char const *oldstate, unsigned char const *newstate, char const *compiled, int h) { - if (!memcmp(oldstate, newstate, n)) + unsigned int i = 0 ; + for (; i < n ; i++) if ((oldstate[i] & 0x01) != (newstate[i] & 0x01)) break ; + if (i >= n) { if (buffer_puts(buffer_1, PROG) < 0 || buffer_puts(buffer_1, ": info: ") < 0 @@ -51,7 +51,7 @@ void s6f_report_state_change (uint32_t n, unsigned char const *oldstate, unsigne strerr_diefu1sys(111, "write to stdout") ; for (uint32_t i = 0 ; i < n ; i++) { - if ((oldstate[i] & 1) != (newstate[i] & 1)) + if ((oldstate[i] & 0x01) != (newstate[i] & 0x01)) { if (buffer_puts(buffer_1, db.string + db.services[i].name) < 0 || buffer_put(buffer_1, "\n", 1) < 1) -- cgit v1.3.1