summaryrefslogtreecommitdiffstats
path: root/mtdutils/mtdutils.c
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-03-23 23:00:50 +0100
committerAndroid Git Automerger <android-git-automerger@android.com>2015-03-23 23:00:50 +0100
commit30ad0461924096e948f4eef6f0e7cc64c28dac1a (patch)
treead1df5da827f51d31d05ce5d80d44e7488e25dc4 /mtdutils/mtdutils.c
parentam e944944f: Merge "Add "Apply update from sdcard" to default recovery image." (diff)
parentMerge "Always use strerror to report errno in recovery." (diff)
downloadandroid_bootable_recovery-30ad0461924096e948f4eef6f0e7cc64c28dac1a.tar
android_bootable_recovery-30ad0461924096e948f4eef6f0e7cc64c28dac1a.tar.gz
android_bootable_recovery-30ad0461924096e948f4eef6f0e7cc64c28dac1a.tar.bz2
android_bootable_recovery-30ad0461924096e948f4eef6f0e7cc64c28dac1a.tar.lz
android_bootable_recovery-30ad0461924096e948f4eef6f0e7cc64c28dac1a.tar.xz
android_bootable_recovery-30ad0461924096e948f4eef6f0e7cc64c28dac1a.tar.zst
android_bootable_recovery-30ad0461924096e948f4eef6f0e7cc64c28dac1a.zip
Diffstat (limited to 'mtdutils/mtdutils.c')
-rw-r--r--mtdutils/mtdutils.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/mtdutils/mtdutils.c b/mtdutils/mtdutils.c
index d04b26efa..9a17e38d8 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.
}