diff options
author | Kay Sievers <kay@vrfy.org> | 2013-07-11 00:13:46 +0200 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2013-07-11 00:13:46 +0200 |
commit | 8577e67245fc5d38bfdc32349388769895202bc4 (patch) | |
tree | d90acb0ff47880f140c02ac418e102e419b23efa /src/core | |
parent | 66713f77e851c12452729d37e22ef66673852b8f (diff) |
shutdown: fix /proc/cmdline reading of 'quiet'
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/shutdown.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/core/shutdown.c b/src/core/shutdown.c index c02a14d66e..fe7a0739db 100644 --- a/src/core/shutdown.c +++ b/src/core/shutdown.c @@ -144,11 +144,18 @@ int main(int argc, char *argv[]) { char *w, *state; size_t l; - FOREACH_WORD_QUOTED(w, l, line, state) - if (streq(w, "quiet")) { + FOREACH_WORD_QUOTED(w, l, line, state) { + _cleanup_free_ char *word; + + word = strndup(w, l); + if (!word) + break; + + if (streq(word, "quiet")) { log_set_max_level(LOG_WARNING); break; } + } } log_parse_environment(); |