summaryrefslogtreecommitdiff
path: root/src/supervision/s6-permafailon.c
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2018-03-24 15:07:50 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2018-03-24 15:07:50 +0000
commit6ddb7d41b6c858f133191b0d5263120ed5222da0 (patch)
tree4358b28715ed59535a6ff5b7e8fb6061263ee83b /src/supervision/s6-permafailon.c
parenteed8f99badcf66b530bbdf245fa03fdc553380c6 (diff)
downloads6-6ddb7d41b6c858f133191b0d5263120ed5222da0.tar.xz
Fix minor bugs in s6-permafailon
Diffstat (limited to 'src/supervision/s6-permafailon.c')
-rw-r--r--src/supervision/s6-permafailon.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/supervision/s6-permafailon.c b/src/supervision/s6-permafailon.c
index db9ccb6..f242afd 100644
--- a/src/supervision/s6-permafailon.c
+++ b/src/supervision/s6-permafailon.c
@@ -93,7 +93,11 @@ int main (int argc, char const *const *argv, char const *const *envp)
}
if (r < n) goto cont ;
tain_uint(&mintime, seconds) ;
- tain_sub(&mintime, &tab[r-1].stamp, &mintime) ;
+ {
+ tain_t now ;
+ tain_now(&now) ;
+ tain_sub(&mintime, &now, &mintime) ;
+ }
for (unsigned int i = 0 ; i < r ; i++)
{
@@ -106,7 +110,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
char fmtn[UINT_FMT] ;
fmtevent[uint_fmt(fmtevent, tab[i].sig ? tab[i].sig : tab[i].exitcode)] = 0 ;
fmtseconds[uint_fmt(fmtseconds, seconds)] = 0 ;
- fmtn[uint_fmt(fmtseconds, n)] = 0 ;
+ fmtn[uint_fmt(fmtn, n)] = 0 ;
strerr_warni8x("PERMANENT FAILURE triggered after ", fmtn, " events involving ", tab[i].sig ? "signal " : "exit code ", fmtevent, " in the last ", fmtseconds, " seconds") ;
return 125 ;
}