From owner-freebsd-standards@FreeBSD.ORG Thu Mar 22 03:43:25 2012 Return-Path: Delivered-To: standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 303651065670; Thu, 22 Mar 2012 03:43:25 +0000 (UTC) (envelope-from matthewstory@gmail.com) Received: from mail-vx0-f182.google.com (mail-vx0-f182.google.com [209.85.220.182]) by mx1.freebsd.org (Postfix) with ESMTP id BF2768FC12; Thu, 22 Mar 2012 03:43:24 +0000 (UTC) Received: by vcmm1 with SMTP id m1so2346220vcm.13 for ; Wed, 21 Mar 2012 20:43:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=mD7l6UNvTE4MLn2owDs1j92qphYDC8Aug8hD1nBuFCE=; b=NW7Iu1mqjF2Eaqzc2uLE3dNH06DTDib0ZIoB9oQTtbADhVgSI4wclVZEfMVEf9lL4X BKA/Y7u5KR9hiUEOQ+dc9aNjaUWZRYe1PXobd8surAAC/q8eDHJci+IbxpfJBkNfXnTr +B9aNhRHGpbDxuGez61UKeYRg7LKRApl24j6+fQwRyPYP6ySnwc9XrPffFZeVkDqfwR7 E7gv8Bj7seHhN/mH2dLHz/HRTGnF9P+fUTh+gMNGO1mB7R8vSwIEU+e6witSNcWIpl1k LYVjXP4mr6RZ0VS4M3XhbQ8ibNIajINj7TyheJS+1XnMlbMQHAMpJGepL9UJ0Okpg5Pz ySbg== MIME-Version: 1.0 Received: by 10.220.106.133 with SMTP id x5mr3068298vco.39.1332387804054; Wed, 21 Mar 2012 20:43:24 -0700 (PDT) Received: by 10.52.185.65 with HTTP; Wed, 21 Mar 2012 20:43:24 -0700 (PDT) In-Reply-To: <20120321214525.GA46850@zim.MIT.EDU> References: <201203041403.29020.jhb@freebsd.org> <20120321214525.GA46850@zim.MIT.EDU> Date: Wed, 21 Mar 2012 23:43:24 -0400 Message-ID: From: Matthew Story To: Matthew Story , standards@freebsd.org, jhb@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: Subject: Re: PR kern/164674 X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Mar 2012 03:43:25 -0000 On Wed, Mar 21, 2012 at 5:45 PM, David Schultz wrote: > On Mon, Mar 12, 2012, Matthew Story wrote: > > On Sun, Mar 4, 2012 at 2:03 PM, John Baldwin wrote: > [...snip] > There ought to be a less ugly fix than the one proposed. Probably > the PRINT macro and the various other evil macros in vfprintf() > should set ret to EOF, and the following lines in vfprintf.c should > be removed: > > if (__sferror(fp)) > ret = EOF; > > If vfprintf() is fixed so that printing to a buffered stream > always returns success after a successful write (regardless of the > prior state of the stream's error indicator), that should fix the > problem for unbuffered streams automatically. Unbuffered streams > go through __sbprintf(), which throws away the output if > vfprintf() returns -1. > yeah ... I wasn't overly pleased with my fix as it stands. my concern was that the __sferror(fp) acts as a catch-all for any non-handled error case in the actual print logic. there are only 2 places in the function that explicitly set __SERR and goto error. i'll do a thorough audit of all potential side-effects of the above calls re: __SERR, and follow-up with something less butchered. -- regards, matt