summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-09-26 10:24:34 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2018-09-26 10:29:05 +0200
commit9ad58a925c679d0a50eff98ee0a4cdc1332d11e7 (patch)
treea082560637d61d6506f7bd8bc164cd23a91eff8d
parent822dfbd8b4cd5511ca8965f990f39ff2f2b832e8 (diff)
downloadbarebox-9ad58a925c679d0a50eff98ee0a4cdc1332d11e7.tar.gz
fs: stat: Do not forget to set errno
stat() needs to set errno correctly when returning with an error. Fixes: b3fbfad7ae ("fs: dentry cache implementation") Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--fs/fs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/fs.c b/fs/fs.c
index d4ac379..2a4d78c 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -2535,6 +2535,9 @@ static int stat_filename(const char *filename, struct stat *s, unsigned int flag
out_put:
path_put(&path);
out:
+ if (ret)
+ errno = -ret;
+
return ret;
}