lib/rpmlock.c File Reference

#include "system.h"
#include <rpmlib.h>
#include <rpmmacro.h>
#include "rpmts.h"
#include "rpmlock.h"
#include "debug.h"

Go to the source code of this file.

Data Structures

struct  rpmlock

Defines

#define RPMLOCK_PATH   "/var/lock/rpm/transaction"

Enumerations

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

Functions

static rpmlock rpmlock_new (const char *rootdir)
static void rpmlock_free (rpmlock lock)
static int rpmlock_acquire (rpmlock lock, int mode)
static void 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


Define Documentation

#define RPMLOCK_PATH   "/var/lock/rpm/transaction"

Definition at line 14 of file rpmlock.c.

Referenced by rpmlock_new().


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 84 of file rpmlock.c.

References rpmlock::fd, rpmlock::openmode, RPMLOCK_READ, RPMLOCK_WAIT, and SEEK_SET.

Referenced by rpmtsAcquireLock().

static void rpmlock_free ( rpmlock  lock  )  [static]

Definition at line 74 of file rpmlock.c.

References rpmlock::fd.

Referenced by rpmtsAcquireLock(), and rpmtsFreeLock().

static rpmlock rpmlock_new ( const char *  rootdir  )  [static]

Definition at line 32 of file rpmlock.c.

References _free(), rpmExpand(), RPMLOCK_PATH, rpmlock_path, rpmlock_path_default, RPMLOCK_READ, RPMLOCK_WRITE, and xstrdup().

Referenced by rpmtsAcquireLock().

static void rpmlock_release ( rpmlock  lock  )  [static]

Definition at line 109 of file rpmlock.c.

References rpmlock::fd, and SEEK_SET.

Referenced by rpmtsFreeLock().

void* rpmtsAcquireLock ( rpmts  ts  ) 

Definition at line 127 of file rpmlock.c.

References _, rpmlock::openmode, rpmlock_acquire(), rpmlock_free(), rpmlock_new(), rpmlock_path, RPMLOCK_WAIT, RPMLOCK_WRITE, RPMMESS_ERROR, RPMMESS_WARNING, rpmMessage, and rpmtsRootDir().

Referenced by rpmtsInitDB(), rpmtsRebuildDB(), and rpmtsRun().

void rpmtsFreeLock ( void *  lock  ) 

Definition at line 153 of file rpmlock.c.

References rpmlock_free(), and rpmlock_release().

Referenced by rpmtsInitDB(), rpmtsRebuildDB(), and rpmtsRun().


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().


Generated on Mon Mar 5 14:31:08 2007 for rpm by  doxygen 1.5.1