Build magiskboot with crt0

This commit is contained in:
topjohnwu
2024-02-29 02:36:05 -08:00
parent b1297c4192
commit 24e46a5971
8 changed files with 61 additions and 31 deletions
+4 -12
View File
@@ -75,12 +75,8 @@ void file_readline(bool trim, FILE *fp, const function<bool(string_view)> &fn) {
}
void file_readline(bool trim, const char *file, const function<bool(string_view)> &fn) {
int fd = xopen(file, O_RDONLY | O_CLOEXEC);
if (fd >= 0) {
auto fp = fdopen(fd, "re");
file_readline(trim, fp, fn);
fclose(fp);
}
if (auto fp = open_file(file, "re"))
file_readline(trim, fp.get(), fn);
}
void file_readline(const char *file, const function<bool(string_view)> &fn) {
@@ -101,12 +97,8 @@ void parse_prop_file(FILE *fp, const function<bool(string_view, string_view)> &f
}
void parse_prop_file(const char *file, const function<bool(string_view, string_view)> &fn) {
int fd = xopen(file, O_RDONLY | O_CLOEXEC);
if (fd >= 0) {
auto fp = fdopen(fd, "re");
parse_prop_file(fp, fn);
fclose(fp);
}
if (auto fp = open_file(file, "re"))
parse_prop_file(fp.get(), fn);
}
std::vector<mount_info> parse_mount_info(const char *pid) {