summaryrefslogtreecommitdiffstats
path: root/sbin/ggate
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2006-03-12 09:27:51 +0000
committerpjd <pjd@FreeBSD.org>2006-03-12 09:27:51 +0000
commit99e53051048b5daf4449f1876b12b61b01f24b37 (patch)
tree8b192705d52918bf88bb078e2feabbea74c58dd1 /sbin/ggate
parente60804a129079e9c7fd413a76de949964fc6b1a3 (diff)
downloadFreeBSD-src-99e53051048b5daf4449f1876b12b61b01f24b37.zip
FreeBSD-src-99e53051048b5daf4449f1876b12b61b01f24b37.tar.gz
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
Diffstat (limited to 'sbin/ggate')
-rw-r--r--sbin/ggate/ggatec/ggatec.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sbin/ggate/ggatec/ggatec.c b/sbin/ggate/ggatec/ggatec.c
index 70f667d..e421614 100644
--- a/sbin/ggate/ggatec/ggatec.c
+++ b/sbin/ggate/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();
OpenPOWER on IntegriCloud