summaryrefslogtreecommitdiff
path: root/src/libs6rc/s6rc_servicedir_manage.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs6rc/s6rc_servicedir_manage.c')
-rw-r--r--src/libs6rc/s6rc_servicedir_manage.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/libs6rc/s6rc_servicedir_manage.c b/src/libs6rc/s6rc_servicedir_manage.c
index 795c982..c665564 100644
--- a/src/libs6rc/s6rc_servicedir_manage.c
+++ b/src/libs6rc/s6rc_servicedir_manage.c
@@ -1,10 +1,10 @@
/* ISC license. */
#include <sys/types.h>
+#include <stdint.h>
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
-#include <skalibs/uint16.h>
#include <skalibs/bytestr.h>
#include <skalibs/tai.h>
#include <skalibs/direntry.h>
@@ -16,11 +16,11 @@
#include <s6/ftrigw.h>
#include <s6-rc/s6rc-servicedir.h>
-static void rollback (char const *live, char const *s, unsigned int len)
+static void rollback (char const *live, char const *s, size_t len)
{
while (len)
{
- unsigned int n = str_len(s) + 1 ;
+ size_t n = str_len(s) + 1 ;
s6rc_servicedir_unsupervise(live, s, 0) ;
s += n ; len -= n ;
}
@@ -30,9 +30,9 @@ int s6rc_servicedir_manage (char const *live, tain_t const *deadline, tain_t *st
{
ftrigr_t a = FTRIGR_ZERO ;
stralloc newnames = STRALLOC_ZERO ;
- genalloc ids = GENALLOC_ZERO ; /* uint16 */
+ genalloc ids = GENALLOC_ZERO ; /* uint16_t */
gid_t gid = getgid() ;
- unsigned int livelen = str_len(live) ;
+ size_t livelen = str_len(live) ;
int ok = 1 ;
int e = 0 ;
DIR *dir ;
@@ -50,9 +50,9 @@ int s6rc_servicedir_manage (char const *live, tain_t const *deadline, tain_t *st
if (!d) break ;
if (d->d_name[0] == '.') continue ;
{
- unsigned int len = str_len(d->d_name) ;
+ size_t len = str_len(d->d_name) ;
int r ;
- uint16 id ;
+ uint16_t id ;
char srcfn[livelen + 20 + len] ;
char dstfn[livelen + 10 + len] ;
byte_copy(srcfn, livelen + 12, dirfn) ;
@@ -99,12 +99,12 @@ int s6rc_servicedir_manage (char const *live, tain_t const *deadline, tain_t *st
r = s6_svc_writectl(scanfn, S6_SVSCAN_CTLDIR, "a", 1) ;
if (r < 0) { e = errno ; goto closederr ; }
if (!r) ok = 3 ;
- else if (ftrigr_wait_and(&a, genalloc_s(uint16, &ids), genalloc_len(uint16, &ids), deadline, stamp) < 0)
+ else if (ftrigr_wait_and(&a, genalloc_s(uint16_t, &ids), genalloc_len(uint16_t, &ids), deadline, stamp) < 0)
{ e = errno ; goto closederr ; }
}
ftrigr_end(&a) ;
- genalloc_free(uint16, &ids) ;
+ genalloc_free(uint16_t, &ids) ;
stralloc_free(&newnames) ;
return ok ;
@@ -112,7 +112,7 @@ int s6rc_servicedir_manage (char const *live, tain_t const *deadline, tain_t *st
dir_close(dir) ;
closederr:
ftrigr_end(&a) ;
- genalloc_free(uint16, &ids) ;
+ genalloc_free(uint16_t, &ids) ;
rollback(live, newnames.s, newnames.len) ;
stralloc_free(&newnames) ;
errno = e ;