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
201e32d4
Commit
201e32d4
authored
Jun 08, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix daemon crashes in encrypted /data
parent
0980cb6e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
11 deletions
+12
-11
bootstages.c
jni/daemon/bootstages.c
+12
-0
log_monitor.c
jni/daemon/log_monitor.c
+0
-11
No files found.
jni/daemon/bootstages.c
View file @
201e32d4
...
@@ -21,6 +21,10 @@
...
@@ -21,6 +21,10 @@
static
char
*
buf
,
*
buf2
;
static
char
*
buf
,
*
buf2
;
static
struct
vector
module_list
;
static
struct
vector
module_list
;
#ifdef DEBUG
static
int
debug_log_pid
,
debug_log_fd
;
#endif
/******************
/******************
* Node structure *
* Node structure *
******************/
******************/
...
@@ -485,12 +489,20 @@ unblock:
...
@@ -485,12 +489,20 @@ unblock:
void
post_fs_data
(
int
client
)
{
void
post_fs_data
(
int
client
)
{
// Error handler
// Error handler
err_handler
=
unblock_boot_process
;
err_handler
=
unblock_boot_process
;
// ack
// ack
write_int
(
client
,
0
);
write_int
(
client
,
0
);
close
(
client
);
close
(
client
);
if
(
!
check_data
())
if
(
!
check_data
())
goto
unblock
;
goto
unblock
;
#ifdef DEBUG
// Start debug logs in new process
debug_log_fd
=
xopen
(
DEBUG_LOG
,
O_WRONLY
|
O_CREAT
|
O_CLOEXEC
|
O_TRUNC
,
0644
);
char
*
const
command
[]
=
{
"logcat"
,
"-v"
,
"brief"
,
NULL
};
debug_log_pid
=
run_command
(
0
,
&
debug_log_fd
,
"/system/bin/logcat"
,
command
);
#endif
LOGI
(
"** post-fs-data mode running
\n
"
);
LOGI
(
"** post-fs-data mode running
\n
"
);
// uninstaller
// uninstaller
...
...
jni/daemon/log_monitor.c
View file @
201e32d4
...
@@ -15,10 +15,6 @@
...
@@ -15,10 +15,6 @@
#include "utils.h"
#include "utils.h"
#include "daemon.h"
#include "daemon.h"
#ifdef DEBUG
int
debug_log_pid
,
debug_log_fd
;
#endif
static
void
*
logger_thread
(
void
*
args
)
{
static
void
*
logger_thread
(
void
*
args
)
{
// Setup error handler
// Setup error handler
err_handler
=
exit_thread
;
err_handler
=
exit_thread
;
...
@@ -47,11 +43,4 @@ void monitor_logs() {
...
@@ -47,11 +43,4 @@ void monitor_logs() {
pthread_t
thread
;
pthread_t
thread
;
xpthread_create
(
&
thread
,
NULL
,
logger_thread
,
NULL
);
xpthread_create
(
&
thread
,
NULL
,
logger_thread
,
NULL
);
pthread_detach
(
thread
);
pthread_detach
(
thread
);
#ifdef DEBUG
// Start debug logs in new process
debug_log_fd
=
xopen
(
DEBUG_LOG
,
O_WRONLY
|
O_CREAT
|
O_CLOEXEC
|
O_TRUNC
,
0644
);
char
*
const
command
[]
=
{
"logcat"
,
"-v"
,
"brief"
,
NULL
};
debug_log_pid
=
run_command
(
0
,
&
debug_log_fd
,
"/system/bin/logcat"
,
command
);
#endif
}
}
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