Some code adjustments

This commit is contained in:
topjohnwu
2019-02-24 23:09:34 -05:00
parent 63b18246d8
commit c9fa8118d1
15 changed files with 65 additions and 95 deletions

View File

@@ -152,7 +152,7 @@ void cpio::output(OutStream &out) {
cpio_rw::cpio_rw(const char *filename) {
char *buf;
size_t sz;
mmap_ro(filename, (void **) &buf, &sz);
mmap_ro(filename, buf, sz);
fprintf(stderr, "Loading cpio: [%s]\n", filename);
load_cpio(buf, sz);
munmap(buf, sz);
@@ -172,7 +172,7 @@ void cpio_rw::insert(cpio_entry *e) {
void cpio_rw::add(mode_t mode, const char *name, const char *file) {
void *buf;
size_t sz;
mmap_ro(file, &buf, &sz);
mmap_ro(file, buf, sz);
auto e = new cpio_entry(name, S_IFREG | mode);
e->filesize = sz;
e->data = xmalloc(sz);
@@ -242,7 +242,7 @@ void cpio_rw::load_cpio(char *buf, size_t sz) {
}
cpio_mmap::cpio_mmap(const char *filename) {
mmap_ro(filename, (void **) &buf, &sz);
mmap_ro(filename, buf, sz);
fprintf(stderr, "Loading cpio: [%s]\n", filename);
size_t pos = 0;
cpio_newc_header *header;