summaryrefslogtreecommitdiff
path: root/src/daemontools-extras/s6-tai64n.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/daemontools-extras/s6-tai64n.c
parente28fe5908a91d8795ca9923d64eeed7d3e898434 (diff)
downloads6-c60ebd422171808ad58b936914055397bb205bef.tar.xz
Adapt to skalibs-2.5.0.0
Diffstat (limited to 'src/daemontools-extras/s6-tai64n.c')
-rw-r--r--src/daemontools-extras/s6-tai64n.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/daemontools-extras/s6-tai64n.c b/src/daemontools-extras/s6-tai64n.c
index 085c053..c6b2859 100644
--- a/src/daemontools-extras/s6-tai64n.c
+++ b/src/daemontools-extras/s6-tai64n.c
@@ -1,5 +1,6 @@
/* ISC license. */
+#include <sys/types.h>
#include <errno.h>
#include <skalibs/buffer.h>
#include <skalibs/strerr2.h>
@@ -14,7 +15,7 @@ int main (void)
stamp[TIMESTAMP] = ' ' ;
for (;;)
{
- register int r = skagetln(buffer_0f1, &satmp, '\n') ;
+ int r = skagetln(buffer_0f1, &satmp, '\n') ;
if (r < 0)
if (errno != EPIPE)
strerr_diefu1sys(111, "read from stdin") ;
@@ -26,8 +27,8 @@ int main (void)
}
else if (!r) break ;
timestamp(stamp) ;
- if ((buffer_put(buffer_1, stamp, TIMESTAMP+1) < 0)
- || (buffer_put(buffer_1, satmp.s, satmp.len) < 0))
+ if ((buffer_put(buffer_1, stamp, TIMESTAMP+1) < TIMESTAMP+1)
+ || (buffer_put(buffer_1, satmp.s, satmp.len) < (ssize_t)satmp.len))
strerr_diefu1sys(111, "write to stdout") ;
satmp.len = 0 ;
}