David Collier-Brown wrote:
>         tdb_trylock(), which does an fcntl(tdb->fd,F_SETLK, &fl)

        Make that:

        tdb_trylock(stuff...) {

                if (fcntl(tdb->fd,F_SETLK, &fl) == -1) {
                        /* The lock is in use */
                        return ITS_LOCKED_ALREADY_GO_AWAY;
                }
                else {
                        return OK_WE_HAVE_THE_LOCK;
                }
        }
 
        I'm making logic errors all over the place: could       
        someone check that's a valid trylock algorithm
        using fcntl?

--dave
-- 
David Collier-Brown,           | Always do right. This will gratify 
Performance & Engineering      | some people and astonish the rest.
Americas Customer Engineering, |                      -- Mark Twain
(905) 415-2849                 | [EMAIL PROTECTED]

Reply via email to