about summary refs log tree commit diff
path: root/src/libs6/s6_supervise_link.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2020-12-07 18:04:24 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2020-12-07 18:04:24 +0000
commitfddebb529fb620a9e038340fc554ec2e543802be (patch)
treec1fb780afb9fbe01008a7ec7f37379e139065fef /src/libs6/s6_supervise_link.c
parent1543bbf0f786628dd49eb8acb56fc7904cf54670 (diff)
downloads6-fddebb529fb620a9e038340fc554ec2e543802be.tar.gz
s6-fddebb529fb620a9e038340fc554ec2e543802be.tar.xz
s6-fddebb529fb620a9e038340fc554ec2e543802be.zip
Do not use 'scandir' as a variable name, thanks posix
Diffstat (limited to 'src/libs6/s6_supervise_link.c')
-rw-r--r--src/libs6/s6_supervise_link.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/libs6/s6_supervise_link.c b/src/libs6/s6_supervise_link.c
index 7d97f4a..118d66c 100644
--- a/src/libs6/s6_supervise_link.c
+++ b/src/libs6/s6_supervise_link.c
@@ -16,7 +16,7 @@
 #include <s6/ftrigw.h>
 #include <s6/s6-supervise.h>
 
-static inline void do_unlink (char const *scandir, char const *prefix, size_t prefixlen, size_t maxlen, char const *names, size_t nameslen, uint32_t killopts)
+static inline void do_unlink (char const *scdir, char const *prefix, size_t prefixlen, size_t maxlen, char const *names, size_t nameslen, uint32_t killopts)
 {
   char fn[prefixlen + maxlen + 1] ;
   memcpy(fn, prefix, prefixlen) ;
@@ -24,12 +24,12 @@ static inline void do_unlink (char const *scandir, char const *prefix, size_t pr
   {
     size_t len = strlen(names) + 1 ;
     memcpy(fn + prefixlen, names, len) ;
-    s6_supervise_unlink(scandir, fn, killopts) ;
+    s6_supervise_unlink(scdir, fn, killopts) ;
     names += len ; nameslen -= len ;
   }
 }
 
-int s6_supervise_link (char const *scandir, 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_t const *deadline, tain_t *stamp)
 {
   size_t maxlen = 0 ;
   size_t ntotal = n ;
@@ -72,7 +72,7 @@ int s6_supervise_link (char const *scandir, char const *const *servicedirs, size
     stralloc rpsa = STRALLOC_ZERO ;
     stralloc lnames = STRALLOC_ZERO ;
     gid_t gid = options & 2 ? -1 : getegid() ;
-    size_t scandirlen = strlen(scandir) ;
+    size_t scdirlen = strlen(scdir) ;
     size_t prefixlen = strlen(prefix) ;
     unsigned int m = 0 ;
     size_t i = 0 ;
@@ -80,12 +80,12 @@ int s6_supervise_link (char const *scandir, char const *const *servicedirs, size
     uint32_t killopts = 0 ;
     int r ;
     uint16_t ids[ntotal] ;
-    char lname[scandirlen + prefixlen + maxlen + 2] ;
+    char lname[scdirlen + prefixlen + maxlen + 2] ;
     char fn[maxlen + 5 + sizeof(S6_SUPERVISE_EVENTDIR)] ;
     if (!ftrigr_startf(&a, deadline, stamp)) return -1 ;
-    memcpy(lname, scandir, scandirlen) ;
-    lname[scandirlen] = '/' ;
-    memcpy(lname + scandirlen + 1, prefix, prefixlen) ;
+    memcpy(lname, scdir, scdirlen) ;
+    lname[scdirlen] = '/' ;
+    memcpy(lname + scdirlen + 1, prefix, prefixlen) ;
     for (i = 0 ; i < n ; i++) if (!bitarray_peek(locked, i))
     {
       char *p ;
@@ -106,7 +106,7 @@ int s6_supervise_link (char const *scandir, char const *const *servicedirs, size
       fn[len] = 0 ;
       p = basename(fn) ;
       len = strlen(p) ;
-      memcpy(lname + scandirlen + 1 + prefixlen, p, len + 1) ;
+      memcpy(lname + scdirlen + 1 + prefixlen, p, len + 1) ;
       rpsa.len = 0 ;
       lstart = lnames.len ;
       if (!sarealpath(&rpsa, servicedirs[i]) || !stralloc_0(&rpsa)) goto err ;
@@ -114,7 +114,7 @@ int s6_supervise_link (char const *scandir, char const *const *servicedirs, size
       if (symlink(rpsa.s, lname) < 0) goto errl ;
     }
     stralloc_free(&rpsa) ;
-    r = s6_svc_writectl(scandir, S6_SVSCAN_CTLDIR, "a", 1) ;
+    r = s6_svc_writectl(scdir, S6_SVSCAN_CTLDIR, "a", 1) ;
     if (r <= 0) goto errsa ;
     killopts = 3 ;
     if (ftrigr_wait_and(&a, ids, m, deadline, stamp) < 0) goto errsa ;
@@ -128,7 +128,7 @@ int s6_supervise_link (char const *scandir, char const *const *servicedirs, size
     stralloc_free(&rpsa) ;
    errsa:
     ftrigr_end(&a) ;
-    do_unlink(scandir, prefix, prefixlen, maxlen, lnames.s, lnames.len, killopts) ;
+    do_unlink(scdir, prefix, prefixlen, maxlen, lnames.s, lnames.len, killopts) ;
     stralloc_free(&lnames) ;
     return -1 ;
   }