aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Norton <rmn30@cam.ac.uk>2019-07-02 16:36:53 +0100
committerRobert Norton <rmn30@cam.ac.uk>2019-07-02 16:36:53 +0100
commit39376dd662d67e2fe014a3c1c8d47a6e74615a4b (patch)
tree19ac51f4ffce0c2ea48dda318199747c59de6d95
parentde87f3ea6c83dec65dbc72d54bdb5f78d222470c (diff)
downloadsail-riscv-39376dd662d67e2fe014a3c1c8d47a6e74615a4b.zip
sail-riscv-39376dd662d67e2fe014a3c1c8d47a6e74615a4b.tar.gz
sail-riscv-39376dd662d67e2fe014a3c1c8d47a6e74615a4b.tar.bz2
Default terminal output to stdout instead of in 'term.log'.
-rw-r--r--c_emulator/riscv_sim.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/c_emulator/riscv_sim.c b/c_emulator/riscv_sim.c
index 9dec838..5cef660 100644
--- a/c_emulator/riscv_sim.c
+++ b/c_emulator/riscv_sim.c
@@ -288,7 +288,6 @@ char *process_args(int argc, char **argv)
print_usage(argv[0], 0);
}
#endif
- if (term_log == NULL) term_log = strdup("term.log");
if (dtb_file) read_dtb(dtb_file);
#ifdef RVFI_DII
@@ -799,7 +798,7 @@ void init_logs()
}
#endif
- if ((term_fd = open(term_log, O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR|S_IRGRP|S_IROTH|S_IWUSR)) < 0) {
+ if (term_log != NULL && (term_fd = open(term_log, O_WRONLY|O_CREAT|O_TRUNC, S_IRUSR|S_IRGRP|S_IROTH|S_IWUSR)) < 0) {
fprintf(stderr, "Cannot create terminal log '%s': %s\n", term_log, strerror(errno));
exit(1);
}