summaryrefslogtreecommitdiff
path: root/src/daemontools-extras
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/daemontools-extras
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/daemontools-extras')
-rw-r--r--src/daemontools-extras/s6-applyuidgid.c2
-rw-r--r--src/daemontools-extras/s6-envdir.c2
-rw-r--r--src/daemontools-extras/s6-envuidgid.c2
-rw-r--r--src/daemontools-extras/s6-log.c37
-rw-r--r--src/daemontools-extras/s6-setlock.c4
-rw-r--r--src/daemontools-extras/s6-setsid.c5
-rw-r--r--src/daemontools-extras/s6-softlimit.c2
-rw-r--r--src/daemontools-extras/s6-tai64nlocal.c6
-rw-r--r--src/daemontools-extras/ucspilogd.c2
9 files changed, 30 insertions, 32 deletions
diff --git a/src/daemontools-extras/s6-applyuidgid.c b/src/daemontools-extras/s6-applyuidgid.c
index 4dd0912..a064aa3 100644
--- a/src/daemontools-extras/s6-applyuidgid.c
+++ b/src/daemontools-extras/s6-applyuidgid.c
@@ -24,7 +24,7 @@ int main (int argc, char const *const *argv)
int unexport = 0 ;
PROG = "s6-applyuidgid" ;
{
- subgetopt_t l = SUBGETOPT_ZERO ;
+ subgetopt l = SUBGETOPT_ZERO ;
for (;;)
{
int opt = subgetopt_r(argc, argv, "zUu:g:G:", &l) ;
diff --git a/src/daemontools-extras/s6-envdir.c b/src/daemontools-extras/s6-envdir.c
index 6a6bd6f..4c297ea 100644
--- a/src/daemontools-extras/s6-envdir.c
+++ b/src/daemontools-extras/s6-envdir.c
@@ -13,7 +13,7 @@
int main (int argc, char const *const *argv)
{
stralloc modifs = STRALLOC_ZERO ;
- subgetopt_t l = SUBGETOPT_ZERO ;
+ subgetopt l = SUBGETOPT_ZERO ;
int insist = 1 ;
unsigned int options = 0 ;
char nullis = '\n' ;
diff --git a/src/daemontools-extras/s6-envuidgid.c b/src/daemontools-extras/s6-envuidgid.c
index 48da80a..63b7d44 100644
--- a/src/daemontools-extras/s6-envuidgid.c
+++ b/src/daemontools-extras/s6-envuidgid.c
@@ -78,7 +78,7 @@ int main (int argc, char *const *argv)
gid_t tab[NGROUPS_MAX] ;
PROG = "s6-envuidgid" ;
{
- subgetopt_t l = SUBGETOPT_ZERO ;
+ subgetopt l = SUBGETOPT_ZERO ;
for (;;)
{
int opt = subgetopt_r(argc, (char const *const *)argv, "ugBniD:", &l) ;
diff --git a/src/daemontools-extras/s6-log.c b/src/daemontools-extras/s6-log.c
index 29debb3..92e3886 100644
--- a/src/daemontools-extras/s6-log.c
+++ b/src/daemontools-extras/s6-log.c
@@ -55,8 +55,8 @@ static stralloc indata = STRALLOC_ZERO ;
/* Data types */
-typedef int qcmpfunc_t (void const *, void const *) ;
-typedef qcmpfunc_t *qcmpfunc_t_ref ;
+typedef int qcmp_func (void const *, void const *) ;
+typedef qcmp_func *qcmp_func_ref ;
typedef enum rotstate_e rotstate_t, *rotstate_t_ref ;
enum rotstate_e
@@ -139,16 +139,16 @@ struct scriptelem_s
unsigned int actlen ;
} ;
-typedef void inputprocfunc_t (scriptelem_t const *, unsigned int, size_t, unsigned int) ;
-typedef inputprocfunc_t *inputprocfunc_t_ref ;
+typedef void inputproc_func (scriptelem_t const *, unsigned int, size_t, unsigned int) ;
+typedef inputproc_func *inputproc_func_ref ;
typedef struct logdir_s logdir_t, *logdir_t_ref ;
struct logdir_s
{
bufalloc out ;
unsigned int xindex ;
- tain_t retrytto ;
- tain_t deadline ;
+ tain retrytto ;
+ tain deadline ;
uint64_t maxdirsize ;
uint32_t b ;
uint32_t n ;
@@ -200,7 +200,7 @@ static int filedesc_cmp (struct filedesc_s const *a, struct filedesc_s const *b)
static int name_is_relevant (char const *name)
{
- tain_t dummy ;
+ tain dummy ;
if (strlen(name) != 27) return 0 ;
if (!timestamp_scan(name, &dummy)) return 0 ;
if (name[25] != '.') return 0 ;
@@ -270,7 +270,7 @@ static inline int logdir_trim (logdir_t *ldp)
dir_close(dir) ;
if ((i <= ldp->n) && (!ldp->maxdirsize || (totalsize <= ldp->maxdirsize)))
return 0 ;
- qsort(archive, i, sizeof(struct filedesc_s), (qcmpfunc_t_ref)&filedesc_cmp) ;
+ qsort(archive, i, sizeof(struct filedesc_s), (qcmp_func_ref)&filedesc_cmp) ;
n = 0 ;
while ((i > ldp->n + n) || (ldp->maxdirsize && (totalsize > ldp->maxdirsize)))
{
@@ -335,7 +335,6 @@ static inline void exec_processor (logdir_t *ldp)
if (fd < 0) strerr_diefu3sys(111, "open_trunc ", ldp->dir, "/newstate") ;
if (fd_move(5, fd) < 0) strerr_diefu3sys(111, "fd_move ", ldp->dir, "/newstate") ;
selfpipe_finish() ;
- sig_restore(SIGPIPE) ;
xexec(cargv) ;
}
@@ -555,7 +554,7 @@ static inline void rotate_or_flush (logdir_t *ldp)
bufalloc_flush(&ldp->out) ;
}
-static inline void logdir_init (unsigned int index, uint32_t s, uint32_t n, uint32_t tolerance, uint64_t maxdirsize, tain_t const *retrytto, char const *processor, char const *name, unsigned int flags)
+static inline void logdir_init (unsigned int index, uint32_t s, uint32_t n, uint32_t tolerance, uint64_t maxdirsize, tain const *retrytto, char const *processor, char const *name, unsigned int flags)
{
logdir_t *ldp = logdirs + index ;
struct stat st ;
@@ -670,7 +669,7 @@ static inline void finalize (void)
for (;;)
{
unsigned int i = 0 ;
- tain_t deadline ;
+ tain deadline ;
tain_addsec_g(&deadline, 2) ;
for (; i < llen ; i++)
if (logdirs[i].rstate != ROTSTATE_END)
@@ -766,7 +765,7 @@ static inline void script_firstpass (char const *const *argv, unsigned int *sell
static inline void script_secondpass (char const *const *argv, scriptelem_t *script, sel_t *selections, act_t *actions)
{
- tain_t retrytto ;
+ tain retrytto ;
unsigned int fd2_size = 200 ;
unsigned int status_size = 1001 ;
uint32_t s = 99999 ;
@@ -907,7 +906,7 @@ static void script_run (scriptelem_t const *script, unsigned int scriptlen, char
char tstamp[TIMESTAMP+1] ;
if (gflags & 3)
{
- tain_t now ;
+ tain now ;
tain_wallclock_read(&now) ;
if (gflags & 1)
{
@@ -916,7 +915,7 @@ static void script_run (scriptelem_t const *script, unsigned int scriptlen, char
}
if (gflags & 2)
{
- localtmn_t l ;
+ localtmn l ;
localtmn_from_tain(&l, &now, 1) ;
hlen = localtmn_fmt(hstamp, &l) ;
hstamp[hlen++] = ' ' ;
@@ -1096,7 +1095,7 @@ static void last_stdin (scriptelem_t const *script, unsigned int scriptlen, size
}
}
-static inputprocfunc_t_ref handle_stdin = &normal_stdin ;
+static inputproc_func_ref handle_stdin = &normal_stdin ;
/* Signals */
@@ -1178,7 +1177,7 @@ int main (int argc, char const *const *argv)
int flagblock = 0 ;
PROG = "s6-log" ;
{
- subgetopt_t l = SUBGETOPT_ZERO ;
+ subgetopt l = SUBGETOPT_ZERO ;
for (;;)
{
int opt = subgetopt_r(argc, argv, "qvbpl:d:", &l) ;
@@ -1221,7 +1220,7 @@ int main (int argc, char const *const *argv)
script_secondpass(argv, script, selections, actions) ;
x[0].fd = selfpipe_init() ;
if (x[0].fd < 0) strerr_diefu1sys(111, "selfpipe_init") ;
- if (sig_ignore(SIGPIPE) < 0) strerr_diefu1sys(111, "sig_ignore(SIGPIPE)") ;
+ if (!sig_altignore(SIGPIPE)) strerr_diefu1sys(111, "sig_ignore(SIGPIPE)") ;
{
sigset_t set ;
sigemptyset(&set) ;
@@ -1229,7 +1228,7 @@ int main (int argc, char const *const *argv)
sigaddset(&set, SIGHUP) ;
sigaddset(&set, SIGALRM) ;
sigaddset(&set, SIGCHLD) ;
- if (selfpipe_trapset(&set) < 0)
+ if (!selfpipe_trapset(&set))
strerr_diefu1sys(111, "selfpipe_trapset") ;
}
x[0].events = IOPAUSE_READ ;
@@ -1241,7 +1240,7 @@ int main (int argc, char const *const *argv)
for (;;)
{
- tain_t deadline ;
+ tain deadline ;
int r = 0 ;
unsigned int xindex0, xindex1 ;
unsigned int i = 0, j = 1 ;
diff --git a/src/daemontools-extras/s6-setlock.c b/src/daemontools-extras/s6-setlock.c
index 6497600..96697e4 100644
--- a/src/daemontools-extras/s6-setlock.c
+++ b/src/daemontools-extras/s6-setlock.c
@@ -26,7 +26,7 @@ int main (int argc, char const *const *argv)
PROG = "s6-setlock" ;
for (;;)
{
- int opt = subgetopt(argc, argv, "nNrwt:") ;
+ int opt = lgetopt(argc, argv, "nNrwt:") ;
if (opt == -1) break ;
switch (opt)
{
@@ -47,7 +47,7 @@ int main (int argc, char const *const *argv)
char const *cargv[4] = { "s6lockd-helper", ex ? "w" : "r", argv[0], 0 } ;
char const *nullenv = { 0 } ;
iopause_fd x = { .events = IOPAUSE_READ } ;
- tain_t deadline ;
+ tain deadline ;
int p[2] = { 0, 1 } ;
pid_t pid ;
char c ;
diff --git a/src/daemontools-extras/s6-setsid.c b/src/daemontools-extras/s6-setsid.c
index 69098ef..53c3488 100644
--- a/src/daemontools-extras/s6-setsid.c
+++ b/src/daemontools-extras/s6-setsid.c
@@ -17,7 +17,7 @@ int main (int argc, char const *const *argv)
unsigned int ctty = 0, what = 0, insist = 1 ;
PROG = "s6-setsid" ;
{
- subgetopt_t l = SUBGETOPT_ZERO ;
+ subgetopt l = SUBGETOPT_ZERO ;
for (;;)
{
int opt = subgetopt_r(argc, argv, "sbfgiIqd:", &l) ;
@@ -50,14 +50,13 @@ int main (int argc, char const *const *argv)
if (what >= 2)
{
- if (what == 3) sig_ignore(SIGTTOU) ;
+ if (what == 3) sig_altignore(SIGTTOU) ;
if (tcsetpgrp(ctty, getpid()) < 0) switch (insist)
{
case 2 : strerr_diefu1sys(111, "tcsetpgrp") ;
case 1 : strerr_warnwu1sys("tcsetpgrp") ; break ;
default : break ;
}
- if (what == 3) sig_restore(SIGTTOU) ;
}
}
else if (setsid() < 0) switch (insist)
diff --git a/src/daemontools-extras/s6-softlimit.c b/src/daemontools-extras/s6-softlimit.c
index 608385a..8ec4470 100644
--- a/src/daemontools-extras/s6-softlimit.c
+++ b/src/daemontools-extras/s6-softlimit.c
@@ -27,7 +27,7 @@ static void doit (int res, char const *arg)
int main (int argc, char const *const *argv)
{
- subgetopt_t l = SUBGETOPT_ZERO ;
+ subgetopt l = SUBGETOPT_ZERO ;
PROG = "s6-softlimit" ;
for (;;)
{
diff --git a/src/daemontools-extras/s6-tai64nlocal.c b/src/daemontools-extras/s6-tai64nlocal.c
index 097102b..75dd5a3 100644
--- a/src/daemontools-extras/s6-tai64nlocal.c
+++ b/src/daemontools-extras/s6-tai64nlocal.c
@@ -17,7 +17,7 @@ int main (int argc, char const *const *argv)
int islocal = 1 ;
PROG = "s6-tai64nlocal" ;
{
- subgetopt_t l = SUBGETOPT_ZERO ;
+ subgetopt l = SUBGETOPT_ZERO ;
for (;;)
{
int opt = subgetopt_r(argc, argv, "g", &l) ;
@@ -42,11 +42,11 @@ int main (int argc, char const *const *argv)
else if (!r) break ;
if (satmp.len > TIMESTAMP)
{
- tain_t a ;
+ tain a ;
p = timestamp_scan(satmp.s, &a) ;
if (p)
{
- localtmn_t local ;
+ localtmn local ;
if (localtmn_from_tain(&local, &a, islocal))
{
char fmt[LOCALTMN_FMT+1] ;
diff --git a/src/daemontools-extras/ucspilogd.c b/src/daemontools-extras/ucspilogd.c
index 6977c15..c5694d3 100644
--- a/src/daemontools-extras/ucspilogd.c
+++ b/src/daemontools-extras/ucspilogd.c
@@ -135,7 +135,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
char const *d = "<undefined>" ;
PROG = "ucspilogd" ;
{
- subgetopt_t l = SUBGETOPT_ZERO ;
+ subgetopt l = SUBGETOPT_ZERO ;
for (;;)
{
int opt = subgetopt_r(argc, argv, "D:", &l) ;