From 6dc9ccad75a0d48a1bd38ac055c3c60337941063 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Fri, 26 Oct 2018 17:02:56 -0400 Subject: [PATCH] Use const char* --- native/jni/init.c | 4 ++-- native/jni/utils/file.c | 2 +- native/jni/utils/include/utils.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/native/jni/init.c b/native/jni/init.c index 3086c8944..46bb6837e 100644 --- a/native/jni/init.c +++ b/native/jni/init.c @@ -370,7 +370,7 @@ int main(int argc, char *argv[]) { if (cmd.skip_initramfs) { // Clear rootfs - excl_list = (char *[]) { "overlay", ".backup", "proc", "sys", "init.bak", NULL }; + excl_list = (const char *[]) { "overlay", ".backup", "proc", "sys", "init.bak", NULL }; frm_rf(root); } else { // Revert original init binary @@ -399,7 +399,7 @@ int main(int argc, char *argv[]) { int system_root = open("/system_root", O_RDONLY | O_CLOEXEC); // Clone rootfs except /system - excl_list = (char *[]) { "system", NULL }; + excl_list = (const char *[]) { "system", NULL }; clone_dir(system_root, root); close(system_root); diff --git a/native/jni/utils/file.c b/native/jni/utils/file.c index 086353bfc..ed6f1dfe0 100644 --- a/native/jni/utils/file.c +++ b/native/jni/utils/file.c @@ -15,7 +15,7 @@ #include "utils.h" #include "selinux.h" -char **excl_list = NULL; +const char **excl_list = NULL; static int is_excl(const char *name) { if (excl_list) diff --git a/native/jni/utils/include/utils.h b/native/jni/utils/include/utils.h index 36e795523..2ac516af9 100644 --- a/native/jni/utils/include/utils.h +++ b/native/jni/utils/include/utils.h @@ -109,7 +109,7 @@ int __fsetxattr(int fd, const char *name, const void *value, size_t size, int fl #define align(p, a) (((p) + (a) - 1) / (a) * (a)) #define align_off(p, a) (align(p, a) - (p)) -extern char **excl_list; +extern const char **excl_list; struct file_attr { struct stat st;