mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-10-16 09:52:31 +00:00
Make post-fs-data scripts block at most 35 secs
This commit is contained in:
@@ -1,6 +1,3 @@
|
||||
/* misc.cpp - Store all functions that are unable to be catagorized clearly
|
||||
*/
|
||||
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <sys/prctl.h>
|
||||
@@ -20,17 +17,16 @@
|
||||
using namespace std;
|
||||
|
||||
int fork_dont_care() {
|
||||
int pid = xfork();
|
||||
if (pid) {
|
||||
if (int pid = xfork()) {
|
||||
waitpid(pid, nullptr, 0);
|
||||
return pid;
|
||||
} else if ((pid = xfork())) {
|
||||
} else if (xfork()) {
|
||||
exit(0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int fork_no_zombie() {
|
||||
int fork_no_orphan() {
|
||||
int pid = xfork();
|
||||
if (pid)
|
||||
return pid;
|
||||
|
@@ -67,7 +67,7 @@ int new_daemon_thread(std::function<void()> &&entry);
|
||||
|
||||
bool ends_with(const std::string_view &s1, const std::string_view &s2);
|
||||
int fork_dont_care();
|
||||
int fork_no_zombie();
|
||||
int fork_no_orphan();
|
||||
int strend(const char *s1, const char *s2);
|
||||
void init_argv0(int argc, char **argv);
|
||||
void set_nice_name(const char *name);
|
||||
|
Reference in New Issue
Block a user