summaryrefslogtreecommitdiff
path: root/src/supervision
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2019-09-04 17:52:22 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2019-09-04 17:52:22 +0000
commit2f8e7b245b7fe187c41ea3655fce7551cfd7a48c (patch)
tree7cab69ff654641d465353e5c04d9e6d6aa813e8e /src/supervision
parenta359fda48970b7d02ef914e3f7aa0a9c9ff73f7f (diff)
downloads6-2f8e7b245b7fe187c41ea3655fce7551cfd7a48c.tar.xz
Separate wall clocks from stopwatches
Diffstat (limited to 'src/supervision')
-rw-r--r--src/supervision/s6-notifyoncheck.c1
-rw-r--r--src/supervision/s6-permafailon.c2
-rw-r--r--src/supervision/s6-supervise.c11
-rw-r--r--src/supervision/s6-svlisten.c1
-rw-r--r--src/supervision/s6-svlisten1.c1
-rw-r--r--src/supervision/s6-svscan.c1
-rw-r--r--src/supervision/s6-svstat.c2
-rw-r--r--src/supervision/s6-svwait.c1
8 files changed, 13 insertions, 7 deletions
diff --git a/src/supervision/s6-notifyoncheck.c b/src/supervision/s6-notifyoncheck.c
index b484da9..71489ea 100644
--- a/src/supervision/s6-notifyoncheck.c
+++ b/src/supervision/s6-notifyoncheck.c
@@ -140,6 +140,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
if (fcntl(fd, F_GETFD) < 0)
strerr_dief2sys(111, "notification-fd", " sanity check failed") ;
+ tain_now_set_stopwatch() ;
tain_now_g() ;
tain_add_g(&globaldeadline, &globaldeadline) ;
diff --git a/src/supervision/s6-permafailon.c b/src/supervision/s6-permafailon.c
index f242afd..91df73d 100644
--- a/src/supervision/s6-permafailon.c
+++ b/src/supervision/s6-permafailon.c
@@ -95,7 +95,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
tain_uint(&mintime, seconds) ;
{
tain_t now ;
- tain_now(&now) ;
+ tain_wallclock_read(&now) ;
tain_sub(&mintime, &now, &mintime) ;
}
diff --git a/src/supervision/s6-supervise.c b/src/supervision/s6-supervise.c
index 6dd815e..dd5025e 100644
--- a/src/supervision/s6-supervise.c
+++ b/src/supervision/s6-supervise.c
@@ -109,7 +109,7 @@ static void set_down_and_ready (char const *s, unsigned int n)
status.pid = 0 ;
status.flagfinishing = 0 ;
status.flagready = 1 ;
- tain_copynow(&status.readystamp) ;
+ tain_wallclock_read(&status.readystamp) ;
state = DOWN ;
if (tain_future(&dontrespawnbefore)) deadline = dontrespawnbefore ;
else tain_copynow(&deadline) ;
@@ -310,7 +310,7 @@ static void trystart (void)
state = UP ;
status.pid = pid ;
status.flagready = 0 ;
- tain_copynow(&status.stamp) ;
+ tain_wallclock_read(&status.stamp) ;
tain_addsec_g(&dontrespawnbefore, 1) ;
announce() ;
ftrigw_notifyb_nosig(S6_SUPERVISE_EVENTDIR, "u", 1) ;
@@ -354,7 +354,7 @@ static int uplastup_z (void)
status.flagready = 0 ;
status.flagthrottled = 0 ;
flagdying = 0 ;
- tain_copynow(&status.stamp) ;
+ tain_wallclock_read(&status.stamp) ;
if (notifyfd >= 0)
{
fd_close(notifyfd) ;
@@ -559,7 +559,7 @@ static inline void handle_notifyfd (void)
r = sanitize_read(fd_read(notifyfd, buf, 4096)) ;
if (r > 0 && memchr(buf, '\n', r))
{
- tain_copynow(&status.readystamp) ;
+ tain_wallclock_read(&status.readystamp) ;
status.flagready = 1 ;
announce() ;
ftrigw_notifyb_nosig(S6_SUPERVISE_EVENTDIR, "U", 1) ;
@@ -669,9 +669,10 @@ int main (int argc, char const *const *argv)
else if (errno != ENOENT)
strerr_diefu1sys(111, "access ./down") ;
+ tain_now_set_stopwatch() ;
tain_now_g() ;
settimeout(0) ;
- tain_copynow(&status.stamp) ;
+ tain_wallclock_read(&status.stamp) ;
status.readystamp = status.stamp ;
announce() ;
ftrigw_notifyb_nosig(S6_SUPERVISE_EVENTDIR, "s", 1) ;
diff --git a/src/supervision/s6-svlisten.c b/src/supervision/s6-svlisten.c
index e44ba87..2ce08cf 100644
--- a/src/supervision/s6-svlisten.c
+++ b/src/supervision/s6-svlisten.c
@@ -56,6 +56,7 @@ int main (int argc, char const **argv, char const *const *envp)
strerr_warnw3x("-o is unsupported when combined with -", wantready ? "R" : "r", "- using -a instead") ;
}
+ tain_now_set_stopwatch() ;
tain_now_g() ;
tain_add_g(&deadline, &tto) ;
spfd = s6_svlisten_selfpipe_init() ;
diff --git a/src/supervision/s6-svlisten1.c b/src/supervision/s6-svlisten1.c
index 69d8ac7..d38d771 100644
--- a/src/supervision/s6-svlisten1.c
+++ b/src/supervision/s6-svlisten1.c
@@ -45,6 +45,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
if (t) tain_from_millisecs(&tto, t) ; else tto = tain_infinite_relative ;
}
if (argc < 2) dieusage() ;
+ tain_now_set_stopwatch() ;
tain_now_g() ;
tain_add_g(&deadline, &tto) ;
spfd = s6_svlisten_selfpipe_init() ;
diff --git a/src/supervision/s6-svscan.c b/src/supervision/s6-svscan.c
index 4228a21..4d00743 100644
--- a/src/supervision/s6-svscan.c
+++ b/src/supervision/s6-svscan.c
@@ -520,6 +520,7 @@ int main (int argc, char const *const *argv)
{
struct svinfo_s blob[max] ; /* careful with that stack, Eugene */
services = blob ;
+ tain_now_set_stopwatch() ; /* now try a backwards clock jump, bitch */
tain_now_g() ;
diff --git a/src/supervision/s6-svstat.c b/src/supervision/s6-svstat.c
index d46c60a..7c93138 100644
--- a/src/supervision/s6-svstat.c
+++ b/src/supervision/s6-svstat.c
@@ -274,7 +274,7 @@ int main (int argc, char const *const *argv)
if (!s6_svstatus_read(argv[0], &status))
strerr_diefu2sys(111, "read status for ", argv[0]) ;
- tain_now_g() ;
+ tain_wallclock_read_g() ;
if (tain_future(&status.stamp)) tain_copynow(&status.stamp) ;
{
diff --git a/src/supervision/s6-svwait.c b/src/supervision/s6-svwait.c
index f2bd34c..cda3591 100644
--- a/src/supervision/s6-svwait.c
+++ b/src/supervision/s6-svwait.c
@@ -41,6 +41,7 @@ int main (int argc, char const *const *argv)
}
if (!argc) dieusage() ;
+ tain_now_set_stopwatch() ;
tain_now_g() ;
tain_add_g(&deadline, &tto) ;