aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Pärtel <martin.partel@gmail.com>2015-09-13 20:33:41 +0100
committerMartin Pärtel <martin.partel@gmail.com>2015-09-13 20:33:41 +0100
commit7d8af8cc90ac8a986c3322e3b564eb33dc2794cb (patch)
tree93ff74246eaf04a17c8e3e9b1f7892b09b25058d
parenta9e77b666754ff7f1e498f81788a8933c72c017d (diff)
downloadbindfs-7d8af8cc90ac8a986c3322e3b564eb33dc2794cb.tar.gz
Revert "Don't resolve broken symbolic links."
I think ENOENT is fine. This reverts commit 5922a236d0ce7fcf911fce6ff7a52b11ddcf2142.
-rw-r--r--src/bindfs.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/src/bindfs.c b/src/bindfs.c
index 2593676..eb8b874 100644
--- a/src/bindfs.c
+++ b/src/bindfs.c
@@ -249,8 +249,6 @@ static int is_mirrored_user(uid_t uid)
static char *process_path(const char *path, bool resolve_symlinks)
{
- char *res;
-
if (path == NULL) { /* possible? */
errno = EINVAL;
return NULL;
@@ -262,13 +260,10 @@ static char *process_path(const char *path, bool resolve_symlinks)
if (*path == '\0')
path = ".";
- if (resolve_symlinks && settings.resolve_symlinks) {
- res = realpath(path, NULL);
- if (res)
- return res;
- }
-
- return strdup(path);
+ if (resolve_symlinks && settings.resolve_symlinks)
+ return realpath(path, NULL);
+ else
+ return strdup(path);
}
static int getattr_common(const char *procpath, struct stat *stbuf)