From owner-freebsd-bugs@FreeBSD.ORG Mon Jan 19 19:30:19 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3C13B16A4CE for ; Mon, 19 Jan 2004 19:30:19 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 71F0143D3F for ; Mon, 19 Jan 2004 19:30:18 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i0K3UIFR038514 for ; Mon, 19 Jan 2004 19:30:18 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i0K3UIUM038513; Mon, 19 Jan 2004 19:30:18 -0800 (PST) (envelope-from gnats) Date: Mon, 19 Jan 2004 19:30:18 -0800 (PST) Message-Id: <200401200330.i0K3UIUM038513@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: David Schultz Subject: Re: bin/60758: cycle-eating endless loop in lock(1) X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: David Schultz List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Jan 2004 03:30:19 -0000 The following reply was made to PR bin/60758; it has been noted by GNATS. From: David Schultz To: Colin Percival Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: bin/60758: cycle-eating endless loop in lock(1) Date: Mon, 19 Jan 2004 19:22:41 -0800 On Wed, Dec 31, 2003, Colin Percival wrote: > Insert a sleep(1) call into the endless loop. This still leaves an orphan > lying around, but since lock is important for security purposes, this is > probably safer than exiting. As you observe, it's not a good idea to exit the loop. On the other hand, fgets(3) errors are generally not recoverable, so calling sleep(1) seems a bit kludgy. How about just calling pause(3) if an error occurs?