summaryrefslogtreecommitdiffstats
path: root/src/readelf.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/readelf.c')
-rw-r--r--src/readelf.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/readelf.c b/src/readelf.c
index 0725313e..a578b276 100644
--- a/src/readelf.c
+++ b/src/readelf.c
@@ -35,6 +35,8 @@
#include <locale.h>
#include <stdarg.h>
#include <stdbool.h>
+#include <stdio.h>
+#include <stdio_ext.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
@@ -310,6 +312,9 @@ static void dump_archive_index (Elf *, const char *);
int
main (int argc, char *argv[])
{
+ /* We use no threads here which can interfere with handling a stream. */
+ (void) __fsetlocking (stdout, FSETLOCKING_BYCALLER);
+
/* Set locale. */
setlocale (LC_ALL, "");