Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
dd5a3416
Commit
dd5a3416
authored
Mar 19, 2022
by
LoveSy
Committed by
John Wu
Mar 19, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix multiple modules adding the same subdirectory
parent
2fb49ad7
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
9 deletions
+16
-9
module.cpp
native/jni/core/module.cpp
+16
-9
No files found.
native/jni/core/module.cpp
View file @
dd5a3416
...
...
@@ -319,9 +319,9 @@ dir_node::iterator dir_node::insert(iterator it, uint8_t type, const Func &fn, b
else
it
=
children
.
emplace_hint
(
--
it
,
node
->
_name
,
node
);
}
else
{
if
(
get_same
&&
it
->
second
->
node_type
==
type
)
return
it
;
if
(
get_same
&&
it
->
second
->
node_type
!=
type
)
return
children
.
end
();
return
it
;
}
}
else
{
node
=
fn
(
node
);
...
...
@@ -436,10 +436,14 @@ bool dir_node::collect_files(const char *module, int dfd) {
}
if
(
entry
->
d_type
==
DT_DIR
)
{
// Need check cause emplace could fail due to previous module dir replace
if
(
auto
dn
=
emplace_or_get
<
inter_node
>
(
entry
->
d_name
,
entry
->
d_name
,
module
);
dn
&&
!
dn
->
collect_files
(
module
,
dirfd
(
dir
.
get
())))
{
// Upgrade node to module due to '.replace'
dir_node
*
dn
;
if
(
auto
it
=
children
.
find
(
entry
->
d_name
);
it
==
children
.
end
())
{
dn
=
emplace
<
inter_node
>
(
entry
->
d_name
,
entry
->
d_name
,
module
);
}
else
{
dn
=
iterator_to_node
<
dir_node
>
(
upgrade
<
tmpfs_node
>
(
it
));
dn
->
set_exist
(
true
);
}
if
(
dn
&&
!
dn
->
collect_files
(
module
,
dirfd
(
dir
.
get
())))
{
upgrade
<
module_node
>
(
dn
->
name
(),
module
);
}
}
else
{
...
...
@@ -484,8 +488,11 @@ void tmpfs_node::mount() {
return
;
string
src
=
mirror_path
();
const
string
&
dest
=
node_path
();
file_attr
a
;
file_attr
a
{};
if
(
access
(
src
.
data
(),
F_OK
)
==
0
)
getattr
(
src
.
data
(),
&
a
);
else
getattr
(
parent
()
->
node_path
().
data
(),
&
a
);
mkdir
(
dest
.
data
(),
0
);
if
(
!
isa
<
tmpfs_node
>
(
parent
()))
{
// We don't need another layer of tmpfs if parent is skel
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment