mirror of
https://codeberg.org/libreboot/lbmk.git
synced 2026-07-11 05:52:36 +02:00
util/nvmutil: err if unsupported rw_type on i/o
Signed-off-by: Leah Rowe <leah@libreboot.org>
This commit is contained in:
@@ -270,7 +270,7 @@ static const char *rname = NULL;
|
||||
* The code will handle this properly.
|
||||
*/
|
||||
static uint8_t buf[GBE_FILE_SIZE];
|
||||
static uint8_t pad[GBE_PART_SIZE];
|
||||
static uint8_t pad[GBE_PART_SIZE]; /* the file that wouldn't die */
|
||||
|
||||
static uint16_t mac_buf[3];
|
||||
static off_t gbe_file_size;
|
||||
@@ -1366,6 +1366,9 @@ rw_file_exact(int fd, uint8_t *mem, size_t len,
|
||||
rval = pread(fd, mem + rc, len - rc, off + rc);
|
||||
else if (rw_type == LESEN)
|
||||
rval = read(fd, mem + rc, len - rc);
|
||||
else
|
||||
err(EIO, "%s: %s: Unsupported rw_type",
|
||||
path, rw_type_str);
|
||||
|
||||
if (rval > -1) {
|
||||
if (!rval) /* prevent infinite loop */
|
||||
|
||||
Reference in New Issue
Block a user