From 58cfb5e88daf7bed3f5b235325eeae5f81983a21 Mon Sep 17 00:00:00 2001 From: Henning Baldersheim Date: Mon, 26 Aug 2019 12:19:58 +0000 Subject: Avoid the last usages of time(0/NULL/nullptr) in the codebase. --- logd/src/logd/watcher.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'logd') 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", -- cgit v1.2.3