You've already forked ReZygisk
mirror of
https://github.com/PerformanC/ReZygisk.git
synced 2025-09-06 06:37:01 +00:00
improve: TMP_PATH related code
This commit improves the code that decides which path will be for "TMP_PATH" variable.
This commit is contained in:
@@ -14,18 +14,15 @@ int main(int argc, char **argv) {
|
|||||||
if (getenv("TMP_PATH") == NULL) {
|
if (getenv("TMP_PATH") == NULL) {
|
||||||
tmp_path_type = SBIN_AS_TMP_PATH;
|
tmp_path_type = SBIN_AS_TMP_PATH;
|
||||||
|
|
||||||
FILE *fp = fopen("/sbin", "r");
|
if (access("/sbin", F_OK) == -1) {
|
||||||
if (fp == NULL) {
|
|
||||||
tmp_path_type = DEBUG_RAMDISK_AS_TMP_PATH;
|
tmp_path_type = DEBUG_RAMDISK_AS_TMP_PATH;
|
||||||
|
|
||||||
fp = fopen("/debug_ramdisk", "r");
|
if (access("/debug_ramdisk", F_OK) == -1) {
|
||||||
|
|
||||||
if (fp == NULL) {
|
|
||||||
printf("Cannot find TMP_PATH. You should make an issue about that.\n");
|
printf("Cannot find TMP_PATH. You should make an issue about that.\n");
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
} else fclose(fp);
|
}
|
||||||
} else fclose(fp);
|
}
|
||||||
} else {
|
} else {
|
||||||
tmp_path_type = CUSTOM_TMP_PATH;
|
tmp_path_type = CUSTOM_TMP_PATH;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user