diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2011-07-29 15:15:38 +0800 |
---|---|---|
committer | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2011-07-30 02:05:27 +0800 |
commit | 12ed40bb177d3c41362c0f96f082f67758c4acad (patch) | |
tree | 444014f305a0b0739ac39290e3a24035249e6325 /fs/devfs.c | |
parent | 805a4a0c7d51ba20ac29bc28b72b8bf9b9c0e80b (diff) | |
download | barebox-12ed40bb177d3c41362c0f96f082f67758c4acad.tar.gz barebox-12ed40bb177d3c41362c0f96f082f67758c4acad.tar.xz |
fs: switch to resource
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'fs/devfs.c')
-rw-r--r-- | fs/devfs.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/devfs.c b/fs/devfs.c index 07ca16c553..66f7ca4162 100644 --- a/fs/devfs.c +++ b/fs/devfs.c @@ -161,7 +161,9 @@ static int devfs_ioctl(struct device_d *_dev, FILE *f, int request, void *buf) static int devfs_truncate(struct device_d *dev, FILE *f, ulong size) { - if (size > f->dev->size) + if (f->dev->num_resources < 1) + return -ENOSPC; + if (size > f->dev->resource[0].size) return -ENOSPC; return 0; } |