summaryrefslogtreecommitdiff
path: root/src/state/hpr_shutdown.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2019-03-02 09:41:24 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2019-03-02 09:41:24 +0000
commit23fba266a9454ee6ca095b7f6eccf523f6526607 (patch)
tree7350fdaba49b1529a13d50f6396aea35f340954d /src/state/hpr_shutdown.c
parent54d0dc0990f13a86680fa55c623f0570853749ac (diff)
downloads6-linux-init-23fba266a9454ee6ca095b7f6eccf523f6526607.tar.xz
Save pending changes in 1.0.0.0 branch
Diffstat (limited to 'src/state/hpr_shutdown.c')
-rw-r--r--src/state/hpr_shutdown.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/state/hpr_shutdown.c b/src/state/hpr_shutdown.c
new file mode 100644
index 0000000..9c9ff51
--- /dev/null
+++ b/src/state/hpr_shutdown.c
@@ -0,0 +1,16 @@
+/* ISC license. */
+
+#include <stdint.h>
+
+#include <skalibs/uint32.h>
+#include <skalibs/tai.h>
+
+#include "hpr.h"
+
+int hpr_shutdown (unsigned int what, tain_t const *when, unsigned int grace)
+{
+ char pack[5 + TAIN_PACK] = { " hpr"[what] } ;
+ tain_pack(pack+1, when) ;
+ uint32_pack_big(pack + 1 + TAIN_PACK, (uint32_t)grace) ;
+ return hpr_send(pack, 5 + TAIN_PACK) ;
+}