aboutsummaryrefslogtreecommitdiffstats
path: root/logd/src
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2019-08-26 12:19:58 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2019-08-26 12:19:58 +0000
commit58cfb5e88daf7bed3f5b235325eeae5f81983a21 (patch)
treec5983a05e628d0121078bd76006c651e3c901585 /logd/src
parentdf25abf6f2498d90498ae2f84643aa1dd61fae9b (diff)
Avoid the last usages of time(0/NULL/nullptr) in the codebase.
Diffstat (limited to 'logd/src')
-rw-r--r--logd/src/logd/watcher.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/logd/src/logd/watcher.cpp b/logd/src/logd/watcher.cpp
index 103432e0136..1ef9288f4da 100644
--- a/logd/src/logd/watcher.cpp
+++ b/logd/src/logd/watcher.cpp
@@ -236,7 +236,7 @@ Watcher::watchfile()
already.st_dev = sb.st_dev;
already.st_ino = sb.st_ino;
- time_t now = time(nullptr);
+ time_t now = fastos::time();
bool wantrotate = (now > created + _confsubscriber.getRotateAge())
|| (sb.st_size > _confsubscriber.getRotateSize());
@@ -351,10 +351,10 @@ Watcher::removeOldLogs(const char *prefix)
}
if (S_ISREG(sb.st_mode)) {
if (sb.st_mtime +
- _confsubscriber.getRemoveAge() * 86400 < time(nullptr))
+ _confsubscriber.getRemoveAge() * 86400 < fastos::time())
{
LOG(info, "removing %s, too old (%f days)", fname,
- (double)(time(nullptr)-sb.st_mtime)/86400.0);
+ (double)(fastos::time()-sb.st_mtime)/86400.0);
if (unlink(fname) != 0) {
LOG(warning, "cannot remove %s: %s",