diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-04-04 11:46:44 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2019-04-12 11:44:57 +0200 |
commit | 2fe21124a6560fcf1ce3b0a3004baa9bb45d1e0b (patch) | |
tree | 35448e5d3a8042bb36bada1fedee63ae24ea7b97 /src/coredump | |
parent | b636d78aeeea584b7828df18cb636693af365e2f (diff) | |
download | systemd-2fe21124a6560fcf1ce3b0a3004baa9bb45d1e0b.tar.gz systemd-2fe21124a6560fcf1ce3b0a3004baa9bb45d1e0b.tar.bz2 systemd-2fe21124a6560fcf1ce3b0a3004baa9bb45d1e0b.zip |
Add open_memstream_unlocked() wrapper
Diffstat (limited to 'src/coredump')
-rw-r--r-- | src/coredump/coredump.c | 5 | ||||
-rw-r--r-- | src/coredump/stacktrace.c | 6 |
2 files changed, 3 insertions, 8 deletions
diff --git a/src/coredump/coredump.c b/src/coredump/coredump.c index 023701646b..ac7b972026 100644 --- a/src/coredump/coredump.c +++ b/src/coredump/coredump.c @@ -2,7 +2,6 @@ #include <errno.h> #include <stdio.h> -#include <stdio_ext.h> #include <sys/prctl.h> #include <sys/xattr.h> #include <unistd.h> @@ -530,12 +529,10 @@ static int compose_open_fds(pid_t pid, char **open_fds) { if (proc_fdinfo_fd < 0) return -errno; - stream = open_memstream(&buffer, &size); + stream = open_memstream_unlocked(&buffer, &size); if (!stream) return -ENOMEM; - (void) __fsetlocking(stream, FSETLOCKING_BYCALLER); - FOREACH_DIRENT(dent, proc_fd_dir, return -errno) { _cleanup_fclose_ FILE *fdinfo = NULL; _cleanup_free_ char *fdname = NULL; diff --git a/src/coredump/stacktrace.c b/src/coredump/stacktrace.c index ab1ac12a23..66b2ec8cca 100644 --- a/src/coredump/stacktrace.c +++ b/src/coredump/stacktrace.c @@ -2,11 +2,11 @@ #include <dwarf.h> #include <elfutils/libdwfl.h> -#include <stdio_ext.h> #include <sys/types.h> #include <unistd.h> #include "alloc-util.h" +#include "fileio.h" #include "fd-util.h" #include "format-util.h" #include "macro.h" @@ -126,12 +126,10 @@ int coredump_make_stack_trace(int fd, const char *executable, char **ret) { if (lseek(fd, 0, SEEK_SET) == (off_t) -1) return -errno; - c.f = open_memstream(&buf, &sz); + c.f = open_memstream_unlocked(&buf, &sz); 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); |