diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2020-06-10 11:36:19 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2020-07-05 16:17:12 +0200 |
commit | 5e085f7019e14ea6e1e489a351bc82f6cbe3f652 (patch) | |
tree | c5230117c939b2a4e8349a4d39c29d3f8c2993f1 | |
parent | 2ceac684bd857826e7530fa704ed6276e87f5c62 (diff) | |
download | barebox-5e085f7019e14ea6e1e489a351bc82f6cbe3f652.tar.gz barebox-5e085f7019e14ea6e1e489a351bc82f6cbe3f652.tar.xz |
fs: ramfs: Return -ENOSPC
When ramfs fails to allocate more memory then returning -ENOSPC is
more appropriate then -ENOMEM.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | fs/ramfs.c | 4 |
1 files 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++; } |