diff options
author | Elliott Hughes <enh@google.com> | 2014-01-16 10:53:11 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2014-01-16 12:54:18 -0800 |
commit | ccecf1425412beb2bc3bb38d470293fdc244d6f1 (patch) | |
tree | 9fd922197bc88bed453efa0738f3dfb5d6db4c3c /fastbootd | |
parent | e847f429f43ae56aaa406697ca603c8469e2100b (diff) | |
download | system_core-ccecf1425412beb2bc3bb38d470293fdc244d6f1.zip system_core-ccecf1425412beb2bc3bb38d470293fdc244d6f1.tar.gz system_core-ccecf1425412beb2bc3bb38d470293fdc244d6f1.tar.bz2 |
system/core 64-bit cleanup.
This cleans up most of the size-related problems in system/core.
There are still a few changes needed for a clean 64-bit build,
but they look like they might require changes to things like the
fastboot protocol.
Change-Id: I1560425a289fa158e13e2e3173cc3e71976f92c0
Diffstat (limited to 'fastbootd')
-rw-r--r-- | fastbootd/commands.c | 3 | ||||
-rw-r--r-- | fastbootd/commands/flash.c | 5 | ||||
-rw-r--r-- | fastbootd/secure.c | 2 | ||||
-rw-r--r-- | fastbootd/transport.c | 4 | ||||
-rw-r--r-- | fastbootd/transport_socket.c | 4 | ||||
-rw-r--r-- | fastbootd/usb_linux_client.c | 4 |
6 files changed, 12 insertions, 10 deletions
diff --git a/fastbootd/commands.c b/fastbootd/commands.c index d8a601f..063e1a6 100644 --- a/fastbootd/commands.c +++ b/fastbootd/commands.c @@ -29,6 +29,7 @@ * SUCH DAMAGE. */ +#include <inttypes.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> @@ -319,7 +320,7 @@ static void cmd_flash(struct protocol_handle *phandle, const char *arg) return; } - D(INFO, "writing %lld bytes to '%s'\n", sz, arg); + D(INFO, "writing %"PRId64" bytes to '%s'\n", sz, arg); if (flash_write(partition, phandle->download_fd, sz, header_sz)) { fastboot_fail(phandle, "flash write failure"); diff --git a/fastbootd/commands/flash.c b/fastbootd/commands/flash.c index 0954217..1eb4d1b 100644 --- a/fastbootd/commands/flash.c +++ b/fastbootd/commands/flash.c @@ -31,6 +31,7 @@ #include <sys/stat.h> #include <fcntl.h> +#include <inttypes.h> #include <sys/mman.h> #include "flash.h" @@ -82,7 +83,7 @@ int flash_erase(int fd) { int64_t size; size = get_block_device_size(fd); - D(DEBUG, "erase %llu data from %d\n", size, fd); + D(DEBUG, "erase %"PRId64" data from %d\n", size, fd); return wipe_block_device(fd, size); } @@ -97,7 +98,7 @@ int flash_write(int partition_fd, int data_fd, ssize_t size, ssize_t skip) int current_size = MIN(size - written, BUFFER_SIZE); if (gpt_mmap(&input, written + skip, current_size, data_fd)) { - D(ERR, "Error in writing data, unable to map data file %d at %d size %d", size, skip, current_size); + D(ERR, "Error in writing data, unable to map data file %zd at %zd size %d", size, skip, current_size); return -1; } if (gpt_mmap(&output, written, current_size, partition_fd)) { diff --git a/fastbootd/secure.c b/fastbootd/secure.c index a657ad4..186e026 100644 --- a/fastbootd/secure.c +++ b/fastbootd/secure.c @@ -151,7 +151,7 @@ int cert_verify(BIO *content, CMS_ContentInfo *content_info, X509_STORE *store, char buf[256]; unsigned long err = ERR_peek_last_error(); D(ERR, "Verification failed with reason: %s, %s", ERR_lib_error_string(err), ERR_error_string(err, buf)); - D(ERR, "Data used: content %d", (int) content); + D(ERR, "Data used: content %p", content); } ERR_clear_error(); diff --git a/fastbootd/transport.c b/fastbootd/transport.c index 19a705c..ce8f9d0 100644 --- a/fastbootd/transport.c +++ b/fastbootd/transport.c @@ -56,14 +56,14 @@ int transport_handle_download(struct transport_handle *thandle, size_t len) buffer = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); if (buffer == NULL) { - D(ERR, "mmap(%u) failed: %d %s", len, errno, strerror(errno)); + D(ERR, "mmap(%zu) failed: %d %s", len, errno, strerror(errno)); goto err; } while (n < len) { ret = thandle->transport->read(thandle, buffer + n, len - n); if (ret <= 0) { - D(WARN, "transport read failed, ret=%d %s", ret, strerror(-ret)); + D(WARN, "transport read failed, ret=%zd %s", ret, strerror(-ret)); break; } n += ret; diff --git a/fastbootd/transport_socket.c b/fastbootd/transport_socket.c index ff0f3bd..664d473 100644 --- a/fastbootd/transport_socket.c +++ b/fastbootd/transport_socket.c @@ -88,7 +88,7 @@ ssize_t socket_write(struct transport_handle *thandle, const void *data, size_t ssize_t ret; struct socket_handle *handle = container_of(thandle, struct socket_handle, handle); - D(DEBUG, "about to write (fd=%d, len=%d)", handle->fd, len); + D(DEBUG, "about to write (fd=%d, len=%zu)", handle->fd, len); ret = bulk_write(handle->fd, data, len); if (ret < 0) { D(ERR, "ERROR: fd = %d, ret = %zd", handle->fd, ret); @@ -103,7 +103,7 @@ ssize_t socket_read(struct transport_handle *thandle, void *data, size_t len) ssize_t ret; struct socket_handle *handle = container_of(thandle, struct socket_handle, handle); - D(DEBUG, "about to read (fd=%d, len=%d)", handle->fd, len); + D(DEBUG, "about to read (fd=%d, len=%zu)", handle->fd, len); ret = bulk_read(handle->fd, data, len); if (ret < 0) { D(ERR, "ERROR: fd = %d, ret = %zd", handle->fd, ret); diff --git a/fastbootd/usb_linux_client.c b/fastbootd/usb_linux_client.c index 7a8e46f..64420e9 100644 --- a/fastbootd/usb_linux_client.c +++ b/fastbootd/usb_linux_client.c @@ -217,7 +217,7 @@ static ssize_t usb_write(struct transport_handle *thandle, const void *data, siz struct transport *t = thandle->transport; struct usb_transport *usb_transport = container_of(t, struct usb_transport, transport); - D(DEBUG, "about to write (fd=%d, len=%d)", usb_transport->bulk_in, len); + D(DEBUG, "about to write (fd=%d, len=%zu)", usb_transport->bulk_in, len); ret = bulk_write(usb_transport->bulk_in, data, len); if (ret < 0) { D(ERR, "ERROR: fd = %d, ret = %zd", usb_transport->bulk_in, ret); @@ -233,7 +233,7 @@ ssize_t usb_read(struct transport_handle *thandle, void *data, size_t len) struct transport *t = thandle->transport; struct usb_transport *usb_transport = container_of(t, struct usb_transport, transport); - D(DEBUG, "about to read (fd=%d, len=%d)", usb_transport->bulk_out, len); + D(DEBUG, "about to read (fd=%d, len=%zu)", usb_transport->bulk_out, len); ret = bulk_read(usb_transport->bulk_out, data, len); if (ret < 0) { D(ERR, "ERROR: fd = %d, ret = %zd", usb_transport->bulk_out, ret); |