This is the mail archive of the
elfutils-devel@sourceware.org
mailing list for the elfutils project.
[PATCH] addr2line: Add explicit fflush for stdout when reading from stdin.
- From: Mark Wielaard <mark at klomp dot org>
- To: elfutils-devel at sourceware dot org
- Cc: Mark Wielaard <mark at klomp dot org>
- Date: Sat, 12 May 2018 21:42:45 +0200
- Subject: [PATCH] addr2line: Add explicit fflush for stdout when reading from stdin.
To make it possible to use eu-addr2line interactively through a pipe we
need to explicitly flush stdout after handling each line from stdin.
https://sourceware.org/bugzilla/show_bug.cgi?id=23173
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
src/ChangeLog | 5 +++++
src/addr2line.c | 1 +
2 files changed, 6 insertions(+)
diff --git a/src/ChangeLog b/src/ChangeLog
index 0a8b86c8..24504077 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2018-05-12 Mark Wielaard <mark@klomp.org>
+
+ * addr2line.c (main): Add fflush (stdout) after handle_address ()
+ when reading from stdin.
+
2018-04-24 Mark Wielaard <mark@klomp.org>
* readelf.c (print_debug_aranges_section): Try elf_rawdata if no
diff --git a/src/addr2line.c b/src/addr2line.c
index 444ee52c..5acafa00 100644
--- a/src/addr2line.c
+++ b/src/addr2line.c
@@ -187,6 +187,7 @@ main (int argc, char *argv[])
buf[chars - 1] = '\0';
result = handle_address (buf, dwfl);
+ fflush (stdout);
}
free (buf);
--
2.17.0