42 static int oneshot = 0;
52 const char * t = NULL;
58 if (t == NULL || *t ==
'\0' || *t ==
'%')
65 mode_t oldmask = umask(022);
67 (void) umask(oldmask);
79 if (rc == 0 && lockp != NULL)
94 (void) close(lock->
fd);
105 if (lock != NULL && (mode & lock->
omode)) {
113 info.l_type = F_RDLCK;
115 info.l_type = F_WRLCK;
120 if (fcntl(lock->
fd, cmd, &info) != -1)
134 info.l_type = F_UNLCK;
139 rc = fcntl(lock->
fd, F_SETLK, &info);
156 _(
"can't create transaction lock on %s (%s)\n"),
158 }
else if (lock != NULL) {
166 _(
"can't create transaction lock on %s (%s)\n"),
const char bson_timestamp_t * ts
const char * rpmtsRootDir(rpmts ts)
Get transaction rootDir, i.e.
const char const char * cmd
void * rpmtsFreeLock(void *lock)
static void rpmlog(int code, const char *fmt,...)
Yet Another syslog(3) API clone.
static const char * rpmlock_path_default
static rpmlock rpmlock_free(rpmlock lock)
const char * rpmGenPath(const char *urlroot, const char *urlmdir, const char *urlfile)
Merge 3 args into path, any or all of which may be a url.
int rpmtsChrootDone(rpmts ts)
Get chrootDone flag, i.e.
static int rpmlock_new(const char *rootdir, rpmlock *lockp)
static int rpmlock_release(rpmlock lock)
char * rpmExpand(const char *arg,...)
Return (malloc'ed) concatenated macro expansion(s).
static const char * rpmlock_path
struct rpmts_s * rpmts
The RPM Transaction Set.
static void * _free(const void *p)
Wrapper to free(3), hides const compilation noise, permit NULL, return NULL.
Structures and prototypes used for an "rpmts" transaction set.
void * rpmtsAcquireLock(rpmts ts)
static int rpmlock_acquire(rpmlock lock, int mode)