From owner-cvs-all Tue May 8 2: 9:24 2001 Delivered-To: cvs-all@freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 360F737B423; Tue, 8 May 2001 02:09:20 -0700 (PDT) (envelope-from alfred@FreeBSD.org) Received: (from alfred@localhost) by freefall.freebsd.org (8.11.1/8.11.1) id f4899Kl98410; Tue, 8 May 2001 02:09:20 -0700 (PDT) (envelope-from alfred) Message-Id: <200105080909.f4899Kl98410@freefall.freebsd.org> From: Alfred Perlstein Date: Tue, 8 May 2001 02:09:19 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/kern sys_pipe.c X-FreeBSD-CVS-Branch: HEAD Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG alfred 2001/05/08 02:09:19 PDT Modified files: sys/kern sys_pipe.c Log: Remove an 'optimization' I hope to never see again. The pipe code could not handle running out of kva, it would panic if that happened. Instead return ENFILE to the application which is an acceptable error return from pipe(2). There was some slightly tricky things that needed to be worked on, namely that the pipe code can 'realloc' the size of the buffer if it detects that the pipe could use a bit more room. However if it failed the reallocation it could not cope and would panic. Fix this by attempting to grow the pipe while holding onto our old resources. If all goes well free the old resources and use the new ones, otherwise continue to use the smaller buffer already allocated. While I'm here add a few blank lines for style(9) and remove 'register'. Revision Changes Path 1.73 +112 -90 src/sys/kern/sys_pipe.c To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message