From owner-freebsd-bugs Mon Jun 24 23:20:12 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id B3E0037B401 for ; Mon, 24 Jun 2002 23:20:03 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g5P6K3i14665; Mon, 24 Jun 2002 23:20:03 -0700 (PDT) (envelope-from gnats) Date: Mon, 24 Jun 2002 23:20:03 -0700 (PDT) Message-Id: <200206250620.g5P6K3i14665@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Paul Herman Subject: Re: bin/38676: change request for pw command Reply-To: Paul Herman Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org The following reply was made to PR bin/38676; it has been noted by GNATS. From: Paul Herman To: "Matthew D. Fuller" Cc: FreeBSD-gnats-submit@FreeBSD.ORG, Takumi ISHII , "Geoffrey C. Speicher" Subject: Re: bin/38676: change request for pw command Date: Mon, 24 Jun 2002 23:07:14 -0700 (PDT) On Tue, 25 Jun 2002, Matthew D. Fuller wrote: > > + for (;;) { > > + [ stuff(); ] > > + close(infd); > > + } > > Might I suggest a sleep(1); in there? Give the poor CPU a break! :-> :-) That's what I first thought, but open() will block until the lock frees up. If the link count isn't 1, I don't think it should sleep, but it just as well could usleep() I suppose, but I don't think it's a big deal. This idea was taken from Matt Dillon's pwd_mkdb.c rev 1.29 fix. -Paul. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message