summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--INSTALL2
-rw-r--r--NEWS3
-rw-r--r--doc/index.html2
-rw-r--r--doc/upgrade.html2
-rw-r--r--src/libs6rc/s6rc_servicedir_block.c6
-rw-r--r--src/libs6rc/s6rc_servicedir_manage.c27
-rw-r--r--src/libs6rc/s6rc_servicedir_unsupervise.c6
-rw-r--r--src/s6-rc/s6-rc-bundle.c5
8 files changed, 23 insertions, 30 deletions
diff --git a/INSTALL b/INSTALL
index 23cd8a6..089a9d7 100644
--- a/INSTALL
+++ b/INSTALL
@@ -6,7 +6,7 @@ Build Instructions
- A POSIX-compliant C development environment
- GNU make version 3.81 or later
- - skalibs version 2.6.4.0 or later: http://skarnet.org/software/skalibs/
+ - skalibs version 2.7.0.0 or later: http://skarnet.org/software/skalibs/
- execline version 2.5.0.0 or later: http://skarnet.org/software/execline/
- s6 version 2.7.2.0 or later: http://skarnet.org/software/s6/
diff --git a/NEWS b/NEWS
index 23c13d1..602f522 100644
--- a/NEWS
+++ b/NEWS
@@ -3,8 +3,9 @@ Changelog for s6-rc.
In 0.4.1.0
----------
+ - Adaptation to skalibs-2.7.0.0 and s6-2.7.2.0.
- Support for max-death-tally and down-signal files in a
-longrun definition directory
+longrun definition directory.
In 0.4.0.1
diff --git a/doc/index.html b/doc/index.html
index 8fd943c..c53bd01 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -48,7 +48,7 @@ scripts are also run in a controlled environment.
<li> A POSIX-compliant system with a standard C development environment </li>
<li> GNU make, version 3.81 or later </li>
<li> <a href="//skarnet.org/software/skalibs/">skalibs</a> version
-2.6.4.0 or later </li>
+2.7.0.0 or later </li>
<li> <a href="//skarnet.org/software/execline/">execline</a> version
2.5.0.0 or later </li>
<li> <a href="//skarnet.org/software/s6/">s6</a> version
diff --git a/doc/upgrade.html b/doc/upgrade.html
index 92fd2fa..ae526d6 100644
--- a/doc/upgrade.html
+++ b/doc/upgrade.html
@@ -33,6 +33,8 @@ minor and bugfix version changes.
<h2> in 0.4.1.0 </h2>
<ul>
+ <li> <a href="//skarnet.org/software/skalibs/">skalibs</a>
+dependency bumped to 2.7.0.0. </li>
<li> <a href="//skarnet.org/software/execline/">execline</a>
dependency bumped to 2.5.0.0. </li>
<li> <a href="//skarnet.org/software/s6/">s6</a>
diff --git a/src/libs6rc/s6rc_servicedir_block.c b/src/libs6rc/s6rc_servicedir_block.c
index a7e2b12..bfa6440 100644
--- a/src/libs6rc/s6rc_servicedir_block.c
+++ b/src/libs6rc/s6rc_servicedir_block.c
@@ -1,8 +1,8 @@
/* ISC license. */
#include <string.h>
-#include <errno.h>
#include <unistd.h>
+#include <skalibs/posixplz.h>
#include <skalibs/djbunix.h>
#include <s6/s6-supervise.h>
#include <s6-rc/s6rc-servicedir.h>
@@ -18,9 +18,7 @@ int s6rc_servicedir_block (char const *dir)
if (!touch(fn)) return -1 ;
if (s6_svc_writectl(dir, S6_SUPERVISE_CTLDIR, "O", 1) < 0)
{
- int e = errno ;
- unlink(fn) ;
- errno = e ;
+ unlink_void(fn) ;
return -1 ;
}
return status.flagwantup ;
diff --git a/src/libs6rc/s6rc_servicedir_manage.c b/src/libs6rc/s6rc_servicedir_manage.c
index 940582c..5449f35 100644
--- a/src/libs6rc/s6rc_servicedir_manage.c
+++ b/src/libs6rc/s6rc_servicedir_manage.c
@@ -31,8 +31,8 @@ int s6rc_servicedir_manage (char const *live, char const *prefix, tain_t const *
gid_t gid = getgid() ;
size_t livelen = strlen(live) ;
size_t prefixlen = strlen(prefix) ;
+ int fdlock ;
int ok = 1 ;
- int e = 0 ;
DIR *dir ;
char dirfn[livelen + 13] ;
if (!ftrigr_startf(&a, deadline, stamp)) return 0 ;
@@ -49,7 +49,6 @@ int s6rc_servicedir_manage (char const *live, char const *prefix, tain_t const *
if (d->d_name[0] == '.') continue ;
{
size_t len = strlen(d->d_name) ;
- int fdlock ;
int r ;
uint16_t id ;
char srcfn[livelen + 20 + len] ;
@@ -60,15 +59,15 @@ int s6rc_servicedir_manage (char const *live, char const *prefix, tain_t const *
fdlock = s6_svc_lock_take(srcfn) ;
if (fdlock < 0) goto err ;
r = s6_svc_ok(srcfn) ;
- if (r < 0) goto errinloop ;
+ if (r < 0) goto erru ;
if (!r)
{
memcpy(srcfn + livelen + 13 + len, "/down", 6) ;
- if (!touch(srcfn)) goto errinloop ;
+ if (!touch(srcfn)) goto erru ;
memcpy(srcfn + livelen + 14 + len, "event", 6) ;
- if (!ftrigw_fifodir_make(srcfn, gid, 0)) goto errinloop ;
+ if (!ftrigw_fifodir_make(srcfn, gid, 0)) goto erru ;
id = ftrigr_subscribe(&a, srcfn, "s", 0, deadline, stamp) ;
- if (!id) goto errinloop ;
+ if (!id) goto erru ;
s6_svc_lock_release(fdlock) ;
if (!genalloc_append(uint16_t, &ids, &id)) goto err ;
srcfn[livelen + 13 + len] = 0 ;
@@ -86,16 +85,10 @@ int s6rc_servicedir_manage (char const *live, char const *prefix, tain_t const *
{
if (!stralloc_catb(&newnames, d->d_name, len + 1))
{
- e = errno ;
s6rc_servicedir_unsupervise(live, prefix, d->d_name, 0) ;
- goto errn ;
+ goto err ;
}
}
- continue ;
- errinloop:
- e = errno ;
- s6_svc_lock_release(fdlock) ;
- goto errn ;
}
}
if (errno) goto err ;
@@ -117,18 +110,14 @@ int s6rc_servicedir_manage (char const *live, char const *prefix, tain_t const *
stralloc_free(&newnames) ;
return ok ;
+ erru:
+ s6_svc_lock_release(fdlock) ;
err:
- e = errno ;
- errn:
dir_close(dir) ;
- goto closederrn ;
closederr:
- e = errno ;
- closederrn:
ftrigr_end(&a) ;
genalloc_free(uint16_t, &ids) ;
rollback(live, prefix, newnames.s, newnames.len) ;
stralloc_free(&newnames) ;
- errno = e ;
return 0 ;
}
diff --git a/src/libs6rc/s6rc_servicedir_unsupervise.c b/src/libs6rc/s6rc_servicedir_unsupervise.c
index 5db127b..2d15a70 100644
--- a/src/libs6rc/s6rc_servicedir_unsupervise.c
+++ b/src/libs6rc/s6rc_servicedir_unsupervise.c
@@ -1,7 +1,9 @@
/* ISC license. */
+#include <errno.h>
#include <string.h>
#include <unistd.h>
+#include <skalibs/posixplz.h>
#include <s6/s6-supervise.h>
#include <s6-rc/s6rc-servicedir.h>
@@ -15,11 +17,13 @@ void s6rc_servicedir_unsupervise (char const *live, char const *prefix, char con
memcpy(fn + livelen, "/scandir/", 9) ;
memcpy(fn + livelen + 9, prefix, prefixlen) ;
memcpy(fn + livelen + 9 + prefixlen, name, namelen + 1) ;
- unlink(fn) ;
+ unlink_void(fn) ;
if (!keepsupervisor)
{
+ int e = errno ;
memcpy(fn + livelen + 1, "servicedirs/", 12) ;
memcpy(fn + livelen + 13, name, namelen + 1) ;
s6_svc_writectl(fn, S6_SUPERVISE_CTLDIR, "x", 1) ;
+ errno = e ;
}
}
diff --git a/src/s6-rc/s6-rc-bundle.c b/src/s6-rc/s6-rc-bundle.c
index f54ea7e..59d5dfb 100644
--- a/src/s6-rc/s6-rc-bundle.c
+++ b/src/s6-rc/s6-rc-bundle.c
@@ -5,6 +5,7 @@
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
+#include <skalibs/posixplz.h>
#include <skalibs/uint32.h>
#include <skalibs/buffer.h>
#include <skalibs/strerr2.h>
@@ -24,12 +25,10 @@
static void cleanup (char const *compiled)
{
size_t len = strlen(compiled) ;
- int e = errno ;
char fn[len + sizeof("/resolve.cdb.new")] ;
memcpy(fn, compiled, len) ;
memcpy(fn + len, "/resolve.cdb.new", sizeof("/resolve.cdb.new")) ;
- unlink(fn) ;
- errno = e ;
+ unlink_void(fn) ;
}