]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/journal/journald-server.c
tree-wide: add missing whitespace at the end of comments
[thirdparty/systemd.git] / src / journal / journald-server.c
index 372acf3354060857b605c7acfc9e002b748d4896..30f04f5383451e1043a916831cb47ac36ba2e4c4 100644 (file)
@@ -144,7 +144,7 @@ static int cache_space_refresh(Server *s, JournalStorage *storage) {
 
         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);
@@ -242,7 +242,7 @@ void server_space_usage_message(Server *s, JournalStorage *storage) {
 
 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;
 }
@@ -1206,7 +1206,7 @@ finish:
         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);
 
@@ -1254,12 +1254,12 @@ int server_process_datagram(
                 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;
@@ -1302,10 +1302,10 @@ int server_process_datagram(
                             (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))
@@ -2187,7 +2187,7 @@ int server_init(Server *s, const char *namespace) {
                 .notify_fd = -1,
 
                 .compress.enabled = true,
-                .compress.threshold_bytes = (uint64_t) -1,
+                .compress.threshold_bytes = UINT64_MAX,
                 .seal = true,
 
                 .set_audit = true,
@@ -2595,7 +2595,7 @@ int config_parse_compress(
 
         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");