From 1fdd452f47299be60cac9acbd8e7c864d9c174bd Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Mon, 23 Mar 2015 13:33:57 -0700 Subject: Always use strerror to report errno in recovery. Change-Id: I7009959043150fabf5853a43ee2448c7fbea176e --- mtdutils/mtdutils.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'mtdutils') diff --git a/mtdutils/mtdutils.c b/mtdutils/mtdutils.c index d04b26e..9a17e38 100644 --- a/mtdutils/mtdutils.c +++ b/mtdutils/mtdutils.c @@ -313,8 +313,8 @@ static int read_block(const MtdPartition *partition, int fd, char *data) memcpy(&before, &after, sizeof(struct mtd_ecc_stats)); } else if ((mgbb = ioctl(fd, MEMGETBADBLOCK, &pos))) { fprintf(stderr, - "mtd: MEMGETBADBLOCK returned %d at 0x%08llx (errno=%d)\n", - mgbb, pos, errno); + "mtd: MEMGETBADBLOCK returned %d at 0x%08llx: %s\n", + mgbb, pos, strerror(errno)); } else { return 0; // Success! } @@ -419,8 +419,8 @@ static int write_block(MtdWriteContext *ctx, const char *data) if (ret != 0 && !(ret == -1 && errno == EOPNOTSUPP)) { add_bad_block_offset(ctx, pos); fprintf(stderr, - "mtd: not writing bad block at 0x%08lx (ret %d errno %d)\n", - pos, ret, errno); + "mtd: not writing bad block at 0x%08lx (ret %d): %s\n", + pos, ret, strerror(errno)); pos += partition->erase_size; continue; // Don't try to erase known factory-bad blocks. } -- cgit v1.1