From owner-freebsd-questions Sat Feb 10 13:01:20 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id NAA10804 for questions-outgoing; Sat, 10 Feb 1996 13:01:20 -0800 (PST) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.211]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id NAA10799 for ; Sat, 10 Feb 1996 13:01:14 -0800 (PST) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id NAA16639; Sat, 10 Feb 1996 13:55:06 -0700 From: Terry Lambert Message-Id: <199602102055.NAA16639@phaeton.artisoft.com> Subject: Re: Netscape's lock To: dbaker@cocoa.ops.neosoft.com (Daniel Baker) Date: Sat, 10 Feb 1996 13:55:06 -0700 (MST) Cc: cp_nairn@cc.utas.edu.au, binhdo@cs.ubc.ca, questions@FreeBSD.org In-Reply-To: from "Daniel Baker" at Feb 10, 96 00:05:46 am X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-questions@FreeBSD.org Precedence: bulk > Yah, netscape write a .lock file and deletes it upon close. If you're > not running netscape, and just didn't shut it cleanly, you can just do a > rm ~/.netscape/.lock or ~/.netscape/lock whichever it is, i don't > remember.. This is broken. NetScape should write a PID in the lock file, and when a potential conflict arises (ie: the lockfile is already there), it needs to do: if( kill( lockpid, 0) && errno == ESRCH) { /* * Kill will return -1 and set errno to ESRCH if * the process does not exist. It should ignore the * lockfile in this case. */ /* delete lock file*/ ... goto retry; } /* * Kill will return 0 if the process exists and you * have permission to kill it. * * Kill will return -1 and set errno to EPERM if the * process exists and *don't* have permission to kill it. */ /* tell user about other process*/ ... exit( ...); Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.