summaryrefslogtreecommitdiff
path: root/src/conn-tools/s6-connlimit.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-03-12 11:59:43 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-03-12 11:59:43 +0000
commitc60ebd422171808ad58b936914055397bb205bef (patch)
tree7db3e5728d72ad209f8e22b9eb9f337e0b0c3e58 /src/conn-tools/s6-connlimit.c
parente28fe5908a91d8795ca9923d64eeed7d3e898434 (diff)
downloads6-c60ebd422171808ad58b936914055397bb205bef.tar.xz
Adapt to skalibs-2.5.0.0
Diffstat (limited to 'src/conn-tools/s6-connlimit.c')
-rw-r--r--src/conn-tools/s6-connlimit.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/conn-tools/s6-connlimit.c b/src/conn-tools/s6-connlimit.c
index 903a777..d7d48c9 100644
--- a/src/conn-tools/s6-connlimit.c
+++ b/src/conn-tools/s6-connlimit.c
@@ -1,8 +1,7 @@
/* ISC license. */
-#include <sys/types.h>
-#include <skalibs/uint.h>
-#include <skalibs/bytestr.h>
+#include <string.h>
+#include <skalibs/types.h>
#include <skalibs/strerr2.h>
#include <skalibs/env.h>
#include <skalibs/djbunix.h>
@@ -14,17 +13,17 @@ int main (int argc, char const *const *argv, char const *const *envp)
PROG = "s6-connlimit" ;
x = env_get2(envp, "PROTO") ;
if (!x) strerr_dienotset(100, "PROTO") ;
- protolen = str_len(x) ;
+ protolen = strlen(x) ;
if (!protolen) strerr_dief1x(100, "empty PROTO") ;
{
unsigned int num ;
char s[protolen + 8] ;
- byte_copy(s, protolen, x) ;
- byte_copy(s + protolen, 8, "CONNNUM") ;
+ memcpy(s, x, protolen) ;
+ memcpy(s + protolen, "CONNNUM", 8) ;
x = env_get2(envp, s) ;
if (!x) strerr_dienotset(100, s) ;
if (!uint0_scan(x, &num)) strerr_dief2x(100, "invalid ", s) ;
- byte_copy(s + protolen + 4, 4, "MAX") ;
+ memcpy(s + protolen + 4, "MAX", 4) ;
x = env_get2(envp, s) ;
if (x)
{