diff options
author | Sascha Hauer <sha@octopus.labnet.pengutronix.de> | 2007-09-27 16:33:35 +0200 |
---|---|---|
committer | Sascha Hauer <sha@octopus.labnet.pengutronix.de> | 2007-09-27 16:33:35 +0200 |
commit | 79ed00ba92a0c2dd209d94e0550d582897ca176e (patch) | |
tree | af5684bf31b6e7ae5f5ca1fc9aa26ba9919d6185 /fs | |
parent | 9e13a384c005d26411b53d4c4f643700957c8345 (diff) | |
download | barebox-79ed00ba92a0c2dd209d94e0550d582897ca176e.tar.gz barebox-79ed00ba92a0c2dd209d94e0550d582897ca176e.tar.xz |
pass file size from read_file
Diffstat (limited to 'fs')
-rw-r--r-- | fs/fs.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -30,7 +30,7 @@ #include <xfuncs.h> #include <init.h> -void *read_file(const char *filename) +void *read_file(const char *filename, size_t *size) { int fd; struct stat s; @@ -49,6 +49,10 @@ void *read_file(const char *filename) goto err_out1; close(fd); + + if (size) + *size = s.st_size; + return buf; err_out1: |