diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2020-12-07 18:04:24 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2020-12-07 18:04:24 +0000 |
commit | fddebb529fb620a9e038340fc554ec2e543802be (patch) | |
tree | c1fb780afb9fbe01008a7ec7f37379e139065fef /src/libs6/s6_supervise_unlink.c | |
parent | 1543bbf0f786628dd49eb8acb56fc7904cf54670 (diff) | |
download | s6-fddebb529fb620a9e038340fc554ec2e543802be.tar.xz |
Do not use 'scandir' as a variable name, thanks posix
Diffstat (limited to 'src/libs6/s6_supervise_unlink.c')
-rw-r--r-- | src/libs6/s6_supervise_unlink.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/libs6/s6_supervise_unlink.c b/src/libs6/s6_supervise_unlink.c index d4bbe73..36d765b 100644 --- a/src/libs6/s6_supervise_unlink.c +++ b/src/libs6/s6_supervise_unlink.c @@ -17,24 +17,24 @@ # define S6_PATH_MAX 4096 #endif -void s6_supervise_unlink (char const *scandir, char const *name, uint32_t options) +void s6_supervise_unlink (char const *scdir, char const *name, uint32_t options) { int e = errno ; int fd = -1 ; - size_t scandirlen = strlen(scandir) ; + size_t scdirlen = strlen(scdir) ; size_t namelen = strlen(name) ; - char fn[scandirlen + namelen + sizeof(S6_SUPERVISE_CTLDIR) + 10] ; - memcpy(fn, scandir, scandirlen) ; - fn[scandirlen] = '/' ; - memcpy(fn + scandirlen + 1, name, namelen) ; + char fn[scdirlen + namelen + sizeof(S6_SUPERVISE_CTLDIR) + 10] ; + memcpy(fn, scdir, scdirlen) ; + fn[scdirlen] = '/' ; + memcpy(fn + scdirlen + 1, name, namelen) ; if (options & 1) { - fn[scandirlen + 1 + namelen] = '/' ; - memcpy(fn + scandirlen + 1 + namelen + 1, S6_SUPERVISE_CTLDIR, sizeof(S6_SUPERVISE_CTLDIR) - 1) ; - memcpy(fn + scandirlen + 1 + namelen + sizeof(S6_SUPERVISE_CTLDIR), "/control", 9) ; + fn[scdirlen + 1 + namelen] = '/' ; + memcpy(fn + scdirlen + 1 + namelen + 1, S6_SUPERVISE_CTLDIR, sizeof(S6_SUPERVISE_CTLDIR) - 1) ; + memcpy(fn + scdirlen + 1 + namelen + sizeof(S6_SUPERVISE_CTLDIR), "/control", 9) ; fd = open_write(fn) ; } - fn[scandirlen + 1 + namelen] = 0 ; + fn[scdirlen + 1 + namelen] = 0 ; unlink_void(fn) ; if (fd >= 0) { |