mirror of
https://github.com/topjohnwu/Magisk.git
synced 2024-12-17 21:47:37 +00:00
Fix a bug when only one script will run
This commit is contained in:
parent
482c9af41f
commit
bcae9dec41
@ -140,14 +140,14 @@ static void pm_setenv(struct vector *v) {
|
|||||||
static void exec_common_script(const char* stage) {
|
static void exec_common_script(const char* stage) {
|
||||||
DIR *dir;
|
DIR *dir;
|
||||||
struct dirent *entry;
|
struct dirent *entry;
|
||||||
snprintf(buf, PATH_MAX, "%s/%s.d", COREDIR, stage);
|
snprintf(buf2, PATH_MAX, "%s/%s.d", COREDIR, stage);
|
||||||
|
|
||||||
if (!(dir = xopendir(buf)))
|
if (!(dir = xopendir(buf2)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
while ((entry = xreaddir(dir))) {
|
while ((entry = xreaddir(dir))) {
|
||||||
if (entry->d_type == DT_REG) {
|
if (entry->d_type == DT_REG) {
|
||||||
snprintf(buf2, PATH_MAX, "%s/%s", buf, entry->d_name);
|
snprintf(buf2, PATH_MAX, "%s/%s.d/%s", COREDIR, stage, entry->d_name);
|
||||||
if (access(buf2, X_OK) == -1)
|
if (access(buf2, X_OK) == -1)
|
||||||
continue;
|
continue;
|
||||||
LOGI("%s.d: exec [%s]\n", stage, entry->d_name);
|
LOGI("%s.d: exec [%s]\n", stage, entry->d_name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user