summaryrefslogtreecommitdiff
path: root/instr-daemon.c
diff options
context:
space:
mode:
authordaniel <danieruru@gmail.com>2012-09-27 09:43:20 +0900
committerdaniel <danieruru@gmail.com>2012-09-27 09:43:20 +0900
commit923c8ce77ea407f3b50999447bc1d774f6a7d5e0 (patch)
tree85aead75d9fd539f7e9ae6dc75183ae7522d58b1 /instr-daemon.c
parent82e549f79c290d6a97cf9161476eeb58cb564da3 (diff)
sync disks before calling shutdown
Diffstat (limited to 'instr-daemon.c')
-rw-r--r--instr-daemon.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/instr-daemon.c b/instr-daemon.c
index f1b1a6d..7ee36d3 100644
--- a/instr-daemon.c
+++ b/instr-daemon.c
@@ -11,6 +11,7 @@
#include <stdlib.h>
#include <ctype.h>
#include <glib.h>
+#include <unistd.h>
#define STDIN_BUF_SIZE 1024
@@ -312,6 +313,7 @@ int main(int argc, char **argv)
static gboolean periodic_poll (void)
{
if (bus_getpin (POWER_FAIL)) {
+ sync();
system ("/usr/bin/systemctl poweroff");
}