[PATCH] Before calling execvp(), reset needs to flush stdout.

Glenn Matthews (glmatthe) glmatthe at cisco.com
Thu Feb 16 14:45:59 UTC 2017


Before calling execvp(), reset needs to flush stdout.

Otherwise the reset sequence gets dropped on the floor.
---
 AUTHORS               | 3 +++
 console-tools/reset.c | 2 ++
 2 files changed, 5 insertions(+)

diff --git a/AUTHORS b/AUTHORS
index fa58697..9410c5e 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -95,6 +95,9 @@ Stephan Linz <linz at li-pro.net>
 John Lombardo <john at deltanet.com>
     tr
 
+Glenn Matthews <glmatthe at cisco.com>
+    Bug fix(es).
+
 Glenn McGrath <glenn.l.mcgrath at gmail.com>
     Common unarchiving code and unarchiving applets, ifupdown, ftpgetput,
     nameif, sed, patch, fold, install, uudecode.
diff --git a/console-tools/reset.c b/console-tools/reset.c
index 57cebb4..7c7b99d 100644
--- a/console-tools/reset.c
+++ b/console-tools/reset.c
@@ -56,6 +56,8 @@ int reset_main(int argc UNUSED_PARAM, char **argv UNUSED_PARAM)
 #if ENABLE_STTY
 		return stty_main(2, (char**)args);
 #else
+		/* Make sure stdout gets drained before we execvp */
+		fflush(stdout);
 		execvp("stty", (char**)args);
 #endif
 	}
-- 
2.9.3






More information about the busybox mailing list