[PATCH 2/2] fs: stat: Do not forget to set errno

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



stat() needs to set errno correctly when returning with an error.

Fixes: b3fbfad7ae ("fs: dentry cache implementation")

Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 fs/fs.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/fs/fs.c b/fs/fs.c
index d4ac37943e..2a4d78c9d7 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;
 }
 
-- 
2.19.0


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux