diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-03-12 11:59:43 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-03-12 11:59:43 +0000 |
commit | c60ebd422171808ad58b936914055397bb205bef (patch) | |
tree | 7db3e5728d72ad209f8e22b9eb9f337e0b0c3e58 /src/fdholder/s6-fdholder-daemon.c | |
parent | e28fe5908a91d8795ca9923d64eeed7d3e898434 (diff) | |
download | s6-c60ebd422171808ad58b936914055397bb205bef.tar.xz |
Adapt to skalibs-2.5.0.0
Diffstat (limited to 'src/fdholder/s6-fdholder-daemon.c')
-rw-r--r-- | src/fdholder/s6-fdholder-daemon.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/fdholder/s6-fdholder-daemon.c b/src/fdholder/s6-fdholder-daemon.c index 0a706da..0a0f019 100644 --- a/src/fdholder/s6-fdholder-daemon.c +++ b/src/fdholder/s6-fdholder-daemon.c @@ -2,8 +2,7 @@ #include <sys/types.h> #include <limits.h> -#include <skalibs/uint.h> -#include <skalibs/gidstuff.h> +#include <skalibs/types.h> #include <skalibs/sgetopt.h> #include <skalibs/strerr2.h> #include <skalibs/djbunix.h> @@ -20,7 +19,7 @@ int main (int argc, char const *const *argv, char const *const *envp) int flagreuse = 1 ; unsigned int uid = 0, gid = 0 ; gid_t gids[NGROUPS_MAX] ; - unsigned int gidn = (unsigned int)-1 ; + size_t gidn = (size_t)-1 ; unsigned int maxconn = 0 ; unsigned int maxfds = 0 ; unsigned int backlog = (unsigned int)-1 ; @@ -33,7 +32,7 @@ int main (int argc, char const *const *argv, char const *const *envp) subgetopt_t l = SUBGETOPT_ZERO ; for (;;) { - register int opt = subgetopt_r(argc, argv, "Dd1Uv:c:n:b:u:g:G:t:T:i:x:", &l) ; + int opt = subgetopt_r(argc, argv, "Dd1Uv:c:n:b:u:g:G:t:T:i:x:", &l) ; if (opt == -1) break ; switch (opt) { @@ -47,7 +46,7 @@ int main (int argc, char const *const *argv, char const *const *envp) case 'u' : if (!uint0_scan(l.arg, &uid)) dieusage() ; break ; case 'g' : if (!uint0_scan(l.arg, &gid)) dieusage() ; break ; case 'G' : if (!gid_scanlist(gids, NGROUPS_MAX, l.arg, &gidn) && *l.arg) dieusage() ; break ; - case 'U' : flagU = 1 ; uid = 0 ; gid = 0 ; gidn = (unsigned int)-1 ; break ; + case 'U' : flagU = 1 ; uid = 0 ; gid = 0 ; gidn = (size_t)-1 ; break ; case 't' : if (!uint0_scan(l.arg, &timeout)) dieusage() ; break ; case 'T' : if (!uint0_scan(l.arg, <imeout)) dieusage() ; break ; case 'i' : rulesdir = l.arg ; rulesfile = 0 ; break ; @@ -76,7 +75,7 @@ int main (int argc, char const *const *argv, char const *const *envp) } newargv[m++] = "--" ; newargv[m++] = *argv++ ; - if (flagU || uid || gid || gidn != (unsigned int)-1) + if (flagU || uid || gid || gidn != (size_t)-1) { newargv[m++] = S6_BINPREFIX "s6-applyuidgid" ; if (flagU) newargv[m++] = "-Uz" ; @@ -94,7 +93,7 @@ int main (int argc, char const *const *argv, char const *const *envp) pos += uint_fmt(fmt + pos, gid) ; fmt[pos++] = 0 ; } - if (gidn != (unsigned int)-1) + if (gidn != (size_t)-1) { newargv[m++] = "-G" ; newargv[m++] = fmt + pos ; |