diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2019-08-26 12:19:58 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2019-08-26 12:19:58 +0000 |
commit | 58cfb5e88daf7bed3f5b235325eeae5f81983a21 (patch) | |
tree | c5983a05e628d0121078bd76006c651e3c901585 /configd/src/apps/sentinel/service.cpp | |
parent | df25abf6f2498d90498ae2f84643aa1dd61fae9b (diff) |
Avoid the last usages of time(0/NULL/nullptr) in the codebase.
Diffstat (limited to 'configd/src/apps/sentinel/service.cpp')
-rw-r--r-- | configd/src/apps/sentinel/service.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/configd/src/apps/sentinel/service.cpp b/configd/src/apps/sentinel/service.cpp index 941ea690024..22f9681a2ff 100644 --- a/configd/src/apps/sentinel/service.cpp +++ b/configd/src/apps/sentinel/service.cpp @@ -4,6 +4,7 @@ #include "output-connection.h" #include <vespa/vespalib/util/stringfmt.h> #include <vespa/vespalib/util/signalhandler.h> +#include <vespa/fastos/timestamp.h> #include <csignal> #include <unistd.h> @@ -156,7 +157,7 @@ Service::start() LOG(warning, "tried to start '%s' in REMOVING state", name().c_str()); return; } - time_t now = time(0); + time_t now = fastos::time(); _last_start = now; // make a pipe, close the good ends of it, mark it close-on-exec @@ -322,7 +323,7 @@ Service::youExited(int status) if (! expectedDeath) { // make sure the service does not restart in a tight loop: - time_t now = time(0); + time_t now = fastos::time(); unsigned int diff = now - _last_start; if (diff < MAX_RESTART_PENALTY) { incrementRestartPenalty(); @@ -420,7 +421,7 @@ bool Service::wantsRestart() const { if (_state == RESTARTING) { - time_t now = time(0); + time_t now = fastos::time(); if (now > _last_start + _restartPenalty) { return true; } |