safelock.c
/* Create and open a safelock with a unique filename */
Create and open a safelock with a unique filename
Create and open a safelock with a unique filename
int safelock_open_unique(safelock_t *lock, const char *file_prefix,
                         mode_t mode)
{
    char *lockfile;
    int err;
    lockfile = safelock_create_unique(file_prefix, mode);
    if (!lockfile)
        return errno;
    err = safelock_open(lock, lockfile, 0);
    free(lockfile);
    return err;
}
int safelock_open_unique ( safelock_t * lock , const char * file_prefix , mode_t mode ) { char * lockfile ; int err ; lockfile = safelock_create_unique ( file_prefix , mode ) ; if ( ! lockfile ) return errno ; err = safelock_open ( lock , lockfile , 0 ) ; free ( lockfile ) ; return err ; }
Create and open a safelock with a unique filename
Create and open a safelock with a unique filename