diff options
Diffstat (limited to 'libdiskconfig/diskutils.c')
-rw-r--r-- | libdiskconfig/diskutils.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libdiskconfig/diskutils.c b/libdiskconfig/diskutils.c index e325735..5d0ee62 100644 --- a/libdiskconfig/diskutils.c +++ b/libdiskconfig/diskutils.c @@ -19,13 +19,14 @@ #include <errno.h> #include <fcntl.h> +#include <inttypes.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/stat.h> -#include <cutils/log.h> +#include <log/log.h> #include <diskconfig/diskconfig.h> @@ -35,12 +36,12 @@ write_raw_image(const char *dst, const char *src, loff_t offset, int test) int dst_fd = -1; int src_fd = -1; uint8_t buffer[2048]; - int nr_bytes; - int tmp; + ssize_t nr_bytes; + ssize_t tmp; int done = 0; uint64_t total = 0; - ALOGI("Writing RAW image '%s' to '%s' (offset=%llu)", src, dst, offset); + ALOGI("Writing RAW image '%s' to '%s' (offset=%llu)", src, dst, (unsigned long long)offset); if ((src_fd = open(src, O_RDONLY)) < 0) { ALOGE("Could not open %s for reading (errno=%d).", src, errno); goto fail; @@ -53,7 +54,7 @@ write_raw_image(const char *dst, const char *src, loff_t offset, int test) } if (lseek64(dst_fd, offset, SEEK_SET) != offset) { - ALOGE("Could not seek to offset %lld in %s.", offset, dst); + ALOGE("Could not seek to offset %lld in %s.", (long long)offset, dst); goto fail; } } @@ -101,7 +102,7 @@ write_raw_image(const char *dst, const char *src, loff_t offset, int test) if (dst_fd >= 0) fsync(dst_fd); - ALOGI("Wrote %llu bytes to %s @ %lld", total, dst, offset); + ALOGI("Wrote %" PRIu64 " bytes to %s @ %lld", total, dst, (long long)offset); close(src_fd); if (dst_fd >= 0) |