chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
109cb9e
)
util-lib: accept invoking chase_symlinks() with a NULL return parameter
author
Lennart Poettering
<lennart@poettering.net>
Thu, 8 Dec 2016 16:15:06 +0000
(17:15 +0100)
committer
Sven Eden
<yamakuzure@gmx.net>
Mon, 17 Jul 2017 15:58:35 +0000
(17:58 +0200)
Let's permit invoking chase_symlinks() with a NULL return parameter. If so, the
resolved name is not returned, and call is useful for checking for existance of
a file, without actually returning its ultimate path.
src/basic/fs-util.c
patch
|
blob
|
history
diff --git
a/src/basic/fs-util.c
b/src/basic/fs-util.c
index 4d494650cb916cfcd3fa697cb2884449d44f331a..471708bbea8f85ba939d4b313befea2cc2cbc87c 100644
(file)
--- a/
src/basic/fs-util.c
+++ b/
src/basic/fs-util.c
@@
-813,8
+813,10
@@
int chase_symlinks(const char *path, const char *original_root, unsigned flags,
return -ENOMEM;
}
- *ret = done;
- done = NULL;
+ if (ret) {
+ *ret = done;
+ done = NULL;
+ }
return exists;
}