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 /logd/src | |
parent | df25abf6f2498d90498ae2f84643aa1dd61fae9b (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.cpp | 6 |
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", |