Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Mar 2006 16:29:00 +0100
From:      Paul Schenkeveld <fb-geom@psconsult.nl>
To:        freebsd-geom@freebsd.org
Subject:   ggatec patch
Message-ID:  <20060310152859.GA14414@psconsult.nl>

next in thread | raw e-mail | index | archive | help
Hi,

Observed on a recent 6-STABLE

Ggatec create prints the allocated provider name to stdout.  When
stdout is used in `` or piped, nothing is output.  Adding fflush()
cures the problem:

Index: ggatec.c
===================================================================
RCS file: /FreeBSD/cvs/src/sbin/ggate/ggatec/ggatec.c,v
retrieving revision 1.6
diff -u -r1.6 ggatec.c
--- ggatec.c	10 Jul 2005 21:10:20 -0000	1.6
+++ ggatec.c	10 Mar 2006 15:24:25 -0000
@@ -457,8 +457,10 @@
 	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();

Regards,

Paul Schenkeveld



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060310152859.GA14414>