summaryrefslogtreecommitdiff
path: root/src/libs6
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2021-08-09 23:42:35 +0000
committerLaurent Bercot <ska@appnovation.com>2021-08-09 23:42:35 +0000
commitaaea6322e9e765969f452764e51ca1ddd9783264 (patch)
tree4e863537677e0266a79c4045c47a5e6b9f64a1a8 /src/libs6
parentce2977ee9195612730bc8713f142c95f79605e75 (diff)
downloads6-aaea6322e9e765969f452764e51ca1ddd9783264.tar.xz
skalibs-2.11.0.0 API change
Signed-off-by: Laurent Bercot <ska@appnovation.com>
Diffstat (limited to 'src/libs6')
-rw-r--r--src/libs6/ftrigr_start.c2
-rw-r--r--src/libs6/ftrigr_startf.c2
-rw-r--r--src/libs6/ftrigr_subscribe.c2
-rw-r--r--src/libs6/ftrigr_unsubscribe.c2
-rw-r--r--src/libs6/ftrigr_updateb.c3
-rw-r--r--src/libs6/ftrigr_wait_and.c2
-rw-r--r--src/libs6/ftrigr_wait_or.c5
-rw-r--r--src/libs6/ftrigw_notifyb.c10
-rw-r--r--src/libs6/s6-ftrigrd.c7
-rw-r--r--src/libs6/s6_accessrules_backend_cdb.c3
-rw-r--r--src/libs6/s6_accessrules_keycheck_ip4.c2
-rw-r--r--src/libs6/s6_accessrules_keycheck_ip6.c2
-rw-r--r--src/libs6/s6_accessrules_keycheck_reversedns.c2
-rw-r--r--src/libs6/s6_accessrules_keycheck_uidgid.c2
-rw-r--r--src/libs6/s6_fdholder_delete.c7
-rw-r--r--src/libs6/s6_fdholder_delete_async.c2
-rw-r--r--src/libs6/s6_fdholder_getdump.c7
-rw-r--r--src/libs6/s6_fdholder_list.c4
-rw-r--r--src/libs6/s6_fdholder_list_async.c2
-rw-r--r--src/libs6/s6_fdholder_list_cb.c5
-rw-r--r--src/libs6/s6_fdholder_retrieve.c4
-rw-r--r--src/libs6/s6_fdholder_retrieve_async.c2
-rw-r--r--src/libs6/s6_fdholder_retrieve_cb.c5
-rw-r--r--src/libs6/s6_fdholder_setdump.c11
-rw-r--r--src/libs6/s6_fdholder_start.c2
-rw-r--r--src/libs6/s6_fdholder_store.c8
-rw-r--r--src/libs6/s6_fdholder_store_async.c4
-rw-r--r--src/libs6/s6_supervise_link.c4
-rw-r--r--src/libs6/s6lock_acquire.c2
-rw-r--r--src/libs6/s6lock_release.c2
-rw-r--r--src/libs6/s6lock_start.c2
-rw-r--r--src/libs6/s6lock_startf.c2
-rw-r--r--src/libs6/s6lock_update.c3
-rw-r--r--src/libs6/s6lock_wait_and.c2
-rw-r--r--src/libs6/s6lock_wait_or.c5
-rw-r--r--src/libs6/s6lockd.c8
36 files changed, 76 insertions, 63 deletions
diff --git a/src/libs6/ftrigr_start.c b/src/libs6/ftrigr_start.c
index 5b6e8af..c4422dc 100644
--- a/src/libs6/ftrigr_start.c
+++ b/src/libs6/ftrigr_start.c
@@ -3,7 +3,7 @@
#include <skalibs/textclient.h>
#include <s6/ftrigr.h>
-int ftrigr_start (ftrigr_t *a, char const *path, tain_t const *deadline, tain_t *stamp)
+int ftrigr_start (ftrigr_t *a, char const *path, tain const *deadline, tain *stamp)
{
return textclient_start(&a->connection, path, 0, FTRIGR_BANNER1, FTRIGR_BANNER1_LEN, FTRIGR_BANNER2, FTRIGR_BANNER2_LEN, deadline, stamp) ;
}
diff --git a/src/libs6/ftrigr_startf.c b/src/libs6/ftrigr_startf.c
index ff02792..5d2ce16 100644
--- a/src/libs6/ftrigr_startf.c
+++ b/src/libs6/ftrigr_startf.c
@@ -3,7 +3,7 @@
#include <skalibs/textclient.h>
#include <s6/ftrigr.h>
-int ftrigr_startf (ftrigr_t *a, tain_t const *deadline, tain_t *stamp)
+int ftrigr_startf (ftrigr_t *a, tain const *deadline, tain *stamp)
{
static char const *const cargv[2] = { FTRIGRD_PROG, 0 } ;
static char const *const cenvp[1] = { 0 } ;
diff --git a/src/libs6/ftrigr_subscribe.c b/src/libs6/ftrigr_subscribe.c
index 72b87dc..1dc86e7 100644
--- a/src/libs6/ftrigr_subscribe.c
+++ b/src/libs6/ftrigr_subscribe.c
@@ -12,7 +12,7 @@
#include <skalibs/textclient.h>
#include <s6/ftrigr.h>
-uint16_t ftrigr_subscribe (ftrigr_t *a, char const *path, char const *re, uint32_t options, tain_t const *deadline, tain_t *stamp)
+uint16_t ftrigr_subscribe (ftrigr_t *a, char const *path, char const *re, uint32_t options, tain const *deadline, tain *stamp)
{
size_t pathlen = strlen(path) ;
size_t relen = strlen(re) ;
diff --git a/src/libs6/ftrigr_unsubscribe.c b/src/libs6/ftrigr_unsubscribe.c
index 557f5ea..8a716d5 100644
--- a/src/libs6/ftrigr_unsubscribe.c
+++ b/src/libs6/ftrigr_unsubscribe.c
@@ -7,7 +7,7 @@
#include <skalibs/textclient.h>
#include <s6/ftrigr.h>
-int ftrigr_unsubscribe (ftrigr_t *a, uint16_t i, tain_t const *deadline, tain_t *stamp)
+int ftrigr_unsubscribe (ftrigr_t *a, uint16_t i, tain const *deadline, tain *stamp)
{
ftrigr1_t *p ;
char pack[3] = "--U" ;
diff --git a/src/libs6/ftrigr_updateb.c b/src/libs6/ftrigr_updateb.c
index 1c5fab8..2a47e49 100644
--- a/src/libs6/ftrigr_updateb.c
+++ b/src/libs6/ftrigr_updateb.c
@@ -5,7 +5,6 @@
#include <stdint.h>
#include <errno.h>
-#include <skalibs/posixishard.h>
#include <skalibs/gccattributes.h>
#include <skalibs/uint16.h>
#include <skalibs/genalloc.h>
@@ -13,6 +12,8 @@
#include <skalibs/textclient.h>
#include <s6/ftrigr.h>
+#include <skalibs/posixishard.h>
+
static inline int appears (uint16_t, uint16_t const *, size_t) gccattr_pure ;
static inline int appears (uint16_t id, uint16_t const *list, size_t len)
diff --git a/src/libs6/ftrigr_wait_and.c b/src/libs6/ftrigr_wait_and.c
index dee03fd..ebdbde0 100644
--- a/src/libs6/ftrigr_wait_and.c
+++ b/src/libs6/ftrigr_wait_and.c
@@ -4,7 +4,7 @@
#include <skalibs/iopause.h>
#include <s6/ftrigr.h>
-int ftrigr_wait_and (ftrigr_t *a, uint16_t const *idlist, unsigned int n, tain_t const *deadline, tain_t *stamp)
+int ftrigr_wait_and (ftrigr_t *a, uint16_t const *idlist, unsigned int n, tain const *deadline, tain *stamp)
{
iopause_fd x = { -1, IOPAUSE_READ, 0 } ;
x.fd = ftrigr_fd(a) ;
diff --git a/src/libs6/ftrigr_wait_or.c b/src/libs6/ftrigr_wait_or.c
index 71a7e3e..efe6e14 100644
--- a/src/libs6/ftrigr_wait_or.c
+++ b/src/libs6/ftrigr_wait_or.c
@@ -2,12 +2,13 @@
#include <errno.h>
-#include <skalibs/posixishard.h>
#include <skalibs/iopause.h>
#include <s6/ftrigr.h>
-int ftrigr_wait_or (ftrigr_t *a, uint16_t const *idlist, unsigned int n, tain_t const *deadline, tain_t *stamp, char *c)
+#include <skalibs/posixishard.h>
+
+int ftrigr_wait_or (ftrigr_t *a, uint16_t const *idlist, unsigned int n, tain const *deadline, tain *stamp, char *c)
{
iopause_fd x = { -1, IOPAUSE_READ | IOPAUSE_EXCEPT, 0 } ;
x.fd = ftrigr_fd(a) ;
diff --git a/src/libs6/ftrigw_notifyb.c b/src/libs6/ftrigw_notifyb.c
index ee5c74c..107a760 100644
--- a/src/libs6/ftrigw_notifyb.c
+++ b/src/libs6/ftrigw_notifyb.c
@@ -2,18 +2,20 @@
#include <errno.h>
#include <signal.h>
-#include <skalibs/sig.h>
+
#include <s6/ftrigw.h>
int ftrigw_notifyb (char const *path, char const *s, size_t len)
{
- struct skasigaction old ;
+ struct sigaction old ;
+ struct sigaction action = { .sa_handler = SIG_IGN, .sa_flags = SA_RESTART | SA_NOCLDSTOP } ;
int r ;
- if (skasigaction(SIGPIPE, &SKASIG_IGN, &old) < 0) return -1 ;
+ sigfillset(&action.sa_mask) ;
+ if (sigaction(SIGPIPE, &action, &old) == -1) return -1 ;
r = ftrigw_notifyb_nosig(path, s, len) ;
{
int e = errno ;
- skasigaction(SIGPIPE, &old, 0) ;
+ sigaction(SIGPIPE, &old, 0) ;
errno = e ;
}
return r ;
diff --git a/src/libs6/s6-ftrigrd.c b/src/libs6/s6-ftrigrd.c
index 0ecf398..e8affd6 100644
--- a/src/libs6/s6-ftrigrd.c
+++ b/src/libs6/s6-ftrigrd.c
@@ -8,7 +8,6 @@
#include <regex.h>
#include <skalibs/posixplz.h>
-#include <skalibs/posixishard.h>
#include <skalibs/types.h>
#include <skalibs/allreadwrite.h>
#include <skalibs/error.h>
@@ -25,6 +24,8 @@
#include "ftrig1.h"
#include <s6/ftrigr.h>
+#include <skalibs/posixishard.h>
+
#define FTRIGRD_MAXREADS 32
#define FTRIGRD_BUFSIZE 17
@@ -197,10 +198,10 @@ int main (void)
if (ndelay_on(0) < 0) strerr_diefu2sys(111, "ndelay_on ", "0") ;
if (ndelay_on(1) < 0) strerr_diefu2sys(111, "ndelay_on ", "1") ;
- if (sig_ignore(SIGPIPE) < 0) strerr_diefu1sys(111, "ignore SIGPIPE") ;
+ if (!sig_ignore(SIGPIPE)) strerr_diefu1sys(111, "ignore SIGPIPE") ;
{
- tain_t deadline ;
+ tain deadline ;
tain_now_set_stopwatch_g() ;
tain_addsec_g(&deadline, 2) ;
if (!textclient_server_01x_init_g(FTRIGR_BANNER1, FTRIGR_BANNER1_LEN, FTRIGR_BANNER2, FTRIGR_BANNER2_LEN, &deadline))
diff --git a/src/libs6/s6_accessrules_backend_cdb.c b/src/libs6/s6_accessrules_backend_cdb.c
index 848a905..abd47c8 100644
--- a/src/libs6/s6_accessrules_backend_cdb.c
+++ b/src/libs6/s6_accessrules_backend_cdb.c
@@ -16,8 +16,7 @@ s6_accessrules_result_t s6_accessrules_backend_cdb (char const *key, size_t keyl
int wasnull = !params->env.s ;
uint16_t envlen, execlen ;
cdb const *c = arg ;
- cdb_find_state cfs = CDB_FIND_STATE_ZERO ;
- int r = cdb_find(c, &data, key, keylen, &cfs) ;
+ int r = cdb_find(c, &data, key, keylen) ;
if (r < 0) return S6_ACCESSRULES_ERROR ;
else if (!r) return S6_ACCESSRULES_NOTFOUND ;
if (!data.len || data.len > 8197) return (errno = EINVAL, S6_ACCESSRULES_ERROR) ;
diff --git a/src/libs6/s6_accessrules_keycheck_ip4.c b/src/libs6/s6_accessrules_keycheck_ip4.c
index 142be0e..506b61d 100644
--- a/src/libs6/s6_accessrules_keycheck_ip4.c
+++ b/src/libs6/s6_accessrules_keycheck_ip4.c
@@ -5,7 +5,7 @@
#include <skalibs/fmtscan.h>
#include <s6/accessrules.h>
-s6_accessrules_result_t s6_accessrules_keycheck_ip4 (void const *key, void const *data, s6_accessrules_params_t *params, s6_accessrules_backend_func_t_ref check1)
+s6_accessrules_result_t s6_accessrules_keycheck_ip4 (void const *key, void const *data, s6_accessrules_params_t *params, s6_accessrules_backend_func_ref check1)
{
char fmt[IP4_FMT + UINT_FMT + 6] = "ip4/" ;
uint32_t ip ;
diff --git a/src/libs6/s6_accessrules_keycheck_ip6.c b/src/libs6/s6_accessrules_keycheck_ip6.c
index 5922db6..796043e 100644
--- a/src/libs6/s6_accessrules_keycheck_ip6.c
+++ b/src/libs6/s6_accessrules_keycheck_ip6.c
@@ -6,7 +6,7 @@
#include <skalibs/fmtscan.h>
#include <s6/accessrules.h>
-s6_accessrules_result_t s6_accessrules_keycheck_ip6 (void const *key, void const *data, s6_accessrules_params_t *params, s6_accessrules_backend_func_t_ref check1)
+s6_accessrules_result_t s6_accessrules_keycheck_ip6 (void const *key, void const *data, s6_accessrules_params_t *params, s6_accessrules_backend_func_ref check1)
{
char fmt[IP6_FMT + UINT_FMT + 6] = "ip6/" ;
char ip6[16] ;
diff --git a/src/libs6/s6_accessrules_keycheck_reversedns.c b/src/libs6/s6_accessrules_keycheck_reversedns.c
index d0dac27..6c331fe 100644
--- a/src/libs6/s6_accessrules_keycheck_reversedns.c
+++ b/src/libs6/s6_accessrules_keycheck_reversedns.c
@@ -5,7 +5,7 @@
#include <skalibs/bytestr.h>
#include <s6/accessrules.h>
-s6_accessrules_result_t s6_accessrules_keycheck_reversedns (void const *key, void const *data, s6_accessrules_params_t *params, s6_accessrules_backend_func_t_ref check1)
+s6_accessrules_result_t s6_accessrules_keycheck_reversedns (void const *key, void const *data, s6_accessrules_params_t *params, s6_accessrules_backend_func_ref check1)
{
char const *name = key ;
size_t len = strlen(name) ;
diff --git a/src/libs6/s6_accessrules_keycheck_uidgid.c b/src/libs6/s6_accessrules_keycheck_uidgid.c
index 4d8c079..5ff9137 100644
--- a/src/libs6/s6_accessrules_keycheck_uidgid.c
+++ b/src/libs6/s6_accessrules_keycheck_uidgid.c
@@ -6,7 +6,7 @@
#include <skalibs/types.h>
#include <s6/accessrules.h>
-s6_accessrules_result_t s6_accessrules_keycheck_uidgid (void const *key, void const *data, s6_accessrules_params_t *params, s6_accessrules_backend_func_t_ref check1)
+s6_accessrules_result_t s6_accessrules_keycheck_uidgid (void const *key, void const *data, s6_accessrules_params_t *params, s6_accessrules_backend_func_ref check1)
{
uidgid_t const *uidgid = key ;
char fmt[4 + UINT64_FMT] = "uid/" ;
diff --git a/src/libs6/s6_fdholder_delete.c b/src/libs6/s6_fdholder_delete.c
index 17a27b8..6f506dd 100644
--- a/src/libs6/s6_fdholder_delete.c
+++ b/src/libs6/s6_fdholder_delete.c
@@ -2,16 +2,17 @@
#include <errno.h>
-#include <skalibs/posixishard.h>
#include <skalibs/allreadwrite.h>
#include <skalibs/tai.h>
#include <skalibs/unixmessage.h>
#include <s6/s6-fdholder.h>
-int s6_fdholder_delete (s6_fdholder_t *a, char const *id, tain_t const *deadline, tain_t *stamp)
+#include <skalibs/posixishard.h>
+
+int s6_fdholder_delete (s6_fdholder_t *a, char const *id, tain const *deadline, tain *stamp)
{
- unixmessage_t m ;
+ unixmessage m ;
if (!s6_fdholder_delete_async(a, id)) return 0 ;
if (!unixmessage_sender_timed_flush(&a->connection.out, deadline, stamp)) return 0 ;
if (sanitize_read(unixmessage_timed_receive(&a->connection.in, &m, deadline, stamp)) < 0) return 0 ;
diff --git a/src/libs6/s6_fdholder_delete_async.c b/src/libs6/s6_fdholder_delete_async.c
index e234cfd..2b14f47 100644
--- a/src/libs6/s6_fdholder_delete_async.c
+++ b/src/libs6/s6_fdholder_delete_async.c
@@ -11,7 +11,7 @@ int s6_fdholder_delete_async (s6_fdholder_t *a, char const *id)
size_t idlen = strlen(id) ;
char pack[2] = "D" ;
struct iovec v[2] = { { .iov_base = pack, .iov_len = 2 }, { .iov_base = (char *)id, .iov_len = idlen + 1 } } ;
- unixmessage_v_t m = { .v = v, .vlen = 2, .fds = 0, .nfds = 0 } ;
+ unixmessagev m = { .v = v, .vlen = 2, .fds = 0, .nfds = 0 } ;
if (idlen > S6_FDHOLDER_ID_SIZE) return (errno = ENAMETOOLONG, 0) ;
pack[1] = (unsigned char)idlen ;
return unixmessage_putv(&a->connection.out, &m) ;
diff --git a/src/libs6/s6_fdholder_getdump.c b/src/libs6/s6_fdholder_getdump.c
index 218dc55..630ddc5 100644
--- a/src/libs6/s6_fdholder_getdump.c
+++ b/src/libs6/s6_fdholder_getdump.c
@@ -4,7 +4,6 @@
#include <stdint.h>
#include <errno.h>
-#include <skalibs/posixishard.h>
#include <skalibs/uint32.h>
#include <skalibs/allreadwrite.h>
#include <skalibs/tai.h>
@@ -14,9 +13,11 @@
#include <s6/s6-fdholder.h>
-int s6_fdholder_getdump (s6_fdholder_t *a, genalloc *g, tain_t const *deadline, tain_t *stamp)
+#include <skalibs/posixishard.h>
+
+int s6_fdholder_getdump (s6_fdholder_t *a, genalloc *g, tain const *deadline, tain *stamp)
{
- unixmessage_t m = { .s = "?", .len = 1, .fds = 0, .nfds = 0 } ;
+ unixmessage m = { .s = "?", .len = 1, .fds = 0, .nfds = 0 } ;
uint32_t ntot, n ;
size_t oldlen = genalloc_len(s6_fdholder_fd_t, g) ;
unsigned int i = 0 ;
diff --git a/src/libs6/s6_fdholder_list.c b/src/libs6/s6_fdholder_list.c
index d86049f..312fc28 100644
--- a/src/libs6/s6_fdholder_list.c
+++ b/src/libs6/s6_fdholder_list.c
@@ -7,10 +7,10 @@
#include <skalibs/unixmessage.h>
#include <s6/s6-fdholder.h>
-int s6_fdholder_list (s6_fdholder_t *a, stralloc *sa, tain_t const *deadline, tain_t *stamp)
+int s6_fdholder_list (s6_fdholder_t *a, stralloc *sa, tain const *deadline, tain *stamp)
{
s6_fdholder_list_result_t res = { .sa = sa } ;
- unixmessage_t m ;
+ unixmessage m ;
if (!s6_fdholder_list_async(a)) return -1 ;
if (!unixmessage_sender_timed_flush(&a->connection.out, deadline, stamp)) return -1 ;
if (sanitize_read(unixmessage_timed_receive(&a->connection.in, &m, deadline, stamp)) < 0) return -1 ;
diff --git a/src/libs6/s6_fdholder_list_async.c b/src/libs6/s6_fdholder_list_async.c
index 8275f23..e7e8810 100644
--- a/src/libs6/s6_fdholder_list_async.c
+++ b/src/libs6/s6_fdholder_list_async.c
@@ -5,6 +5,6 @@
int s6_fdholder_list_async (s6_fdholder_t *a)
{
- unixmessage_t m = { .s = "L", .len = 1, .fds = 0, .nfds = 0 } ;
+ unixmessage m = { .s = "L", .len = 1, .fds = 0, .nfds = 0 } ;
return unixmessage_put(&a->connection.out, &m) ;
}
diff --git a/src/libs6/s6_fdholder_list_cb.c b/src/libs6/s6_fdholder_list_cb.c
index e09d8e2..0be71c9 100644
--- a/src/libs6/s6_fdholder_list_cb.c
+++ b/src/libs6/s6_fdholder_list_cb.c
@@ -3,14 +3,15 @@
#include <stdint.h>
#include <errno.h>
-#include <skalibs/posixishard.h>
#include <skalibs/uint32.h>
#include <skalibs/bytestr.h>
#include <skalibs/stralloc.h>
#include <skalibs/unixmessage.h>
#include <s6/s6-fdholder.h>
-int s6_fdholder_list_cb (unixmessage_t const *m, void *p)
+#include <skalibs/posixishard.h>
+
+int s6_fdholder_list_cb (unixmessage const *m, void *p)
{
uint32_t n ;
s6_fdholder_list_result_t *res = p ;
diff --git a/src/libs6/s6_fdholder_retrieve.c b/src/libs6/s6_fdholder_retrieve.c
index 9bdb8ad..7af8eb4 100644
--- a/src/libs6/s6_fdholder_retrieve.c
+++ b/src/libs6/s6_fdholder_retrieve.c
@@ -6,9 +6,9 @@
#include <skalibs/unixmessage.h>
#include <s6/s6-fdholder.h>
-int s6_fdholder_retrieve_maybe_delete (s6_fdholder_t *a, char const *id, int dodelete, tain_t const *deadline, tain_t *stamp)
+int s6_fdholder_retrieve_maybe_delete (s6_fdholder_t *a, char const *id, int dodelete, tain const *deadline, tain *stamp)
{
- unixmessage_t m ;
+ unixmessage m ;
s6_fdholder_retrieve_result_t res ;
if (!s6_fdholder_retrieve_maybe_delete_async(a, id, dodelete)) return -1 ;
if (!unixmessage_sender_timed_flush(&a->connection.out, deadline, stamp)) return -1 ;
diff --git a/src/libs6/s6_fdholder_retrieve_async.c b/src/libs6/s6_fdholder_retrieve_async.c
index e258772..ce190b8 100644
--- a/src/libs6/s6_fdholder_retrieve_async.c
+++ b/src/libs6/s6_fdholder_retrieve_async.c
@@ -11,7 +11,7 @@ int s6_fdholder_retrieve_maybe_delete_async (s6_fdholder_t *a, char const *id, i
size_t idlen = strlen(id) ;
char pack[3] = "R" ;
struct iovec v[2] = { { .iov_base = pack, .iov_len = 3 }, { .iov_base = (char *)id, .iov_len = idlen + 1 } } ;
- unixmessage_v_t m = { .v = v, .vlen = 2, .fds = 0, .nfds = 0 } ;
+ unixmessagev m = { .v = v, .vlen = 2, .fds = 0, .nfds = 0 } ;
if (idlen > S6_FDHOLDER_ID_SIZE) return (errno = ENAMETOOLONG, 0) ;
pack[1] = !!dodelete ;
pack[2] = (unsigned char)idlen ;
diff --git a/src/libs6/s6_fdholder_retrieve_cb.c b/src/libs6/s6_fdholder_retrieve_cb.c
index 753f12b..e8ad7ee 100644
--- a/src/libs6/s6_fdholder_retrieve_cb.c
+++ b/src/libs6/s6_fdholder_retrieve_cb.c
@@ -2,12 +2,13 @@
#include <errno.h>
-#include <skalibs/posixishard.h>
#include <skalibs/unixmessage.h>
#include <s6/s6-fdholder.h>
-int s6_fdholder_retrieve_cb (unixmessage_t const *m, void *p)
+#include <skalibs/posixishard.h>
+
+int s6_fdholder_retrieve_cb (unixmessage const *m, void *p)
{
s6_fdholder_retrieve_result_t *res = p ;
if (m->len != 1) goto err ;
diff --git a/src/libs6/s6_fdholder_setdump.c b/src/libs6/s6_fdholder_setdump.c
index d5a292c..8c5ae6e 100644
--- a/src/libs6/s6_fdholder_setdump.c
+++ b/src/libs6/s6_fdholder_setdump.c
@@ -5,7 +5,6 @@
#include <string.h>
#include <errno.h>
-#include <skalibs/posixishard.h>
#include <skalibs/uint32.h>
#include <skalibs/allreadwrite.h>
#include <skalibs/bytestr.h>
@@ -15,7 +14,9 @@
#include <s6/s6-fdholder.h>
-int s6_fdholder_setdump (s6_fdholder_t *a, s6_fdholder_fd_t const *list, unsigned int ntot, tain_t const *deadline, tain_t *stamp)
+#include <skalibs/posixishard.h>
+
+int s6_fdholder_setdump (s6_fdholder_t *a, s6_fdholder_fd_t const *list, unsigned int ntot, tain const *deadline, tain *stamp)
{
uint32_t trips ;
if (!ntot) return 1 ;
@@ -27,7 +28,7 @@ int s6_fdholder_setdump (s6_fdholder_t *a, s6_fdholder_fd_t const *list, unsigne
}
{
char pack[5] = "!" ;
- unixmessage_t m = { .s = pack, .len = 5, .fds = 0, .nfds = 0 } ;
+ unixmessage m = { .s = pack, .len = 5, .fds = 0, .nfds = 0 } ;
uint32_pack_big(pack+1, ntot) ;
if (!unixmessage_put(&a->connection.out, &m)) return 0 ;
if (!unixmessage_sender_timed_flush(&a->connection.out, deadline, stamp)) return 0 ;
@@ -45,7 +46,7 @@ int s6_fdholder_setdump (s6_fdholder_t *a, s6_fdholder_fd_t const *list, unsigne
unsigned int j = 0 ;
struct iovec v[1 + (n<<1)] ;
int fds[n] ;
- unixmessage_v_t m = { .v = v, .vlen = 1 + (n<<1), .fds = fds, .nfds = n } ;
+ unixmessagev m = { .v = v, .vlen = 1 + (n<<1), .fds = fds, .nfds = n } ;
char pack[n * (TAIN_PACK+1)] ;
v[0].iov_base = "." ; v[0].iov_len = 1 ;
for (; j < n ; j++, list++, ntot--)
@@ -63,7 +64,7 @@ int s6_fdholder_setdump (s6_fdholder_t *a, s6_fdholder_fd_t const *list, unsigne
}
if (!unixmessage_sender_timed_flush(&a->connection.out, deadline, stamp)) return 0 ;
{
- unixmessage_t m ;
+ unixmessage m ;
if (sanitize_read(unixmessage_timed_receive(&a->connection.in, &m, deadline, stamp)) < 0) return 0 ;
if (m.len != 1 || m.nfds)
{
diff --git a/src/libs6/s6_fdholder_start.c b/src/libs6/s6_fdholder_start.c
index 38bbfb2..7e3ddda 100644
--- a/src/libs6/s6_fdholder_start.c
+++ b/src/libs6/s6_fdholder_start.c
@@ -5,7 +5,7 @@
#include <s6/s6-fdholder.h>
-int s6_fdholder_start (s6_fdholder_t *a, char const *path, tain_t const *deadline, tain_t *stamp)
+int s6_fdholder_start (s6_fdholder_t *a, char const *path, tain const *deadline, tain *stamp)
{
int fd = ipc_stream_nb() ;
if (fd < 0) return 0 ;
diff --git a/src/libs6/s6_fdholder_store.c b/src/libs6/s6_fdholder_store.c
index a579929..1541905 100644
--- a/src/libs6/s6_fdholder_store.c
+++ b/src/libs6/s6_fdholder_store.c
@@ -2,15 +2,17 @@
#include <errno.h>
-#include <skalibs/posixishard.h>
#include <skalibs/allreadwrite.h>
#include <skalibs/tai.h>
#include <skalibs/unixmessage.h>
+
#include <s6/s6-fdholder.h>
-int s6_fdholder_store (s6_fdholder_t *a, int fd, char const *id, tain_t const *limit, tain_t const *deadline, tain_t *stamp)
+#include <skalibs/posixishard.h>
+
+int s6_fdholder_store (s6_fdholder_t *a, int fd, char const *id, tain const *limit, tain const *deadline, tain *stamp)
{
- unixmessage_t m ;
+ unixmessage m ;
if (!s6_fdholder_store_async(a, fd, id, limit)) return 0 ;
if (!unixmessage_sender_timed_flush(&a->connection.out, deadline, stamp)) return 0 ;
if (sanitize_read(unixmessage_timed_receive(&a->connection.in, &m, deadline, stamp)) < 0) return 0 ;
diff --git a/src/libs6/s6_fdholder_store_async.c b/src/libs6/s6_fdholder_store_async.c
index a782d2d..541f41c 100644
--- a/src/libs6/s6_fdholder_store_async.c
+++ b/src/libs6/s6_fdholder_store_async.c
@@ -7,12 +7,12 @@
#include <skalibs/unixmessage.h>
#include <s6/s6-fdholder.h>
-int s6_fdholder_store_async (s6_fdholder_t *a, int fd, char const *id, tain_t const *limit)
+int s6_fdholder_store_async (s6_fdholder_t *a, int fd, char const *id, tain const *limit)
{
size_t idlen = strlen(id) ;
char pack[2 + TAIN_PACK] = "S" ;
struct iovec v[2] = { { .iov_base = pack, .iov_len = 2 + TAIN_PACK }, { .iov_base = (char *)id, .iov_len = idlen + 1 } } ;
- unixmessage_v_t m = { .v = v, .vlen = 2, .fds = &fd, .nfds = 1 } ;
+ unixmessagev m = { .v = v, .vlen = 2, .fds = &fd, .nfds = 1 } ;
if (idlen > S6_FDHOLDER_ID_SIZE) return (errno = ENAMETOOLONG, 0) ;
tain_pack(pack + 1, limit) ;
pack[1+TAIN_PACK] = (unsigned char)idlen ;
diff --git a/src/libs6/s6_supervise_link.c b/src/libs6/s6_supervise_link.c
index f525820..1d2ae15 100644
--- a/src/libs6/s6_supervise_link.c
+++ b/src/libs6/s6_supervise_link.c
@@ -29,7 +29,7 @@ static inline void do_unlink (char const *scdir, char const *prefix, size_t pref
}
}
-static uint16_t registerit (ftrigr_t *a, char *fn, size_t len, gid_t gid, uint32_t options, tain_t const *deadline, tain_t *stamp)
+static uint16_t registerit (ftrigr_t *a, char *fn, size_t len, gid_t gid, uint32_t options, tain const *deadline, tain *stamp)
{
if (options & 4)
{
@@ -44,7 +44,7 @@ static uint16_t registerit (ftrigr_t *a, char *fn, size_t len, gid_t gid, uint32
return ftrigr_subscribe(a, fn, "s", 0, deadline, stamp) ;
}
-int s6_supervise_link (char const *scdir, char const *const *servicedirs, size_t n, char const *prefix, uint32_t options, tain_t const *deadline, tain_t *stamp)
+int s6_supervise_link (char const *scdir, char const *const *servicedirs, size_t n, char const *prefix, uint32_t options, tain const *deadline, tain *stamp)
{
size_t maxlen = 0 ;
size_t ntotal = n ;
diff --git a/src/libs6/s6lock_acquire.c b/src/libs6/s6lock_acquire.c
index 3ce6c77..e73ace0 100644
--- a/src/libs6/s6lock_acquire.c
+++ b/src/libs6/s6lock_acquire.c
@@ -11,7 +11,7 @@
#include <skalibs/textclient.h>
#include <s6/s6lock.h>
-int s6lock_acquire (s6lock_t *a, uint16_t *u, char const *path, uint32_t options, tain_t const *limit, tain_t const *deadline, tain_t *stamp)
+int s6lock_acquire (s6lock_t *a, uint16_t *u, char const *path, uint32_t options, tain const *limit, tain const *deadline, tain *stamp)
{
size_t pathlen = strlen(path) ;
char tmp[23] = "--<" ;
diff --git a/src/libs6/s6lock_release.c b/src/libs6/s6lock_release.c
index 293d8f4..662b876 100644
--- a/src/libs6/s6lock_release.c
+++ b/src/libs6/s6lock_release.c
@@ -7,7 +7,7 @@
#include <skalibs/textclient.h>
#include <s6/s6lock.h>
-int s6lock_release (s6lock_t *a, uint16_t i, tain_t const *deadline, tain_t *stamp)
+int s6lock_release (s6lock_t *a, uint16_t i, tain const *deadline, tain *stamp)
{
char *p = GENSETDYN_P(char, &a->data, i) ;
char pack[3] = "-->" ;
diff --git a/src/libs6/s6lock_start.c b/src/libs6/s6lock_start.c
index 1b95d75..6d81628 100644
--- a/src/libs6/s6lock_start.c
+++ b/src/libs6/s6lock_start.c
@@ -3,7 +3,7 @@
#include <skalibs/textclient.h>
#include <s6/s6lock.h>
-int s6lock_start (s6lock_t *a, char const *path, tain_t const *deadline, tain_t *stamp)
+int s6lock_start (s6lock_t *a, char const *path, tain const *deadline, tain *stamp)
{
return textclient_start(&a->connection, path, 0, S6LOCK_BANNER1, S6LOCK_BANNER1_LEN, S6LOCK_BANNER2, S6LOCK_BANNER2_LEN, deadline, stamp) ;
}
diff --git a/src/libs6/s6lock_startf.c b/src/libs6/s6lock_startf.c
index 293d84c..e58cb46 100644
--- a/src/libs6/s6lock_startf.c
+++ b/src/libs6/s6lock_startf.c
@@ -5,7 +5,7 @@
#include <skalibs/textclient.h>
#include <s6/s6lock.h>
-int s6lock_startf (s6lock_t *a, char const *lockdir, tain_t const *deadline, tain_t *stamp)
+int s6lock_startf (s6lock_t *a, char const *lockdir, tain const *deadline, tain *stamp)
{
char const *cargv[3] = { S6LOCKD_PROG, lockdir, 0 } ;
if (!lockdir) return (errno = EINVAL, 0) ;
diff --git a/src/libs6/s6lock_update.c b/src/libs6/s6lock_update.c
index 0926014..fdf1001 100644
--- a/src/libs6/s6lock_update.c
+++ b/src/libs6/s6lock_update.c
@@ -4,7 +4,6 @@
#include <stdint.h>
#include <errno.h>
-#include <skalibs/posixishard.h>
#include <skalibs/error.h>
#include <skalibs/uint16.h>
#include <skalibs/genalloc.h>
@@ -13,6 +12,8 @@
#include <s6/s6lock.h>
+#include <skalibs/posixishard.h>
+
static int msghandler (struct iovec const *v, void *context)
{
s6lock_t *a = (s6lock_t *)context ;
diff --git a/src/libs6/s6lock_wait_and.c b/src/libs6/s6lock_wait_and.c
index d5d3792..801e8a0 100644
--- a/src/libs6/s6lock_wait_and.c
+++ b/src/libs6/s6lock_wait_and.c
@@ -4,7 +4,7 @@
#include <skalibs/iopause.h>
#include <s6/s6lock.h>
-int s6lock_wait_and (s6lock_t *a, uint16_t const *idlist, unsigned int n, tain_t const *deadline, tain_t *stamp)
+int s6lock_wait_and (s6lock_t *a, uint16_t const *idlist, unsigned int n, tain const *deadline, tain *stamp)
{
iopause_fd x = { .fd = -1, .events = IOPAUSE_READ, .revents = 0 } ;
x.fd = s6lock_fd(a) ;
diff --git a/src/libs6/s6lock_wait_or.c b/src/libs6/s6lock_wait_or.c
index 6800bd0..421978b 100644
--- a/src/libs6/s6lock_wait_or.c
+++ b/src/libs6/s6lock_wait_or.c
@@ -2,12 +2,13 @@
#include <errno.h>
-#include <skalibs/posixishard.h>
#include <skalibs/iopause.h>
#include <s6/s6lock.h>
-int s6lock_wait_or (s6lock_t *a, uint16_t const *idlist, unsigned int n, tain_t const *deadline, tain_t *stamp)
+#include <skalibs/posixishard.h>
+
+int s6lock_wait_or (s6lock_t *a, uint16_t const *idlist, unsigned int n, tain const *deadline, tain *stamp)
{
iopause_fd x = { -1, IOPAUSE_READ | IOPAUSE_EXCEPT, 0 } ;
x.fd = s6lock_fd(a) ;
diff --git a/src/libs6/s6lockd.c b/src/libs6/s6lockd.c
index f2d18f9..764e102 100644
--- a/src/libs6/s6lockd.c
+++ b/src/libs6/s6lockd.c
@@ -30,7 +30,7 @@ struct s6lockio_s
{
unsigned int xindex ;
unsigned int pid ;
- tain_t limit ;
+ tain limit ;
int p[2] ;
uint16_t id ; /* given by client */
} ;
@@ -179,7 +179,7 @@ static int parse_protocol (struct iovec const *v, void *context)
int main (int argc, char const *const *argv)
{
- tain_t deadline ;
+ tain deadline ;
int sfd ;
PROG = "s6lockd" ;
@@ -187,7 +187,7 @@ int main (int argc, char const *const *argv)
if (chdir(argv[1]) < 0) strerr_diefu2sys(111, "chdir to ", argv[1]) ;
if (ndelay_on(0) < 0) strerr_diefu2sys(111, "ndelay_on ", "0") ;
if (ndelay_on(1) < 0) strerr_diefu2sys(111, "ndelay_on ", "1") ;
- if (sig_ignore(SIGPIPE) < 0) strerr_diefu1sys(111, "ignore SIGPIPE") ;
+ if (!sig_altignore(SIGPIPE)) strerr_diefu1sys(111, "ignore SIGPIPE") ;
sfd = selfpipe_init() ;
if (sfd < 0) strerr_diefu1sys(111, "selfpipe_init") ;
@@ -200,7 +200,7 @@ int main (int argc, char const *const *argv)
sigaddset(&set, SIGHUP) ;
sigaddset(&set, SIGABRT) ;
sigaddset(&set, SIGINT) ;
- if (selfpipe_trapset(&set) < 0)
+ if (!selfpipe_trapset(&set))
strerr_diefu1sys(111, "trap signals") ;
}