summaryrefslogtreecommitdiff
path: root/arch/sandbox/cpu/start.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2018-10-01 11:55:12 -0600
committerSimon Glass <sjg@chromium.org>2018-10-09 04:40:26 -0600
commit1c5a81d8036966875dd96c5700f8c9a7121c237d (patch)
tree5f551fa6129b6a8dd576a51cbd3ca0aca1dce47e /arch/sandbox/cpu/start.c
parent2b1dc29a12e7a5256577c30a2389a6807d6d2bb6 (diff)
sandbox: Remove the old memory file later
When debugging sandbox it is sometimes annoying that the memory file is deleted early on. If sandbox later crashes or we quit (using the debugger), it is not possible to run it again with the same state since the memory file is gone. Remove the old memory file when sandbox exits, instead. Also add debugging showing the memory filename. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/sandbox/cpu/start.c')
-rw-r--r--arch/sandbox/cpu/start.c6
1 files changed, 1 insertions, 5 deletions
diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index 85f27829ca4..2ee3b485657 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -177,7 +177,7 @@ static int sandbox_cmdline_cb_memory(struct sandbox_state *state,
err = os_read_ram_buf(arg);
if (err) {
- printf("Failed to read RAM buffer\n");
+ printf("Failed to read RAM buffer '%s': %d\n", arg, err);
return err;
}
@@ -314,10 +314,6 @@ int main(int argc, char *argv[])
if (ret)
goto err;
- /* Remove old memory file if required */
- if (state->ram_buf_rm && state->ram_buf_fname)
- os_unlink(state->ram_buf_fname);
-
memset(&data, '\0', sizeof(data));
gd = &data;
#if CONFIG_VAL(SYS_MALLOC_F_LEN)