summaryrefslogtreecommitdiff
path: root/src/journal/journalctl.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-06-24 17:42:13 +0200
committerGitHub <noreply@github.com>2020-06-24 17:42:13 +0200
commitf83803a6499cd7ad314ba35be2f5f69ae12ab0e9 (patch)
treeba34799ac9e404113b92cf36023e607be53db3a2 /src/journal/journalctl.c
parent41d1f469cf10f5f3e9cb4f4853ace9b0cfe5beae (diff)
parente198eba7c231b7ab9883e81d841631d7a235be84 (diff)
downloadsystemd-f83803a6499cd7ad314ba35be2f5f69ae12ab0e9.tar.gz
Merge pull request #16238 from keszybz/set-handling-more
Fix handling of cases where a duplicate item is added to a set and related cleanups
Diffstat (limited to 'src/journal/journalctl.c')
-rw-r--r--src/journal/journalctl.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index 6ba65a1071..8d4897b942 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -875,12 +875,7 @@ static int parse_argv(int argc, char *argv[]) {
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
"Bad --facility= argument \"%s\".", fac);
- r = set_ensure_allocated(&arg_facilities, NULL);
- if (r < 0)
- return log_oom();
-
- r = set_put(arg_facilities, INT_TO_PTR(num));
- if (r < 0)
+ if (set_ensure_put(&arg_facilities, NULL, INT_TO_PTR(num)) < 0)
return log_oom();
}