summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-10-26 12:25:34 +0100
committerLennart Poettering <lennart@poettering.net>2015-10-26 12:25:34 +0100
commit24a99732e2cc209b3192735e4c2f41333ee7b5b1 (patch)
tree584f9f2c36a19185b69ea478f67753fef33e9a18 /src
parente05ac0557f10536c213bf93a3e23e1c82de288bb (diff)
parentd581d9d91fa5c42ce7828a7d0b1334d370cf1670 (diff)
Merge pull request #1681 from ssahani/journal
journald-server: port to extract_first_word
Diffstat (limited to 'src')
-rw-r--r--src/journal/journald-server.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 012970bad3..0b5e9a36a1 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -1289,8 +1289,7 @@ static int setup_signals(Server *s) {
static int server_parse_proc_cmdline(Server *s) {
_cleanup_free_ char *line = NULL;
- const char *w, *state;
- size_t l;
+ const char *p;
int r;
r = proc_cmdline(&line);
@@ -1299,12 +1298,16 @@ static int server_parse_proc_cmdline(Server *s) {
return 0;
}
- FOREACH_WORD_QUOTED(w, l, line, state) {
+ p = line;
+ for(;;) {
_cleanup_free_ char *word;
- word = strndup(w, l);
- if (!word)
- return -ENOMEM;
+ r = extract_first_word(&p, &word, NULL, 0);
+ if (r < 0)
+ return log_error_errno(r, "Failed to parse journald syntax \"%s\": %m", line);
+
+ if (r == 0)
+ break;
if (startswith(word, "systemd.journald.forward_to_syslog=")) {
r = parse_boolean(word + 35);