diff --git a/nyx/interface.c b/nyx/interface.c index 56ffc54d7c..eabbae9972 100644 --- a/nyx/interface.c +++ b/nyx/interface.c @@ -260,30 +260,6 @@ static bool verify_workdir_state(nyx_interface_state *s, Error **errp){ } free(tmp); - assert(asprintf(&tmp, "%s/page_cache.lock", workdir) != -1); - if (!file_exits(tmp)){ - fprintf(stderr, "%s does not exist...", tmp); - free(tmp); - return false; - } - free(tmp); - - assert(asprintf(&tmp, "%s/page_cache.addr", workdir) != -1); - if (!file_exits(tmp)){ - fprintf(stderr, "%s does not exist...\n", tmp); - free(tmp); - return false; - } - free(tmp); - - assert(asprintf(&tmp, "%s/page_cache.dump", workdir) != -1); - if (!file_exits(tmp)){ - fprintf(stderr, "%s does not exist...\n", tmp); - free(tmp); - return false; - } - free(tmp); - assert(asprintf(&tmp, "%s/page_cache", workdir) != -1); init_page_cache(tmp); diff --git a/nyx/page_cache.c b/nyx/page_cache.c index 7d40dff85e..55689316c8 100644 --- a/nyx/page_cache.c +++ b/nyx/page_cache.c @@ -359,12 +359,12 @@ page_cache_t* page_cache_new(const char* cache_file, uint8_t disassembler_word_w self->lookup = kh_init(PC_CACHE); - self->fd_page_file = open(tmp1, O_CLOEXEC | O_RDWR, S_IRWXU); - self->fd_address_file = open(tmp2, O_CLOEXEC | O_RDWR, S_IRWXU); + self->fd_page_file = open(tmp1, O_CLOEXEC | O_CREAT | O_RDWR, 0644); + self->fd_address_file = open(tmp2, O_CLOEXEC | O_CREAT | O_RDWR, 0644); #ifndef STANDALONE_DECODER self->cpu = cpu; - self->fd_lock = open(tmp3, O_CLOEXEC); + self->fd_lock = open(tmp3, O_CLOEXEC | O_CREAT, 0644); assert(self->fd_lock > 0); #else if(self->fd_page_file == -1 || self->fd_address_file == -1){ diff --git a/nyx/pt.c b/nyx/pt.c index 80de789ed1..193ef8ea09 100644 --- a/nyx/pt.c +++ b/nyx/pt.c @@ -58,7 +58,7 @@ bool should_dump_pt_trace= false; /* dump PT trace as returned from HW */ void pt_open_pt_trace_file(char* filename){ printf("using pt trace at %s",filename); - pt_trace_dump_fd = open(filename, O_WRONLY); + pt_trace_dump_fd = open(filename, O_CREAT|O_TRUNC|O_WRONLY, 0644); should_dump_pt_trace = true; assert(pt_trace_dump_fd >= 0); }