Init code rearrangement

This commit is contained in:
topjohnwu
2019-06-30 11:39:13 -07:00
parent e8b73ba6d1
commit db8dd9f186
4 changed files with 46 additions and 63 deletions

View File

@ -1,4 +1,3 @@
#include <sys/mount.h>
#include <sys/sysmacros.h>
#include <string.h>
#include <stdio.h>
@ -77,6 +76,13 @@ static dev_t setup_block(const char *partname, char *block_dev = nullptr) {
}
}
static bool is_lnk(const char *name) {
struct stat st;
if (lstat(name, &st))
return false;
return S_ISLNK(st.st_mode);
}
bool MagiskInit::read_dt_fstab(const char *name, char *partname, char *fstype) {
char path[128];
int fd;