Create generic streams on top of stdio

WIP
This commit is contained in:
topjohnwu
2019-11-20 21:48:49 -05:00
parent bb9ce0e897
commit 4f9a25ee89
6 changed files with 223 additions and 88 deletions

View File

@@ -7,6 +7,7 @@
#include <utils.h>
#include <logging.h>
#include <stream.h>
#include "magiskpolicy.h"
#include "sepolicy.h"
@@ -180,7 +181,7 @@ int dump_policydb(const char *file) {
size_t len;
pf.type = PF_USE_STDIO;
pf.fp = open_memfile(data, len);
pf.fp = open_stream<byte_stream>(data, len);
if (policydb_write(magisk_policydb, &pf)) {
LOGE("Fail to create policy image\n");
return 1;