summaryrefslogtreecommitdiffstats
path: root/fs/smhfs.c
diff options
context:
space:
mode:
authorAndrey Smirnov <andrew.smirnov@gmail.com>2015-11-08 16:21:13 -0800
committerSascha Hauer <s.hauer@pengutronix.de>2015-11-09 07:17:57 +0100
commit8f8f14f9b6b70d2073ebb5484fe54011d7d49b73 (patch)
tree0bed8b83733f96407d0d7fd70d2e3aa1076d740e /fs/smhfs.c
parentb97ac6bd41ba8336b4c3c6aa296f8bccde4697a3 (diff)
downloadbarebox-8f8f14f9b6b70d2073ebb5484fe54011d7d49b73.tar.gz
barebox-8f8f14f9b6b70d2073ebb5484fe54011d7d49b73.tar.xz
fs: smhfs: Fix return value of truncate()
Returning -ENOSYS as a result of truncate() breaks ability to write to semihosting host's filesystem, so change the return value to 0. This shouldn't cause any problems since all of the funcionlaity of truncate() should is already handled by 'open' (via O_TRUNC) and 'write' (will automatically grow the file size when writing) automatically Unfortunately this was missed in original commit that introduced semihosting Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs/smhfs.c')
-rw-r--r--fs/smhfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/smhfs.c b/fs/smhfs.c
index a0df06c31e..f1b6d6bb1b 100644
--- a/fs/smhfs.c
+++ b/fs/smhfs.c
@@ -58,7 +58,7 @@ static int smhfs_truncate(struct device_d __always_unused *dev,
FILE __always_unused *f,
ulong __always_unused size)
{
- return -ENOSYS;
+ return 0;
}
static int smhfs_open(struct device_d __always_unused *dev,