From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from metis.ext.pengutronix.de ([2001:67c:670:201:290:27ff:fe1d:cc33]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1bpJwV-0004Pl-9U for barebox@lists.infradead.org; Wed, 28 Sep 2016 18:50:56 +0000 From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= Date: Wed, 28 Sep 2016 20:50:12 +0200 Message-Id: <20160928185017.25002-3-u.kleine-koenig@pengutronix.de> In-Reply-To: <20160928185017.25002-1-u.kleine-koenig@pengutronix.de> References: <20160928185017.25002-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 2/7] scripts: kwboot: flush input and output only once To: barebox@lists.infradead.org V2hlbiBmbHVzaGluZyBpbnB1dCBiZWZvcmUgc2VuZGluZyBvZiBhIGJvb3QgbWVzc2FnZSB0aGUg YWNrbm93bGVkZ2luZwpyZXBseSBmb3IgdGhlIHByZXZpb3VzIG1lc3NhZ2UgZnJvbSB0aGUgQ1BV IG1pZ2h0IGJlIGRpc2NhcmRlZCBhbmQgc28KbWlzc2VkLgoKU28gb25seSBmbHVzaCBvbmNlIGJl Zm9yZSBzZW5kaW5nIGJvb3QgbWVzc2FnZXMgaW4gYSBsb29wLgoKU2lnbmVkLW9mZi1ieTogVXdl IEtsZWluZS1Lw7ZuaWcgPHUua2xlaW5lLWtvZW5pZ0BwZW5ndXRyb25peC5kZT4KLS0tCiBzY3Jp cHRzL2t3Ym9vdC5jIHwgMTYgKysrKysrKystLS0tLS0tLQogMSBmaWxlIGNoYW5nZWQsIDggaW5z ZXJ0aW9ucygrKSwgOCBkZWxldGlvbnMoLSkKCmRpZmYgLS1naXQgYS9zY3Jpc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