commit 296cdd194fb36e4b080690f5f24228925722bf57
parent 2f8e7b245b7fe187c41ea3655fce7551cfd7a48c
Author: Laurent Bercot <ska-skaware@skarnet.org>
Date: Fri, 6 Sep 2019 13:03:11 +0000
Adapt to new stopwatch API
Diffstat:
23 files changed, 24 insertions(+), 46 deletions(-)
diff --git a/src/conn-tools/s6-ioconnect.c b/src/conn-tools/s6-ioconnect.c
@@ -106,8 +106,7 @@ int main (int argc, char const *const *argv)
if (!iobuffer_init(&b[i], a[i][0].fd, a[i][1].fd)) strerr_diefu1sys(111, "iobuffer_init") ;
}
if (sig_ignore(SIGPIPE) == -1) strerr_diefu1sys(111, "sig_ignore") ;
- tain_now_set_stopwatch() ;
- tain_now_g() ;
+ tain_now_set_stopwatch_g() ;
x[0].fd = selfpipe_init() ;
if (x[0].fd < 0) strerr_diefu1sys(111, "selfpipe_init") ;
if (selfpipe_trap(SIGTERM) < 0)
diff --git a/src/conn-tools/s6-sudoc.c b/src/conn-tools/s6-sudoc.c
@@ -53,8 +53,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
if (!fd_sanitize() || !fd_ensure_open(2, 1))
strerr_diefu1sys(111, "sanitize stdin/stdout/stderr") ;
- tain_now_set_stopwatch() ;
- tain_now_g() ;
+ tain_now_set_stopwatch_g() ;
tain_add_g(&deadline, &deadline) ;
{
size_t r ;
diff --git a/src/conn-tools/s6-sudod.c b/src/conn-tools/s6-sudod.c
@@ -55,8 +55,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
if ((ndelay_on(0) < 0) || (ndelay_on(1) < 0))
strerr_diefu1sys(111, "make socket non-blocking") ;
- tain_now_set_stopwatch() ;
- tain_now_g() ;
+ tain_now_set_stopwatch_g() ;
tain_add_g(&deadline, &deadline) ;
buffer_putnoflush(buffer_1small, S6_SUDO_BANNERB, S6_SUDO_BANNERB_LEN) ;
if (!buffer_timed_flush_g(buffer_1small, &deadline))
diff --git a/src/daemontools-extras/s6-log.c b/src/daemontools-extras/s6-log.c
@@ -1184,8 +1184,8 @@ int main (int argc, char const *const *argv)
if (linelimit && linelimit < LINELIMIT_MIN) linelimit = LINELIMIT_MIN ;
if (compat_gflags && verbosity) strerr_warnw1x("options -t and -e are deprecated") ;
if (!fd_sanitize()) strerr_diefu1sys(111, "ensure stdin/stdout/stderr are open") ;
- tain_now_set_stopwatch() ; /* only for timeouts; wallclock is used for timestamping */
- if (!tain_now_g() && verbosity) strerr_warnwu1sys("read current time - timestamps may be wrong for a while") ;
+ if (!tain_now_set_stopwatch_g() && verbosity)
+ strerr_warnwu1sys("set monotonic clock and read current time - timestamps may be wrong for a while") ;
if (ndelay_on(0) < 0) strerr_diefu3sys(111, "set std", "in", " non-blocking") ;
if (ndelay_on(1) < 0) strerr_diefu3sys(111, "set std", "out", " non-blocking") ;
script_firstpass(argv, &sellen, &actlen, &scriptlen, &gflags) ;
diff --git a/src/daemontools-extras/s6-setlock.c b/src/daemontools-extras/s6-setlock.c
@@ -57,8 +57,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
int p[2] = { 0, 1 } ;
pid_t pid ;
char c ;
- tain_now_set_stopwatch() ;
- tain_now_g() ;
+ tain_now_set_stopwatch_g() ;
tain_from_millisecs(&deadline, timeout) ;
tain_add_g(&deadline, &deadline) ;
pid = child_spawn2(S6_LIBEXECPREFIX "s6lockd-helper", cargv, cenvp, p) ;
diff --git a/src/fdholder/s6-fdholder-delete.c b/src/fdholder/s6-fdholder-delete.c
@@ -32,8 +32,7 @@ int main (int argc, char const *const *argv)
else deadline = tain_infinite_relative ;
}
if (argc < 2) dieusage() ;
- tain_now_set_stopwatch() ;
- tain_now_g() ;
+ tain_now_set_stopwatch_g() ;
tain_add_g(&deadline, &deadline) ;
if (!s6_fdholder_start_g(&a, argv[0], &deadline))
strerr_diefu2sys(111, "connect to a fd-holder daemon at ", argv[0]) ;
diff --git a/src/fdholder/s6-fdholder-getdump.c b/src/fdholder/s6-fdholder-getdump.c
@@ -39,8 +39,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
}
if (argc < 2) dieusage() ;
- tain_now_set_stopwatch() ;
- tain_now_g() ;
+ tain_now_set_stopwatch_g() ;
tain_add_g(&deadline, &deadline) ;
if (!s6_fdholder_start_g(&a, argv[0], &deadline))
strerr_diefu2sys(111, "connect to a fd-holder daemon at ", argv[0]) ;
diff --git a/src/fdholder/s6-fdholder-list.c b/src/fdholder/s6-fdholder-list.c
@@ -40,8 +40,7 @@ int main (int argc, char const *const *argv)
}
if (!argc) dieusage() ;
- tain_now_set_stopwatch() ;
- tain_now_g() ;
+ tain_now_set_stopwatch_g() ;
tain_add_g(&deadline, &deadline) ;
if (!s6_fdholder_start_g(&a, argv[0], &deadline))
strerr_diefu2sys(111, "connect to a fd-holder daemon at ", argv[0]) ;
diff --git a/src/fdholder/s6-fdholder-retrieve.c b/src/fdholder/s6-fdholder-retrieve.c
@@ -37,8 +37,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
}
if (argc < 3) dieusage() ;
- tain_now_set_stopwatch() ;
- tain_now_g() ;
+ tain_now_set_stopwatch_g() ;
tain_add_g(&deadline, &deadline) ;
if (!s6_fdholder_start_g(&a, argv[0], &deadline))
strerr_diefu2sys(111, "connect to a fd-holder daemon at ", argv[0]) ;
diff --git a/src/fdholder/s6-fdholder-setdump.c b/src/fdholder/s6-fdholder-setdump.c
@@ -40,8 +40,7 @@ int main (int argc, char const *const *argv)
x = getenv("S6_FD#") ;
if (!x) strerr_dienotset(100, "S6_FD#") ;
if (!uint0_scan(x, &dumplen)) strerr_dieinvalid(100, "S6_FD#") ;
- tain_now_set_stopwatch() ;
- tain_now_g() ;
+ tain_now_set_stopwatch_g() ;
tain_add_g(&deadline, &deadline) ;
if (!s6_fdholder_start_g(&a, argv[0], &deadline))
strerr_diefu2sys(111, "connect to a fd-holder daemon at ", argv[0]) ;
diff --git a/src/fdholder/s6-fdholder-store.c b/src/fdholder/s6-fdholder-store.c
@@ -38,8 +38,7 @@ int main (int argc, char const *const *argv)
}
if (argc < 2) dieusage() ;
- tain_now_set_stopwatch() ;
- tain_now_g() ;
+ tain_now_set_stopwatch_g() ;
tain_add_g(&deadline, &deadline) ;
tain_add_g(&limit, &limit) ;
if (!s6_fdholder_start_g(&a, argv[0], &deadline))
diff --git a/src/fdholder/s6-fdholder-transferdump.c b/src/fdholder/s6-fdholder-transferdump.c
@@ -53,8 +53,7 @@ int main (int argc, char const *const *argv)
}
if (argc < 2) dieusage() ;
- tain_now_set_stopwatch() ;
- tain_now_g() ;
+ tain_now_set_stopwatch_g() ;
tain_add_g(&deadline, &deadline) ;
if (!s6_fdholder_start_g(&a, argv[0], &deadline))
strerr_diefu2sys(111, "connect to a source fd-holder daemon at ", argv[0]) ;
diff --git a/src/libs6/s6-ftrigrd.c b/src/libs6/s6-ftrigrd.c
@@ -201,8 +201,7 @@ int main (void)
{
tain_t deadline ;
- tain_now_set_stopwatch() ;
- tain_now_g() ;
+ tain_now_set_stopwatch_g() ;
tain_addsec_g(&deadline, 2) ;
if (!textclient_server_01x_init_g(FTRIGR_BANNER1, FTRIGR_BANNER1_LEN, FTRIGR_BANNER2, FTRIGR_BANNER2_LEN, &deadline))
strerr_diefu1sys(111, "sync with client") ;
diff --git a/src/libs6/s6lockd.c b/src/libs6/s6lockd.c
@@ -204,8 +204,7 @@ int main (int argc, char const *const *argv)
strerr_diefu1sys(111, "trap signals") ;
}
- tain_now_set_stopwatch() ;
- tain_now_g() ;
+ tain_now_set_stopwatch_g() ;
tain_addsec_g(&deadline, 2) ;
if (!textclient_server_01x_init_g(S6LOCK_BANNER1, S6LOCK_BANNER1_LEN, S6LOCK_BANNER2, S6LOCK_BANNER2_LEN, &deadline))
diff --git a/src/pipe-tools/s6-ftrig-listen.c b/src/pipe-tools/s6-ftrig-listen.c
@@ -59,8 +59,7 @@ int main (int argc, char const **argv, char const *const *envp)
argc1 = el_semicolon(argv) ;
if (!argc1 || (argc1 & 1) || (argc == argc1 + 1)) dieusage() ;
if (argc1 >= argc) strerr_dief1x(100, "unterminated fifodir+regex block") ;
- tain_now_set_stopwatch() ;
- tain_now_g() ;
+ tain_now_set_stopwatch_g() ;
tain_add_g(&deadline, &tto) ;
x[0].fd = selfpipe_init() ;
if (x[0].fd < 0) strerr_diefu1sys(111, "selfpipe_init") ;
diff --git a/src/pipe-tools/s6-ftrig-listen1.c b/src/pipe-tools/s6-ftrig-listen1.c
@@ -55,8 +55,7 @@ int main (int argc, char const *const *argv, char const *const *envp)
}
if (argc < 3) strerr_dieusage(100, USAGE) ;
- tain_now_set_stopwatch() ;
- tain_now_g() ;
+ tain_now_set_stopwatch_g() ;
tain_add_g(&deadline, &tto) ;
if (!ftrigr_startf_g(&a, &deadline)) strerr_diefu1sys(111, "ftrigr_startf") ;
diff --git a/src/pipe-tools/s6-ftrig-wait.c b/src/pipe-tools/s6-ftrig-wait.c
@@ -36,8 +36,7 @@ int main (int argc, char const *const *argv)
}
if (argc < 2) strerr_dieusage(100, USAGE) ;
- tain_now_set_stopwatch() ;
- tain_now_g() ;
+ tain_now_set_stopwatch_g() ;
tain_add_g(&deadline, &tto) ;
if (!ftrigr_startf_g(&a, &deadline)) strerr_diefu1sys(111, "ftrigr_startf") ;
diff --git a/src/supervision/s6-notifyoncheck.c b/src/supervision/s6-notifyoncheck.c
@@ -140,8 +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_now_set_stopwatch_g() ;
tain_add_g(&globaldeadline, &globaldeadline) ;
diff --git a/src/supervision/s6-supervise.c b/src/supervision/s6-supervise.c
@@ -669,8 +669,7 @@ int main (int argc, char const *const *argv)
else if (errno != ENOENT)
strerr_diefu1sys(111, "access ./down") ;
- tain_now_set_stopwatch() ;
- tain_now_g() ;
+ tain_now_set_stopwatch_g() ;
settimeout(0) ;
tain_wallclock_read(&status.stamp) ;
status.readystamp = status.stamp ;
diff --git a/src/supervision/s6-svlisten.c b/src/supervision/s6-svlisten.c
@@ -56,8 +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_now_set_stopwatch_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
@@ -45,8 +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_now_set_stopwatch_g() ;
tain_add_g(&deadline, &tto) ;
spfd = s6_svlisten_selfpipe_init() ;
s6_svlisten_init(1, argv, &foo, &id, &upstate, &readystate, &deadline) ;
diff --git a/src/supervision/s6-svscan.c b/src/supervision/s6-svscan.c
@@ -520,8 +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() ;
+ tain_now_set_stopwatch_g() ;
/* Loop phase.
diff --git a/src/supervision/s6-svwait.c b/src/supervision/s6-svwait.c
@@ -41,8 +41,7 @@ int main (int argc, char const *const *argv)
}
if (!argc) dieusage() ;
- tain_now_set_stopwatch() ;
- tain_now_g() ;
+ tain_now_set_stopwatch_g() ;
tain_add_g(&deadline, &tto) ;
{