When ramfs fails to allocate more memory then returning -ENOSPC is
more appropriate then -ENOMEM.

Signed-off-by: Sascha Hauer <[email protected]>
---
 fs/ramfs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ramfs.c b/fs/ramfs.c
index 341b6130de..800b03af29 100644
--- a/fs/ramfs.c
+++ b/fs/ramfs.c
@@ -367,7 +367,7 @@ static int ramfs_truncate(struct device_d *dev, FILE *f, 
loff_t size)
                } else {
                        node->data = ramfs_get_chunk();
                        if (!node->data)
-                               return -ENOMEM;
+                               return -ENOSPC;
                        data = node->data;
                        oldchunks = 1;
                }
@@ -378,7 +378,7 @@ static int ramfs_truncate(struct device_d *dev, FILE *f, 
loff_t size)
                while (newchunks > oldchunks) {
                        data->next = ramfs_get_chunk();
                        if (!data->next)
-                               return -ENOMEM;
+                               return -ENOSPC;
                        data = data->next;
                        oldchunks++;
                }
-- 
2.27.0


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to