diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-05-10 01:55:05 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-05-10 01:57:37 +0200 |
commit | 027cc9c92eb92ff89aacc22c9a131e7988b72e72 (patch) | |
tree | cacd0d21a4667df57d8efab5ab9526f1d8a6c379 /src/basic/fs-util.c | |
parent | 03d3a9d5be0879ccbf2686a528c4e686ef0c0af2 (diff) | |
download | systemd-027cc9c92eb92ff89aacc22c9a131e7988b72e72.tar.gz |
basic/fs-util: remove logically dead code
We can jump to chase_one from two places. In the first 'todo' is set to
'buffer', which comes from path_make_absolute_cwd() and is nonnull In the
second 'todo' is set to 'joined' which is checked to be nonull a few lines
above the jump. So let's kill the code that deals with null todo there.
CID #1390941.
Diffstat (limited to 'src/basic/fs-util.c')
-rw-r--r-- | src/basic/fs-util.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c index 13dccfef54..232a21c193 100644 --- a/src/basic/fs-util.c +++ b/src/basic/fs-util.c @@ -919,25 +919,12 @@ int chase_symlinks(const char *path, const char *original_root, unsigned flags, return exists; chased_one: - if (ret) { char *c; - if (done) { - if (todo) { - c = strjoin(done, todo); - if (!c) - return -ENOMEM; - } else - c = TAKE_PTR(done); - } else { - if (todo) - c = strdup(todo); - else - c = strdup("/"); - if (!c) - return -ENOMEM; - } + c = strjoin(strempty(done), todo); + if (!c) + return -ENOMEM; *ret = c; } |