summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorUlrich Ölmann <u.oelmann@pengutronix.de>2016-04-29 19:36:21 +0200
committerSteffen Trumtrar <s.trumtrar@pengutronix.de>2020-06-22 08:13:13 +0200
commitc98507f40d39633e345230caa00f78c9065da845 (patch)
tree97a79cbc2ceb27bfb3ee327a2c57b4a1296c042c /lib
parent7c70e8e153012ca743ffb3b967bdb112fd6ecfd5 (diff)
downloadbarebox-c98507f40d39633e345230caa00f78c9065da845.tar.gz
barebox-c98507f40d39633e345230caa00f78c9065da845.tar.xz
bootstrap_read_disk(): optionally inform the caller of the buffer size
The size of the buffer allocated in the function is needed if it shall be inspected more closely later. Therefore optionally return it via a new pointer argument. Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/bootstrap/disk.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/bootstrap/disk.c b/lib/bootstrap/disk.c
index fd016166e6..ed8b1aa407 100644
--- a/lib/bootstrap/disk.c
+++ b/lib/bootstrap/disk.c
@@ -14,7 +14,7 @@
#include <libfile.h>
#include <bootstrap.h>
-void* bootstrap_read_disk(const char *dev, const char *fstype)
+void* bootstrap_read_disk(const char *dev, char *fstype, size_t *bufsize)
{
int ret;
void *buf;
@@ -34,5 +34,8 @@ void* bootstrap_read_disk(const char *dev, const char *fstype)
return NULL;
}
+ if (bufsize)
+ *bufsize = len;
+
return buf;
}