Close files, cleanup resourses

This commit is contained in:
topjohnwu
2017-05-02 04:55:55 +08:00
parent e16d604d0d
commit 6017ff2318
5 changed files with 17 additions and 12 deletions

View File

@ -8,6 +8,7 @@
#include <stdio.h>
#include <limits.h>
#include <pthread.h>
#include <unistd.h>
#include "magisk.h"
#include "utils.h"
@ -29,6 +30,7 @@ static void *logger_thread(void *args) {
while (fdgets(buffer, sizeof(buffer), fd)) {
fprintf(logfile, "%s", buffer);
}
close(fd);
return NULL;
}