commit cf0efae0cb1d8129bfff8af89048e67e93bcfff3
parent ae3dcffce9a7898b7836c1e4399ff4806832eb3e
Author: Laurent Bercot <ska-skaware@skarnet.org>
Date: Fri, 2 Feb 2018 00:13:10 +0000
cosmetic fix: print unchanged line instead of nonsense when s6-tai64nlocal can't convert time
Diffstat:
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/src/daemontools-extras/s6-tai64nlocal.c b/src/daemontools-extras/s6-tai64nlocal.c
@@ -27,13 +27,15 @@ int main (void)
p = timestamp_scan(satmp.s, &a) ;
if (p)
{
- char fmt[LOCALTMN_FMT+1] ;
localtmn_t local ;
- size_t len ;
- localtmn_from_tain(&local, &a, 1) ;
- len = localtmn_fmt(fmt, &local) ;
- if (buffer_put(buffer_1, fmt, len) < (ssize_t)len)
- strerr_diefu1sys(111, "write to stdout") ;
+ if (localtmn_from_tain(&local, &a, 1))
+ {
+ char fmt[LOCALTMN_FMT+1] ;
+ size_t len = localtmn_fmt(fmt, &local) ;
+ if (buffer_put(buffer_1, fmt, len) < (ssize_t)len)
+ strerr_diefu1sys(111, "write to stdout") ;
+ }
+ else p = 0 ;
}
}
if (buffer_put(buffer_1, satmp.s + p, satmp.len - p) < (ssize_t)(satmp.len - p))