summaryrefslogtreecommitdiff
path: root/fastboot/engine.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-08-26 02:12:50 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-08-26 02:12:50 +0000
commit04b94b2571a0f90b55140f2d2748f2876fdfa408 (patch)
treec0173d9c001ea79fe191cfca05d99e19d9035b45 /fastboot/engine.cpp
parenta421c1e5bc32ef29bdfa8d065f27b7ea950f12a2 (diff)
parentfc79767fc26d8782403e7b1afa7b93d518a86b19 (diff)
Merge "Use 64-bit file sizes in fastboot."
Diffstat (limited to 'fastboot/engine.cpp')
-rw-r--r--fastboot/engine.cpp24
1 files changed, 9 insertions, 15 deletions
diff --git a/fastboot/engine.cpp b/fastboot/engine.cpp
index 66b8140f3..bda6ad8e1 100644
--- a/fastboot/engine.cpp
+++ b/fastboot/engine.cpp
@@ -30,8 +30,6 @@
#include "fs.h"
#include <errno.h>
-#include <stdarg.h>
-#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -39,12 +37,6 @@
#include <sys/types.h>
#include <unistd.h>
-#ifdef USE_MINGW
-#include <fcntl.h>
-#else
-#include <sys/mman.h>
-#endif
-
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
#define OP_DOWNLOAD 1
@@ -58,15 +50,17 @@ typedef struct Action Action;
#define CMD_SIZE 64
-struct Action
-{
+struct Action {
unsigned op;
- Action *next;
+ Action* next;
char cmd[CMD_SIZE];
- const char *prod;
- void *data;
- unsigned size;
+ const char* prod;
+ void* data;
+
+ // The protocol only supports 32-bit sizes, so you'll have to break
+ // anything larger into chunks.
+ uint32_t size;
const char *msg;
int (*func)(Action* a, int status, const char* resp);
@@ -267,7 +261,7 @@ static int cb_reject(Action* a, int status, const char* resp) {
}
void fb_queue_require(const char *prod, const char *var,
- int invert, unsigned nvalues, const char **value)
+ bool invert, size_t nvalues, const char **value)
{
Action *a;
a = queue_action(OP_QUERY, "getvar:%s", var);