ts = now(CLOCK_MONOTONIC);
- if (space->timestamp != 0 && space->timestamp + RECHECK_SPACE_USEC > ts)
+ if (space->timestamp != 0 && usec_add(space->timestamp, RECHECK_SPACE_USEC) > ts)
return 0;
r = determine_path_usage(s, storage->path, &vfs_used, &vfs_avail);
static bool uid_for_system_journal(uid_t uid) {
- /* Returns true if the specified UID shall get its data stored in the system journal*/
+ /* Returns true if the specified UID shall get its data stored in the system journal. */
return uid_is_system(uid) || uid_is_dynamic(uid) || uid == UID_NOBODY;
}
server_driver_message(s, 0, NULL,
LOG_MESSAGE("Time spent on flushing to %s is %s for %u entries.",
s->system_storage.path,
- format_timespan(ts, sizeof(ts), now(CLOCK_MONOTONIC) - start, 0),
+ format_timespan(ts, sizeof(ts), usec_sub_unsigned(now(CLOCK_MONOTONIC), start), 0),
n),
NULL);
uint32_t revents,
void *userdata) {
+ size_t label_len = 0, m;
Server *s = userdata;
struct ucred *ucred = NULL;
struct timeval *tv = NULL;
struct cmsghdr *cmsg;
char *label = NULL;
- size_t label_len = 0, m;
struct iovec iovec;
ssize_t n;
int *fds = NULL, v = 0;
(size_t) LINE_MAX,
ALIGN(sizeof(struct nlmsghdr)) + ALIGN((size_t) MAX_AUDIT_MESSAGE_LENGTH)) + 1);
- if (!GREEDY_REALLOC(s->buffer, s->buffer_size, m))
+ if (!GREEDY_REALLOC(s->buffer, m))
return log_oom();
- iovec = IOVEC_MAKE(s->buffer, s->buffer_size - 1); /* Leave room for trailing NUL we add later */
+ iovec = IOVEC_MAKE(s->buffer, MALLOC_ELEMENTSOF(s->buffer) - 1); /* Leave room for trailing NUL we add later */
n = recvmsg_safe(fd, &msghdr, MSG_DONTWAIT|MSG_CMSG_CLOEXEC);
if (IN_SET(n, -EINTR, -EAGAIN))
.notify_fd = -1,
.compress.enabled = true,
- .compress.threshold_bytes = (uint64_t) -1,
+ .compress.threshold_bytes = UINT64_MAX,
.seal = true,
.set_audit = true,
if (isempty(rvalue)) {
compress->enabled = true;
- compress->threshold_bytes = (uint64_t) -1;
+ compress->threshold_bytes = UINT64_MAX;
} else if (streq(rvalue, "1")) {
log_syntax(unit, LOG_WARNING, filename, line, 0,
"Compress= ambiguously specified as 1, enabling compression with default threshold");