summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/fs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/fs.c b/fs/fs.c
index f42ca36078..51a7411b69 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -296,8 +296,10 @@ static int path_check_prereq(const char *path, unsigned int flags)
errno = 0;
if (stat(path, &s)) {
- if (flags & S_UB_DOES_NOT_EXIST)
+ if (flags & S_UB_DOES_NOT_EXIST) {
+ errno = 0;
goto out;
+ }
errno = -ENOENT;
goto out;
}
@@ -307,8 +309,10 @@ static int path_check_prereq(const char *path, unsigned int flags)
goto out;
}
- if (flags == S_UB_EXISTS)
+ if (flags == S_UB_EXISTS) {
+ errno = 0;
goto out;
+ }
m = s.st_mode;