Date: Sat, 10 Feb 1996 13:55:06 -0700 (MST) From: Terry Lambert <terry@lambert.org> To: dbaker@cocoa.ops.neosoft.com (Daniel Baker) Cc: cp_nairn@cc.utas.edu.au, binhdo@cs.ubc.ca, questions@FreeBSD.org Subject: Re: Netscape's lock Message-ID: <199602102055.NAA16639@phaeton.artisoft.com> In-Reply-To: <Pine.BSF.3.91.960210000444.6976A-100000@cocoa.ops.neosoft.com> from "Daniel Baker" at Feb 10, 96 00:05:46 am
next in thread | previous in thread | raw e-mail | index | archive | help
> 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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199602102055.NAA16639>
