diff options
Diffstat (limited to 'src/coredump/stacktrace.c')
-rw-r--r-- | src/coredump/stacktrace.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/coredump/stacktrace.c b/src/coredump/stacktrace.c index d37ffae020..95fd27b79a 100644 --- a/src/coredump/stacktrace.c +++ b/src/coredump/stacktrace.c @@ -20,6 +20,7 @@ #include <dwarf.h> #include <elfutils/libdwfl.h> +#include <stdio_ext.h> #include "alloc-util.h" #include "fd-util.h" @@ -108,7 +109,7 @@ static int thread_callback(Dwfl_Thread *thread, void *userdata) { return DWARF_CB_ABORT; if (c->n_thread != 0) - fputc_unlocked('\n', c->f); + fputc('\n', c->f); c->n_frame = 0; @@ -145,6 +146,8 @@ int coredump_make_stack_trace(int fd, const char *executable, char **ret) { if (!c.f) return -ENOMEM; + (void) __fsetlocking(c.f, FSETLOCKING_BYCALLER); + elf_version(EV_CURRENT); c.elf = elf_begin(fd, ELF_C_READ_MMAP, NULL); |