From ef6e73fa50d6968df79d26a67ff77fd1f3c2b0f1 Mon Sep 17 00:00:00 2001 From: cfig Date: Sat, 28 Apr 2018 09:28:51 +0800 Subject: [PATCH] patch it --- mkbootfs/src/mkbootfs/cpp/mkbootfs.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/mkbootfs/src/mkbootfs/cpp/mkbootfs.c b/mkbootfs/src/mkbootfs/cpp/mkbootfs.c index e52762e..eba3657 100644 --- a/mkbootfs/src/mkbootfs/cpp/mkbootfs.c +++ b/mkbootfs/src/mkbootfs/cpp/mkbootfs.c @@ -13,6 +13,10 @@ #include #include +//XXX +#include +#include +//XXX /* NOTES ** @@ -100,7 +104,11 @@ static void _eject(struct stat *s, char *out, int olen, char *data, unsigned dat putchar(0); } +#ifdef CFIG_NO_FIX_STAT +#warning CFIG_NO_FIX_STAT defined, will not fix_stat() defined in Android +#else fix_stat(out, s); +#endif // fprintf(stderr, "_eject %s: mode=0%o\n", out, s->st_mode); printf("%06x%08x%08x%08x%08x%08x%08x" @@ -172,7 +180,7 @@ static void _archive_dir(char *in, char *out, int ilen, int olen) int size = 32; int entries = 0; - char** names = malloc(size * sizeof(char*)); + char** names = (char**) malloc(size * sizeof(char*)); if (names == NULL) { fprintf(stderr, "failed to allocate dir names array (size %d)\n", size); exit(1); @@ -187,7 +195,7 @@ static void _archive_dir(char *in, char *out, int ilen, int olen) if (entries >= size) { size *= 2; - names = realloc(names, size * sizeof(char*)); + names = (char**) realloc(names, size * sizeof(char*)); if (names == NULL) { fprintf(stderr, "failed to reallocate dir names array (size %d)\n", size);