diff options
-rw-r--r-- | instr-daemon.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/instr-daemon.c b/instr-daemon.c index d3fcf5e..1921822 100644 --- a/instr-daemon.c +++ b/instr-daemon.c @@ -14,6 +14,7 @@ #include <stdlib.h> #include <ctype.h> #include <glib.h> +#include <unistd.h> #define STDIN_BUF_SIZE 1024 @@ -315,6 +316,7 @@ int main(int argc, char **argv) static gboolean periodic_poll (void) { if (bus_getpin (POWER_FAIL)) { + sync(); system ("/usr/bin/systemctl poweroff"); } |