summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/journal-file.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index 0a264aef92..e45d1905e7 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -3087,18 +3087,13 @@ int journal_file_open(
}
}
- if (fname) {
+ if (fname)
f->path = strdup(fname);
- if (!f->path) {
- r = -ENOMEM;
- goto fail;
- }
- } else {
- /* If we don't know the path, fill in something explanatory and vaguely useful */
- if (asprintf(&f->path, "/proc/self/%i", fd) < 0) {
- r = -ENOMEM;
- goto fail;
- }
+ else /* If we don't know the path, fill in something explanatory and vaguely useful */
+ asprintf(&f->path, "/proc/self/%i", fd);
+ if (!f->path) {
+ r = -ENOMEM;
+ goto fail;
}
f->chain_cache = ordered_hashmap_new(&uint64_hash_ops);