From 954d6c9c0c8ca9e49703fb429ee210e29f777ee0 Mon Sep 17 00:00:00 2001 From: pjd Date: Sun, 12 Mar 2006 09:27:51 +0000 Subject: [PATCH] Flush stdout after printing name of created device, so it can be properly read when 'ggatec create' is used in backticks or its output is piped to another command. Submitted by: Paul Schenkeveld MFC after: 3 days --- ggatec/ggatec.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ggatec/ggatec.c b/ggatec/ggatec.c index 70f667d..e421614 100644 --- a/ggatec/ggatec.c +++ b/ggatec/ggatec.c @@ -457,8 +457,10 @@ g_gatec_create(void) snprintf(ggioc.gctl_info, sizeof(ggioc.gctl_info), "%s:%u %s", host, port, path); g_gate_ioctl(G_GATE_CMD_CREATE, &ggioc); - if (unit == -1) + if (unit == -1) { printf("%s%u\n", G_GATE_PROVIDER_NAME, ggioc.gctl_unit); + fflush(stdout); + } unit = ggioc.gctl_unit; mydaemon();