ggatec patch

Paul Schenkeveld fb-geom at psconsult.nl
Sat Mar 11 01:25:04 UTC 2006


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


More information about the freebsd-geom mailing list