diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-02-01 10:26:50 -0500 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-02-01 10:26:50 -0500 |
commit | a6c59096650be6653eb0b3590fb4ea3292337e6a (patch) | |
tree | 7e8d1d9ff89f50266c222e9fafd86d97a2542ce6 /src/journal | |
parent | 785d345145bbd06c8f1c75c6a0b119c4e8f411db (diff) |
Revert "Trivial typo fixes and code refactorings (#5191)"
Let's do a merge to preserve all the commit messages.
This reverts commit 785d345145bbd06c8f1c75c6a0b119c4e8f411db.
Diffstat (limited to 'src/journal')
-rw-r--r-- | src/journal/journal-file.c | 17 |
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); |