aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flash_erase.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/flash_erase.c b/flash_erase.c
index 326a299..1421cf9 100644
--- a/flash_erase.c
+++ b/flash_erase.c
@@ -277,11 +277,7 @@ int main(int argc, char *argv[])
continue;
}
} else {
- if (lseek(fd, offset, SEEK_SET) < 0) {
- sys_errmsg("%s: MTD lseek failure", mtd_device);
- continue;
- }
- if (write(fd, &cleanmarker, sizeof(cleanmarker)) != sizeof(cleanmarker)) {
+ if (pwrite(fd, &cleanmarker, sizeof(cleanmarker), (loff_t)offset) != sizeof(cleanmarker)) {
sys_errmsg("%s: MTD write failure", mtd_device);
continue;
}