From owner-freebsd-geom@FreeBSD.ORG Sat Mar 11 01:25:04 2006 Return-Path: X-Original-To: freebsd-geom@freebsd.org Delivered-To: freebsd-geom@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E686916A64B for ; Sat, 11 Mar 2006 01:24:56 +0000 (GMT) (envelope-from fb-geom@psconsult.nl) Received: from mx0.psconsult.nl (ps226.psconsult.nl [213.222.19.226]) by mx1.FreeBSD.org (Postfix) with ESMTP id 103A346424 for ; Fri, 10 Mar 2006 15:29:02 +0000 (GMT) (envelope-from fb-geom@psconsult.nl) Received: from phuket.psconsult.nl (localhost [127.0.0.1]) by mx0.psconsult.nl (8.12.8p2/8.12.8) with ESMTP id k2AFT0pe014456 for ; Fri, 10 Mar 2006 16:29:00 +0100 (CET) (envelope-from fb-geom@psconsult.nl) Received: (from paul@localhost) by phuket.psconsult.nl (8.12.8p2/8.12.8/Submit) id k2AFT0iS014454 for freebsd-geom@freebsd.org; Fri, 10 Mar 2006 16:29:00 +0100 (CET) Date: Fri, 10 Mar 2006 16:29:00 +0100 From: Paul Schenkeveld To: freebsd-geom@freebsd.org Message-ID: <20060310152859.GA14414@psconsult.nl> Mail-Followup-To: freebsd-geom@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i Subject: ggatec patch X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Mar 2006 01:25:04 -0000 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