From owner-cvs-all Fri Sep 7 11:27:11 2001 Delivered-To: cvs-all@freebsd.org Received: from Awfulhak.org (gw.Awfulhak.org [217.204.245.18]) by hub.freebsd.org (Postfix) with ESMTP id 4670437B401; Fri, 7 Sep 2001 11:26:59 -0700 (PDT) Received: from hak.lan.Awfulhak.org (root@hak.lan.Awfulhak.org [fec0::1:12]) by Awfulhak.org (8.11.6/8.11.6) with ESMTP id f87IQvi30196; Fri, 7 Sep 2001 19:26:57 +0100 (BST) (envelope-from brian@freebsd-services.com) Received: from hak.lan.Awfulhak.org (brian@localhost [127.0.0.1]) by hak.lan.Awfulhak.org (8.11.6/8.11.6) with ESMTP id f87IQtJ20155; Fri, 7 Sep 2001 19:26:55 +0100 (BST) (envelope-from brian@freebsd-services.com) Message-Id: <200109071826.f87IQtJ20155@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: "Andrey A. Chernov" Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org, brian@freebsd-services.com Subject: Re: cvs commit: src/lib/libc/stdio stdio.c In-Reply-To: Message from "Andrey A. Chernov" of "Fri, 07 Sep 2001 10:16:03 PDT." <200109071716.f87HG3a05025@freefall.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 07 Sep 2001 19:26:55 +0100 From: Brian Somers Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG > ache 2001/09/07 10:16:03 PDT > > Modified files: > lib/libc/stdio stdio.c > Log: > 1) If __SAPP stream is not seekable, remove __SAPP flag on first call instead > of repeating unsuccessful lseek call on each write (original stdio bug). > > 2) Save errno accross _sseek call in _swrite to not touch it in case write > success (original stdio bug). > > 3) Add _sseek error checking back, but only for __SOPT mode now. > > Revision Changes Path > 1.18 +11 -4 src/lib/libc/stdio/stdio.c Will the following code work ? fd = socket(blah); connect(fd, blah); dup2(fd, STDIN_FILENO); fp = fopen(fd, "a+"); fputc('x', fp); close(STDIN_FILENO); open("myfile", O_RDWR|O_APPEND); /* file contains data */ fseek(fp, 0, SEEK_SET); fputs("hello world\n", fp); or will it end up not attempting to seek to the end of the file and overwriting from offset 0 ? I haven't read the diffs yet Cheers. -- Brian http://www.freebsd-services.com/ Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message