diff options
author | Nico Huber <nico.huber@secunet.com> | 2013-08-30 21:29:45 +0000 |
---|---|---|
committer | Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> | 2013-08-30 21:29:45 +0000 |
commit | 7cd659b988cf9cd9a51b0be81a6013c7504032c6 (patch) | |
tree | acb202156fcbc9487070112ae8c2fee03e84feb3 | |
parent | 95118b741f24cbcbf2549af2d138f947e77d13cb (diff) | |
download | flashrom-7cd659b988cf9cd9a51b0be81a6013c7504032c6.zip flashrom-7cd659b988cf9cd9a51b0be81a6013c7504032c6.tar.gz |
libpayload: Remove file I/O in flashrom.c
Read_buf_from_file() and write_buf_to_file() use file streams which are
not supported in libpayload.
Corresponding to flashrom svn r1730.
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
-rw-r--r-- | flashrom.c | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -1166,6 +1166,10 @@ notfound: int read_buf_from_file(unsigned char *buf, unsigned long size, const char *filename) { +#ifdef __LIBPAYLOAD__ + msg_gerr("Error: No file I/O support in libpayload\n"); + return 1; +#else unsigned long numbytes; FILE *image; struct stat image_stat; @@ -1196,11 +1200,16 @@ int read_buf_from_file(unsigned char *buf, unsigned long size, return 1; } return 0; +#endif } int write_buf_to_file(unsigned char *buf, unsigned long size, const char *filename) { +#ifdef __LIBPAYLOAD__ + msg_gerr("Error: No file I/O support in libpayload\n"); + return 1; +#else unsigned long numbytes; FILE *image; @@ -1221,6 +1230,7 @@ int write_buf_to_file(unsigned char *buf, unsigned long size, return 1; } return 0; +#endif } int read_flash_to_file(struct flashctx *flash, const char *filename) |