summaryrefslogtreecommitdiffstats
path: root/mtdutils/mtdutils.c
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2010-09-14 23:25:48 +0200
committerDoug Zongker <dougz@android.com>2010-09-15 00:28:54 +0200
commitd12560aa2134d3af21a1220cd4873553f9c51743 (patch)
tree8cba0a1bae2a5152066817326122c3245f731ab9 /mtdutils/mtdutils.c
parentstop treating all-zero blocks as bad (diff)
downloadandroid_bootable_recovery-d12560aa2134d3af21a1220cd4873553f9c51743.tar
android_bootable_recovery-d12560aa2134d3af21a1220cd4873553f9c51743.tar.gz
android_bootable_recovery-d12560aa2134d3af21a1220cd4873553f9c51743.tar.bz2
android_bootable_recovery-d12560aa2134d3af21a1220cd4873553f9c51743.tar.lz
android_bootable_recovery-d12560aa2134d3af21a1220cd4873553f9c51743.tar.xz
android_bootable_recovery-d12560aa2134d3af21a1220cd4873553f9c51743.tar.zst
android_bootable_recovery-d12560aa2134d3af21a1220cd4873553f9c51743.zip
Diffstat (limited to '')
-rw-r--r--mtdutils/mtdutils.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/mtdutils/mtdutils.c b/mtdutils/mtdutils.c
index c913a1945..d16f44ef8 100644
--- a/mtdutils/mtdutils.c
+++ b/mtdutils/mtdutils.c
@@ -279,6 +279,12 @@ MtdReadContext *mtd_read_partition(const MtdPartition *partition)
return ctx;
}
+// Seeks to a location in the partition. Don't mix with reads of
+// anything other than whole blocks; unpredictable things will result.
+void mtd_read_skip_to(const MtdReadContext* ctx, size_t offset) {
+ lseek64(ctx->fd, offset, SEEK_SET);
+}
+
static int read_block(const MtdPartition *partition, int fd, char *data)
{
struct mtd_ecc_stats before, after;
@@ -449,6 +455,7 @@ static int write_block(MtdWriteContext *ctx, const char *data)
if (retry > 0) {
fprintf(stderr, "mtd: wrote block after %d retries\n", retry);
}
+ fprintf(stderr, "mtd: successfully wrote block at %x\n", pos);
return 0; // Success!
}