summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2017-07-16 15:57:07 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2017-07-16 15:57:07 +0000
commitc84b8ade3f2d1349a6e4b68b1bd497b0909cfcda (patch)
treef6a3a51e47e613a0271e0296b0a80fb04816d818
parentd945bca329f7a13741e1d3afcf9f0f73f6c70ce9 (diff)
downloads6-c84b8ade3f2d1349a6e4b68b1bd497b0909cfcda.tar.xz
Propagate fd_close() changes, fix deps for ftrigr_updateb()
-rw-r--r--src/daemontools-extras/s6-log.c8
-rw-r--r--src/libs6/deps-lib/s62
-rw-r--r--src/libs6/ftrigr_wait_and.c3
-rw-r--r--src/libs6/s6_fdholder_getdump.c2
-rw-r--r--src/libs6/s6_svc_lock_take.c2
-rw-r--r--src/libs6/s6_svc_write.c2
6 files changed, 4 insertions, 15 deletions
diff --git a/src/daemontools-extras/s6-log.c b/src/daemontools-extras/s6-log.c
index c57e6d7..4a138fe 100644
--- a/src/daemontools-extras/s6-log.c
+++ b/src/daemontools-extras/s6-log.c
@@ -369,17 +369,13 @@ static int rotator (logdir_t *ldp)
}
if (coe(fd) < 0)
{
- int e = errno ;
fd_close(fd) ;
- errno = e ;
if (verbosity) strerr_warnwu2sys("coe ", x) ;
goto fail ;
}
if (fd_chmod(fd, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH) < 0)
{
- int e = errno ;
fd_close(fd) ;
- errno = e ;
if (verbosity) strerr_warnwu3sys("fchmod ", x, " to 0644") ;
goto fail ;
}
@@ -441,18 +437,14 @@ static int rotator (logdir_t *ldp)
}
if (fd_sync(fd) < 0)
{
- int e = errno ;
fd_close(fd) ;
- errno = e ;
if (verbosity) strerr_warnwu2sys("fd_sync ", x) ;
goto fail ;
}
tain_now_g() ;
if (fd_chmod(fd, S_IRWXU | S_IRGRP | S_IROTH) < 0)
{
- int e = errno ;
fd_close(fd) ;
- errno = e ;
if (verbosity) strerr_warnwu3sys("fd_chmod ", x, " to 0744") ;
goto fail ;
}
diff --git a/src/libs6/deps-lib/s6 b/src/libs6/deps-lib/s6
index 5acb672..9cb4d93 100644
--- a/src/libs6/deps-lib/s6
+++ b/src/libs6/deps-lib/s6
@@ -1,12 +1,14 @@
ftrigr1_zero.o
ftrigr_check.o
ftrigr_checksa.o
+ftrigr_ack.o
ftrigr_end.o
ftrigr_start.o
ftrigr_startf.o
ftrigr_subscribe.o
ftrigr_unsubscribe.o
ftrigr_update.o
+ftrigr_updateb.o
ftrigr_wait_and.o
ftrigr_wait_or.o
ftrigr_zero.o
diff --git a/src/libs6/ftrigr_wait_and.c b/src/libs6/ftrigr_wait_and.c
index 92080e7..dee03fd 100644
--- a/src/libs6/ftrigr_wait_and.c
+++ b/src/libs6/ftrigr_wait_and.c
@@ -19,8 +19,9 @@ int ftrigr_wait_and (ftrigr_t *a, uint16_t const *idlist, unsigned int n, tain_t
r = iopause_stamp(&x, 1, deadline, stamp) ;
if (r < 0) return r ;
else if (!r) return (errno = ETIMEDOUT, -1) ;
- else if (ftrigr_update(a) < 0) return -1 ;
+ else if (ftrigr_updateb(a) < 0) return -1 ;
}
}
+
return 1 ;
}
diff --git a/src/libs6/s6_fdholder_getdump.c b/src/libs6/s6_fdholder_getdump.c
index fb751fa..bb7fb3f 100644
--- a/src/libs6/s6_fdholder_getdump.c
+++ b/src/libs6/s6_fdholder_getdump.c
@@ -65,11 +65,9 @@ int s6_fdholder_getdump (s6_fdholder_t *a, genalloc *g, tain_t const *deadline,
errno = EPROTO ;
err:
{
- int e = errno ;
size_t j = genalloc_len(s6_fdholder_fd_t, g) ;
while (j-- > oldlen) fd_close(genalloc_s(s6_fdholder_fd_t, g)[j].fd) ;
genalloc_setlen(s6_fdholder_fd_t, g, oldlen) ;
- errno = e ;
}
return 0 ;
}
diff --git a/src/libs6/s6_svc_lock_take.c b/src/libs6/s6_svc_lock_take.c
index 57830c0..3dec282 100644
--- a/src/libs6/s6_svc_lock_take.c
+++ b/src/libs6/s6_svc_lock_take.c
@@ -19,9 +19,7 @@ int s6_svc_lock_take (char const *dir)
if (fdlock < 0) return -1 ;
if (coe(fdlock) < 0 || lock_ex(fdlock) < 0)
{
- int e = errno ;
fd_close(fdlock) ;
- errno = e ;
return -1 ;
}
return fdlock ;
diff --git a/src/libs6/s6_svc_write.c b/src/libs6/s6_svc_write.c
index ebd8ab0..3ebf3b4 100644
--- a/src/libs6/s6_svc_write.c
+++ b/src/libs6/s6_svc_write.c
@@ -12,9 +12,7 @@ int s6_svc_write (char const *fifo, char const *data, size_t datalen)
else if (ndelay_off(fd) == -1) return -1 ;
else if (fd_write(fd, data, datalen) == -1)
{
- int e = errno ;
fd_close(fd) ;
- errno = e ;
return -1 ;
}
fd_close(fd) ;