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
f152bea8
Commit
f152bea8
authored
Feb 26, 2019
by
vvb2060
Committed by
John Wu
Feb 26, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Trim dev name
parent
7b089b88
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletion
+10
-1
init.cpp
native/jni/core/init.cpp
+1
-1
utils.h
native/jni/utils/include/utils.h
+1
-0
misc.cpp
native/jni/utils/misc.cpp
+8
-0
No files found.
native/jni/core/init.cpp
View file @
f152bea8
...
@@ -205,7 +205,7 @@ static bool read_fstab_dt(const struct cmdline *cmd, const char *mnt_point, char
...
@@ -205,7 +205,7 @@ static bool read_fstab_dt(const struct cmdline *cmd, const char *mnt_point, char
if
((
fd
=
xopen
(
buf
,
O_RDONLY
|
O_CLOEXEC
))
>=
0
)
{
if
((
fd
=
xopen
(
buf
,
O_RDONLY
|
O_CLOEXEC
))
>=
0
)
{
read
(
fd
,
buf
,
sizeof
(
buf
));
read
(
fd
,
buf
,
sizeof
(
buf
));
close
(
fd
);
close
(
fd
);
char
*
name
=
strrchr
(
buf
,
'/'
)
+
1
;
char
*
name
=
rtrim
(
strrchr
(
buf
,
'/'
)
+
1
)
;
sprintf
(
partname
,
"%s%s"
,
name
,
strend
(
name
,
cmd
->
slot
)
?
cmd
->
slot
:
""
);
sprintf
(
partname
,
"%s%s"
,
name
,
strend
(
name
,
cmd
->
slot
)
?
cmd
->
slot
:
""
);
sprintf
(
buf
,
"%s/fstab/%s/type"
,
cmd
->
dt_dir
,
mnt_point
);
sprintf
(
buf
,
"%s/fstab/%s/type"
,
cmd
->
dt_dir
,
mnt_point
);
if
((
fd
=
xopen
(
buf
,
O_RDONLY
|
O_CLOEXEC
))
>=
0
)
{
if
((
fd
=
xopen
(
buf
,
O_RDONLY
|
O_CLOEXEC
))
>=
0
)
{
...
...
native/jni/utils/include/utils.h
View file @
f152bea8
...
@@ -79,6 +79,7 @@ int fork_dont_care();
...
@@ -79,6 +79,7 @@ int fork_dont_care();
int
fork_no_zombie
();
int
fork_no_zombie
();
void
gen_rand_str
(
char
*
buf
,
int
len
);
void
gen_rand_str
(
char
*
buf
,
int
len
);
int
strend
(
const
char
*
s1
,
const
char
*
s2
);
int
strend
(
const
char
*
s1
,
const
char
*
s2
);
char
*
rtrim
(
char
*
str
);
void
init_argv0
(
int
argc
,
char
**
argv
);
void
init_argv0
(
int
argc
,
char
**
argv
);
void
set_nice_name
(
const
char
*
name
);
void
set_nice_name
(
const
char
*
name
);
...
...
native/jni/utils/misc.cpp
View file @
f152bea8
...
@@ -222,3 +222,11 @@ bool ends_with(const std::string_view &s1, const std::string_view &s2) {
...
@@ -222,3 +222,11 @@ bool ends_with(const std::string_view &s1, const std::string_view &s2) {
unsigned
l2
=
s2
.
length
();
unsigned
l2
=
s2
.
length
();
return
l1
<
l2
?
false
:
s1
.
compare
(
l1
-
l2
,
l2
,
s2
)
==
0
;
return
l1
<
l2
?
false
:
s1
.
compare
(
l1
-
l2
,
l2
,
s2
)
==
0
;
}
}
char
*
rtrim
(
char
*
str
)
{
int
len
=
strlen
(
str
);
while
(
len
>
0
&&
str
[
len
-
1
]
==
' '
)
--
len
;
str
[
len
]
=
'\0'
;
return
str
;
}
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