rpm  5.4.15
Data Structures | Enumerations | Functions | Variables
rpmlock.c File Reference
#include "system.h"
#include <rpmio.h>
#include <rpmiotypes.h>
#include <rpmlog.h>
#include <rpmmacro.h>
#include <rpmtypes.h>
#include <rpmtag.h>
#include "rpmts.h"
#include "rpmlock.h"
#include "debug.h"
Include dependency graph for rpmlock.c:

Go to the source code of this file.

Data Structures

struct  rpmlock
 

Enumerations

enum  { RPMLOCK_READ = 1 << 0, RPMLOCK_WRITE = 1 << 1, RPMLOCK_WAIT = 1 << 2 }
 

Functions

static int rpmlock_new (const char *rootdir, rpmlock *lockp)
 
static rpmlock rpmlock_free (rpmlock lock)
 
static int rpmlock_acquire (rpmlock lock, int mode)
 
static int rpmlock_release (rpmlock lock)
 
void * rpmtsAcquireLock (rpmts ts)
 
void * rpmtsFreeLock (void *lock)
 

Variables

static const char * rpmlock_path_default = "%{?_rpmlock_path}"
 
static const char * rpmlock_path = NULL
 

Enumeration Type Documentation

anonymous enum
Enumerator
RPMLOCK_READ 
RPMLOCK_WRITE 
RPMLOCK_WAIT 

Definition at line 20 of file rpmlock.c.

Function Documentation

static int rpmlock_acquire ( rpmlock  lock,
int  mode 
)
static

Definition at line 100 of file rpmlock.c.

References cmd, rpmlock::fd, rpmlock::omode, RPMLOCK_READ, RPMLOCK_WAIT, and SEEK_SET.

Referenced by rpmtsAcquireLock().

static rpmlock rpmlock_free ( rpmlock  lock)
static

Definition at line 88 of file rpmlock.c.

References _free(), and rpmlock::fd.

Referenced by rpmtsAcquireLock(), and rpmtsFreeLock().

static int rpmlock_new ( const char *  rootdir,
rpmlock lockp 
)
static
static int rpmlock_release ( rpmlock  lock)
static

Definition at line 126 of file rpmlock.c.

References rpmlock::fd, and SEEK_SET.

Referenced by rpmtsFreeLock().

void* rpmtsAcquireLock ( rpmts  ts)
void* rpmtsFreeLock ( void *  lock)

Definition at line 177 of file rpmlock.c.

References rpmlock_free(), and rpmlock_release().

Referenced by _rpmtsRun(), and rpmtsRebuildDB().

Variable Documentation

const char* rpmlock_path = NULL
static

Definition at line 18 of file rpmlock.c.

Referenced by rpmlock_new(), and rpmtsAcquireLock().

const char* rpmlock_path_default = "%{?_rpmlock_path}"
static

Definition at line 16 of file rpmlock.c.

Referenced by rpmlock_new().