summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-10-30 19:54:13 +0100
committerLennart Poettering <lennart@poettering.net>2017-11-16 12:40:17 +0100
commitdde263747623c188306f6ed43212de202e977272 (patch)
tree3245e968153d37e31b0ccf8b94d40c606a2f1388 /src/journal
parent53978b98f9ecc16dca216e8dab17d0d5622c9056 (diff)
downloadsystemd-dde263747623c188306f6ed43212de202e977272.tar.gz
journal: make use of IOVEC_MAKE() where it makes sense
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/journald-audit.c8
-rw-r--r--src/journal/journald-native.c10
2 files changed, 5 insertions, 13 deletions
diff --git a/src/journal/journald-audit.c b/src/journal/journald-audit.c
index 3334418f33..f79983d165 100644
--- a/src/journal/journald-audit.c
+++ b/src/journal/journald-audit.c
@@ -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;
diff --git a/src/journal/journald-native.c b/src/journal/journald-native.c
index 0953324cc6..d1fdfccd46 100644
--- a/src/journal/journald-native.c
+++ b/src/journal/journald-native.c
@@ -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,