Move all xwrap to Rust

This commit is contained in:
topjohnwu committed 2022-09-15 01:17:05 -07:00
1 parent 66a7ef5615
commit c6646efe68
18 files changed
+356 -198

No files matched your search

+3 -3
View File
@@ -118,8 +118,8 @@ static void switch_root(const string &path) {
void MagiskInit::mount_rules_dir() {
char path[128];
xrealpath(BLOCKDIR, blk_info.block_dev);
xrealpath(MIRRDIR, path);
xcanonical_path(BLOCKDIR, blk_info.block_dev, sizeof(blk_info.block_dev));
xcanonical_path(MIRRDIR, path, sizeof(path));
char *b = blk_info.block_dev + strlen(blk_info.block_dev);
char *p = path + strlen(path);
@@ -206,7 +206,7 @@ success:
// Create symlink with relative path
char s[128];
s[0] = '.';
strlcpy(s + 1, rel + sizeof(MIRRDIR) - 1, sizeof(s) - 1);
strscpy(s + 1, rel + sizeof(MIRRDIR) - 1, sizeof(s) - 1);
xsymlink(s, path);
} else {
xsymlink(custom_rules_dir.data(), path);