9
0
Fork 0

fs: Remove O_TRUNC check for devices when open files

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@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Teresa Remmet 2016-11-25 09:06:05 +01:00 committed by Sascha Hauer
parent 55513dcec5
commit 9bdd6c98eb
1 changed files with 1 additions and 1 deletions

View File

@ -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)