diff options
author | Richard Henderson <richard.henderson@linaro.org> | 2024-02-26 17:07:38 -1000 |
---|---|---|
committer | Richard Henderson <richard.henderson@linaro.org> | 2024-02-29 08:48:02 -1000 |
commit | e0add9a835c6259df211eb4874d3d00d9d016796 (patch) | |
tree | b935baf13f55086e4be941a0ff68ada9bcfa6f9c /linux-user | |
parent | 106f8da6643634f141b39198576156a4c5bd6e60 (diff) |
linux-user/elfload: Truncate core file on open
While we usually create a new corefile, truncate otherwise.
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
Diffstat (limited to 'linux-user')
-rw-r--r-- | linux-user/elfload.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/linux-user/elfload.c b/linux-user/elfload.c index 877799e9c7..16dd08a828 100644 --- a/linux-user/elfload.c +++ b/linux-user/elfload.c @@ -4652,7 +4652,7 @@ static int elf_core_dump(int signr, const CPUArchState *env) { g_autofree char *corefile = core_dump_filename(ts); - fd = open(corefile, O_WRONLY | O_CREAT, + fd = open(corefile, O_WRONLY | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); } if (fd < 0) { |