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
a6f81c66
Commit
a6f81c66
authored
Mar 14, 2021
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bypass stdio
parent
1ff45ac5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
9 deletions
+6
-9
daemon.cpp
native/jni/core/daemon.cpp
+6
-9
No files found.
native/jni/core/daemon.cpp
View file @
a6f81c66
...
@@ -310,7 +310,7 @@ static void logfile_writer(int sockfd) {
...
@@ -310,7 +310,7 @@ static void logfile_writer(int sockfd) {
char
*
log_buf
;
char
*
log_buf
;
size_t
buf_len
;
size_t
buf_len
;
s
FILE
log_fp
=
make_stream_fp
<
byte_stream
>
(
log_buf
,
buf_len
);
s
tream
*
log_strm
=
new
byte_stream
(
log_buf
,
buf_len
);
msghdr
msg
{};
msghdr
msg
{};
iovec
iov
{};
iovec
iov
{};
...
@@ -342,12 +342,9 @@ static void logfile_writer(int sockfd) {
...
@@ -342,12 +342,9 @@ static void logfile_writer(int sockfd) {
return
;
return
;
if
(
log_buf
)
if
(
log_buf
)
write
(
fd
,
log_buf
,
buf_len
);
write
(
fd
,
log_buf
,
buf_len
);
if
(
FILE
*
fp
=
fdopen
(
fd
,
"a"
))
{
setbuf
(
fp
,
nullptr
);
delete
log_strm
;
log_fp
=
make_file
(
fp
);
log_strm
=
new
fd_stream
(
fd
);
}
else
{
return
;
}
continue
;
continue
;
}
}
...
@@ -382,12 +379,12 @@ static void logfile_writer(int sockfd) {
...
@@ -382,12 +379,12 @@ static void logfile_writer(int sockfd) {
iov
.
iov_len
=
meta
.
len
;
iov
.
iov_len
=
meta
.
len
;
if
(
recvmsg
(
sockfd
,
&
msg
,
0
)
<=
0
)
if
(
recvmsg
(
sockfd
,
&
msg
,
0
)
<=
0
)
return
;
return
;
fwrite
(
buf
,
off
+
meta
.
len
,
1
,
log_fp
.
get
()
);
log_strm
->
write
(
buf
,
off
+
meta
.
len
);
}
}
}
}
static
int
magisk_log
(
int
prio
,
const
char
*
fmt
,
va_list
ap
)
{
static
int
magisk_log
(
int
prio
,
const
char
*
fmt
,
va_list
ap
)
{
char
buf
[
40
96
];
char
buf
[
40
00
];
int
len
=
vsnprintf
(
buf
,
sizeof
(
buf
),
fmt
,
ap
)
+
1
;
int
len
=
vsnprintf
(
buf
,
sizeof
(
buf
),
fmt
,
ap
)
+
1
;
if
(
log_sockfd
>=
0
)
{
if
(
log_sockfd
>=
0
)
{
...
...
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