Add common script support

This commit is contained in:
topjohnwu
2017-04-22 06:33:40 +08:00
parent e00e6509ee
commit 9bc8f6e9d7
9 changed files with 89 additions and 18 deletions

View File

@ -14,8 +14,11 @@
#include "daemon.h"
static void *logger_thread(void *args) {
// Setup error handler
err_handler = exit_thread;
char buffer[PATH_MAX];
xrename("/cache/magisk.log", "/cache/last_magisk.log");
rename("/cache/magisk.log", "/cache/last_magisk.log");
FILE *logfile = xfopen("/cache/magisk.log", "w");
// Disable buffering
setbuf(logfile, NULL);