[PATCH 4/6] fs: Remove O_TRUNC check for devices when open files

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

 



Don't check for the file type here. Devices may have truncate
callbacks. Otherwise the caller should check if O_TRUNC is possible.

Signed-off-by: Teresa Remmet <t.remmet@xxxxxxxxx>
---
 fs/fs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fs.c b/fs/fs.c
index b7e7c63..2b4659c 100644
--- a/fs/fs.c
+++ b/fs/fs.c
@@ -682,7 +682,7 @@ int open(const char *pathname, int flags, ...)
 	if (ret)
 		goto out;
 
-	if (!(s.st_mode & S_IFCHR) && (flags & O_TRUNC)) {
+	if (flags & O_TRUNC) {
 		ret = fsdrv->truncate(&fsdev->dev, f, 0);
 		f->size = 0;
 		if (ret)
-- 
1.9.1


_______________________________________________
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