diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-08-18 03:02:49 +0200 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-08-18 03:02:49 +0200 |
commit | 7a4461355f7ee8e5ec71888516cbfd640dd7e110 (patch) | |
tree | 5f800152d48de71247177c4fca93fff24dc993ac /logd | |
parent | 15e7bcd9e902407fbe14cf830968f06c9fb5fb89 (diff) |
Include only what you need.
Diffstat (limited to 'logd')
-rw-r--r-- | logd/src/logd/watch.cpp | 8 | ||||
-rw-r--r-- | logd/src/tests/forward/forward.cpp | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/logd/src/logd/watch.cpp b/logd/src/logd/watch.cpp index 0ff6510bd25..4a5e7df1474 100644 --- a/logd/src/logd/watch.cpp +++ b/logd/src/logd/watch.cpp @@ -9,9 +9,11 @@ #include "perform.h" #include "cmdbuf.h" #include <glob.h> +#include <unistd.h> +#include <fcntl.h> +#include <sys/stat.h> LOG_SETUP(""); -LOG_RCSID("$Id$"); namespace logdemon { namespace { @@ -283,7 +285,7 @@ Watcher::watchfile() { removeOldLogs(filename); if (sb.st_size != offset) { - LOG(warning, "logfile rotation incomplete after %d s (dropping %" PRIu64 " bytes)", + LOG(warning, "logfile rotation incomplete after %d s (dropping %lu bytes)", rotTime, sb.st_size - offset); } else { LOG(debug, "logfile rotation complete after %d s", rotTime); @@ -412,7 +414,7 @@ Watcher::removeOldLogs(const char *prefix) if (totalsize > (_confsubscriber.getRemoveMegabytes() * 1048576LL)) { - LOG(info, "removing %s, total size (%" PRId64 ") too big", + LOG(info, "removing %s, total size (%ld) too big", fname, static_cast<int64_t>(totalsize)); if (unlink(fname) != 0) { LOG(warning, "cannot remove %s: %s", diff --git a/logd/src/tests/forward/forward.cpp b/logd/src/tests/forward/forward.cpp index 6a9a8668e9b..13e31cea464 100644 --- a/logd/src/tests/forward/forward.cpp +++ b/logd/src/tests/forward/forward.cpp @@ -3,6 +3,8 @@ #include <vespa/vespalib/testkit/testapp.h> #include <logd/forward.h> #include <sstream> +#include <fcntl.h> +#include <unistd.h> using ns_log::Logger; using namespace logdemon; |