summaryrefslogtreecommitdiff
path: root/src/daemontools-extras
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2018-02-02 00:13:10 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2018-02-02 00:13:10 +0000
commitcf0efae0cb1d8129bfff8af89048e67e93bcfff3 (patch)
treee0d41b613235d34ecc4131c949fcf41ff38349e3 /src/daemontools-extras
parentae3dcffce9a7898b7836c1e4399ff4806832eb3e (diff)
downloads6-cf0efae0cb1d8129bfff8af89048e67e93bcfff3.tar.xz
cosmetic fix: print unchanged line instead of nonsense when s6-tai64nlocal can't convert time
Diffstat (limited to 'src/daemontools-extras')
-rw-r--r--src/daemontools-extras/s6-tai64nlocal.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/daemontools-extras/s6-tai64nlocal.c b/src/daemontools-extras/s6-tai64nlocal.c
index ce97470..7084abd 100644
--- 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))