summaryrefslogtreecommitdiffstats
path: root/fastboot/fs.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-04-07 20:12:50 -0700
committerElliott Hughes <enh@google.com>2015-08-25 19:11:52 -0700
commitfc79767fc26d8782403e7b1afa7b93d518a86b19 (patch)
treec287e259c119ee4ba710530afbfe32ea8e4aa9df /fastboot/fs.cpp
parent43f43d8792ffc91df085a787feecdb0cfd225b47 (diff)
downloadcore-fc79767fc26d8782403e7b1afa7b93d518a86b19.tar.gz
core-fc79767fc26d8782403e7b1afa7b93d518a86b19.tar.bz2
core-fc79767fc26d8782403e7b1afa7b93d518a86b19.zip
Use 64-bit file sizes in fastboot.
Bug: 20110580 Change-Id: I5d3718103ff581ff3b5241c8b0e52b585b4f37e5
Diffstat (limited to 'fastboot/fs.cpp')
-rw-r--r--fastboot/fs.cpp25
1 files changed, 7 insertions, 18 deletions
diff --git a/fastboot/fs.cpp b/fastboot/fs.cpp
index d8f9e165d..c58a505b7 100644
--- a/fastboot/fs.cpp
+++ b/fastboot/fs.cpp
@@ -6,21 +6,12 @@
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
-#include <stdarg.h>
-#include <stdbool.h>
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
-#include <sparse/sparse.h>
#include <unistd.h>
-#ifdef USE_MINGW
-#include <fcntl.h>
-#else
-#include <sys/mman.h>
-#endif
-
-
+#include <sparse/sparse.h>
static int generate_ext4_image(int fd, long long partSize)
{
@@ -48,15 +39,13 @@ static const struct fs_generator {
#endif
};
-const struct fs_generator* fs_get_generator(const char *fs_type)
-{
- unsigned i;
-
- for (i = 0; i < sizeof(generators) / sizeof(*generators); i++)
- if (!strcmp(generators[i].fs_type, fs_type))
+const struct fs_generator* fs_get_generator(const char* fs_type) {
+ for (size_t i = 0; i < sizeof(generators) / sizeof(*generators); i++) {
+ if (strcmp(generators[i].fs_type, fs_type) == 0) {
return generators + i;
-
- return NULL;
+ }
+ }
+ return nullptr;
}
int fs_generator_generate(const struct fs_generator* gen, int tmpFileNo, long long partSize)