]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal: make use of IOVEC_MAKE() where it makes sense
authorLennart Poettering <lennart@poettering.net>
Mon, 30 Oct 2017 18:54:13 +0000 (19:54 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 16 Nov 2017 11:40:17 +0000 (12:40 +0100)
src/journal/journald-audit.c
src/journal/journald-native.c

index 3334418f33dc7cee9dbe0e05c74a6c16e74c443a..f79983d165818e40511a6f489a622ec189725aab 100644 (file)
@@ -61,9 +61,7 @@ static int map_simple_field(const char *field, const char **p, struct iovec **io
         if (!GREEDY_REALLOC(*iov, *n_iov_allocated, *n_iov + 1))
                 return -ENOMEM;
 
-        (*iov)[*n_iov].iov_base = c;
-        (*iov)[*n_iov].iov_len = l;
-        (*n_iov)++;
+        (*iov)[(*n_iov)++] = IOVEC_MAKE(c, l);
 
         *p = e;
         c = NULL;
@@ -140,9 +138,7 @@ static int map_string_field_internal(const char *field, const char **p, struct i
         if (!GREEDY_REALLOC(*iov, *n_iov_allocated, *n_iov + 1))
                 return -ENOMEM;
 
-        (*iov)[*n_iov].iov_base = c;
-        (*iov)[*n_iov].iov_len = l;
-        (*n_iov)++;
+        (*iov)[(*n_iov)++] = IOVEC_MAKE(c, l);
 
         *p = e;
         c = NULL;
index 0953324cc65a42bede83ac5ff9a0dd40c458c5ef..d1fdfccd464e017256e3ad2e0ac3b31e44543c1c 100644 (file)
@@ -172,14 +172,10 @@ static int server_process_entry(
 
                                 l = e - p;
 
-                                /* If the field name starts with an
-                                 * underscore, skip the variable,
-                                 * since that indicates a trusted
-                                 * field */
-                                iovec[n].iov_base = (char*) p;
-                                iovec[n].iov_len = l;
+                                /* If the field name starts with an underscore, skip the variable, since that indicates
+                                 * a trusted field */
+                                iovec[n++] = IOVEC_MAKE((char*) p, l);
                                 entry_size += l;
-                                n++;
 
                                 server_process_entry_meta(p, l, ucred,
                                                           &priority,