mirror of
https://github.com/qemu/qemu.git
synced 2025-08-16 06:43:21 +00:00
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>
This commit is contained in:
parent
106f8da664
commit
e0add9a835
@ -4652,7 +4652,7 @@ static int elf_core_dump(int signr, const CPUArchState *env)
|
|||||||
|
|
||||||
{
|
{
|
||||||
g_autofree char *corefile = core_dump_filename(ts);
|
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);
|
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
|
||||||
}
|
}
|
||||||
if (fd < 0) {
|
if (fd < 0) {
|
||||||
|
Loading…
Reference in New Issue
Block a user