summaryrefslogtreecommitdiffstats
path: root/fastboot/fs.cpp
diff options
context:
space:
mode:
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)