safelock.c
/* Open/create and then lock a safelock */
Open/create and then lock a safelock
Open / create and then lock a safelock
int safelock_lock_file(safelock_t *lock, const char *filename,
                       mode_t mode, uint64_t timeout, int data)
{
    int err;
    err = safelock_open(lock, filename, mode);
    if (err)
        return err;
    err = safelock_lock(*lock, timeout, data);
    if (err)
        safelock_close(lock);
    return err;
}
int safelock_lock_file ( safelock_t * lock , const char * filename , mode_t mode , uint64_t timeout , int data ) { int err ; err = safelock_open ( lock , filename , mode ) ; if ( err ) return err ; err = safelock_lock ( * lock , timeout , data ) ; if ( err ) safelock_close ( lock ) ; return err ; }
Open/create and then lock a safelock
Open / create and then lock a safelock