From cb306f5d500b6cf8e4367a847aa96ff764ad3aff Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Mon, 25 Apr 2016 00:26:41 +0200 Subject: sd-journal: minor simplification --- src/journal/sd-journal.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src') diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c index 44bf8ab511..5104bc3e01 100644 --- a/src/journal/sd-journal.c +++ b/src/journal/sd-journal.c @@ -1614,13 +1614,7 @@ static int allocate_inotify(sd_journal *j) { return -errno; } - if (!j->directories_by_wd) { - j->directories_by_wd = hashmap_new(NULL); - if (!j->directories_by_wd) - return -ENOMEM; - } - - return 0; + return hashmap_ensure_allocated(&j->directories_by_wd, NULL); } static sd_journal *journal_new(int flags, const char *path) { -- cgit v1.2.3-54-g00ecf