+unixlib
++access-slovak
-unrecogcomments # XXX ignore doxygen markings
+strict # lclint level
-/*@-mods@*/
/**
* \file lib/fs.c
*/
static int numFilesystems = 0;
void freeFilesystems(void)
+ /*@globals filesystems, fsnames, numFilesystems @*/
+ /*@modifies filesystems, fsnames, numFilesystems @*/
{
int i;
* @return 0 on success, 1 on error
*/
static int getFilesystemList(void)
- /*@globals fileSystem, internalState@*/
- /*@modifies fileSystem, internalState@*/
+ /*@globals filesystems, fsnames, numFilesystems,
+ fileSystem, internalState @*/
+ /*@modifies filesystems, fsnames, numFilesystems,
+ fileSystem, internalState @*/
{
int numAlloced = 10;
struct stat sb;
return 0;
}
/*@=usereleased =onlytrans@*/
-/*@=mods@*/
#include "debug.h"
-/*@access FD_t @*/
+/*@access FD_t @*/ /* XXX void ptr args */
/*@access FSMI_t @*/
/*@access FSM_t @*/
/*@access rpmfi @*/
-/*@access rpmte @*/
-/*@access rpmts @*/
#define alloca_strdup(_s) strcpy(alloca(strlen(_s)+1), (_s))
/*@uses fsm->links, fsm->ix, fsm->sb, fsm->goal, fsm->nsuffix @*/
/*@defines fsm->li @*/
/*@releases fsm->path @*/
- /*@globals fileSystem, internalState @*/
- /*@modifies fsm, fileSystem, internalState @*/
+ /*@globals errno, fileSystem, internalState @*/
+ /*@modifies errno, fsm, fileSystem, internalState @*/
{
struct stat * st = &fsm->sb;
int rc = 0;
int rc, ec = 0;
fsm->goal = goal;
- if (cfd) {
- /*@-type@*/ /* FIX: cast? */
+ if (cfd != NULL) {
fsm->cfd = fdLink(cfd, "persist (fsm)");
- /*@=type@*/
pos = fdGetCpioPos(fsm->cfd);
fdSetCpioPos(fsm->cfd, 0);
}
rc = fsmStage(fsm, FSM_DESTROY);
fsm->iter = mapFreeIterator(fsm->iter);
- if (fsm->cfd) {
- /*@-type@*/ /* FIX: cast? */
+ if (fsm->cfd != NULL) {
fsm->cfd = fdFree(fsm->cfd, "persist (fsm)");
- /*@=type@*/
fsm->cfd = NULL;
}
fsm->failedFile = NULL;
*/
static int expandRegular(/*@special@*/ FSM_t fsm)
/*@uses fsm->sb @*/
- /*@globals fileSystem, internalState @*/
- /*@modifies fsm, fileSystem, internalState @*/
+ /*@globals errno, fileSystem, internalState @*/
+ /*@modifies fsm, errno, fileSystem, internalState @*/
{
const struct stat * st = &fsm->sb;
int left = st->st_size;
*/
static int writeFile(/*@special@*/ FSM_t fsm, int writeData)
/*@uses fsm->path, fsm->opath, fsm->sb, fsm->osb, fsm->cfd @*/
- /*@globals fileSystem, internalState @*/
- /*@modifies fsm, fileSystem, internalState @*/
+ /*@globals errno, fileSystem, internalState @*/
+ /*@modifies fsm, errno, fileSystem, internalState @*/
{
const char * path = fsm->path;
const char * opath = fsm->opath;
rc = 0;
exit:
- if (fsm->rfd)
+ if (fsm->rfd != NULL)
(void) fsmStage(fsm, FSM_RCLOSE);
/*@-dependenttrans@*/
fsm->opath = opath;
*/
static int writeLinkedFile(/*@special@*/ FSM_t fsm)
/*@uses fsm->path, fsm->nsuffix, fsm->ix, fsm->li, fsm->failedFile @*/
- /*@globals fileSystem, internalState @*/
- /*@modifies fsm, fileSystem, internalState @*/
+ /*@globals errno, fileSystem, internalState @*/
+ /*@modifies fsm, errno, fileSystem, internalState @*/
{
const char * path = fsm->path;
const char * nsuffix = fsm->nsuffix;
/*@-boundsread@*/
static int fsmMakeLinks(/*@special@*/ FSM_t fsm)
/*@uses fsm->path, fsm->opath, fsm->nsuffix, fsm->ix, fsm->li @*/
- /*@globals fileSystem, internalState @*/
- /*@modifies fsm, fileSystem, internalState @*/
+ /*@globals errno, fileSystem, internalState @*/
+ /*@modifies fsm, errno, fileSystem, internalState @*/
{
const char * path = fsm->path;
const char * opath = fsm->opath;
static int fsmCommitLinks(/*@special@*/ FSM_t fsm)
/*@uses fsm->path, fsm->nsuffix, fsm->ix, fsm->sb,
fsm->li, fsm->links @*/
- /*@globals fileSystem, internalState @*/
- /*@modifies fsm, fileSystem, internalState @*/
+ /*@globals errno, fileSystem, internalState @*/
+ /*@modifies fsm, errno, fileSystem, internalState @*/
{
const char * path = fsm->path;
const char * nsuffix = fsm->nsuffix;
*/
static int fsmRmdirs(/*@special@*/ FSM_t fsm)
/*@uses fsm->path, fsm->dnlx, fsm->ldn, fsm->rdbuf, fsm->iter @*/
- /*@globals fileSystem, internalState @*/
- /*@modifies fsm, fileSystem, internalState @*/
+ /*@globals errno, fileSystem, internalState @*/
+ /*@modifies fsm, errno, fileSystem, internalState @*/
{
const char * path = fsm->path;
void * dnli = dnlInitIterator(fsm, 1);
/*@uses fsm->path, fsm->sb, fsm->osb, fsm->rdbuf, fsm->iter,
fsm->ldn, fsm->ldnlen, fsm->ldnalloc @*/
/*@defines fsm->dnlx, fsm->ldn @*/
- /*@globals fileSystem, internalState @*/
- /*@modifies fsm, fileSystem, internalState @*/
+ /*@globals errno, fileSystem, internalState @*/
+ /*@modifies fsm, errno, fileSystem, internalState @*/
{
struct stat * st = &fsm->sb;
struct stat * ost = &fsm->osb;
* @return 0 on success
*/
static int fsmStat(FSM_t fsm)
+ /*@globals errno, fileSystem, internalState @*/
+ /*@modifies fsm, errno, fileSystem, internalState @*/
{
int saveerrno = errno;
int rc = 0;
fsm->ix = -1;
fsm->links = NULL;
fsm->li = NULL;
- /*@-mods@*/
errno = 0; /* XXX get rid of EBADF */
- /*@=mods@*/
/* Detect and create directories not explicitly in package. */
if (fsm->goal == FSM_PKGINSTALL) {
rc = fsmStage(fsm, (!(fsm->mapFlags & CPIO_FOLLOW_SYMLINKS)
? FSM_LSTAT : FSM_STAT));
if (rc == CPIOERR_LSTAT_FAILED && errno == ENOENT) {
- /*@-mods@*/
errno = saveerrno;
- /*@=mods@*/
rc = 0;
fsm->exists = 0;
} else if (rc == 0) {
if (fsm->dnlx)
(void) fsmStage(fsm, FSM_RMDIRS);
#endif
- /*@-mods@*/
errno = saveerrno;
- /*@=mods@*/
}
/*@-boundswrite@*/
if (fsm->failedFile && *fsm->failedFile == NULL)
rc = fsmStage(fsm, FSM_STAT);
if (rc == CPIOERR_STAT_FAILED && errno == ENOENT) rc = 0;
if (rc) break;
- /*@-mods@*/
errno = saveerrno;
- /*@=mods@*/
if (S_ISDIR(ost->st_mode)) return 0;
}
} else if (S_ISLNK(st->st_mode)) {
if (S_ISLNK(ost->st_mode)) {
/* XXX NUL terminated result in fsm->rdbuf, len in fsm->rdnb. */
rc = fsmStage(fsm, FSM_READLINK);
- /*@-mods@*/
errno = saveerrno;
- /*@=mods@*/
if (rc) break;
if (!strcmp(fsm->opath, fsm->rdbuf)) return 0;
}
case FSM_ROPEN:
fsm->rfd = Fopen(fsm->path, "r.ufdio");
if (fsm->rfd == NULL || Ferror(fsm->rfd)) {
- if (fsm->rfd) (void) fsmStage(fsm, FSM_RCLOSE);
+ if (fsm->rfd != NULL) (void) fsmStage(fsm, FSM_RCLOSE);
fsm->rfd = NULL;
rc = CPIOERR_OPEN_FAILED;
break;
}
+/*@=voidabstract@*/
if (_fsm_debug && (stage & FSM_SYSCALL))
rpmMessage(RPMMESS_DEBUG, " %8s (%s, \"r\") rfd %p rdbuf %p\n", cur,
fsm->path, fsm->rfd, fsm->rdbuf);
rc = CPIOERR_READ_FAILED;
break;
case FSM_RCLOSE:
- if (fsm->rfd) {
+ if (fsm->rfd != NULL) {
if (_fsm_debug && (stage & FSM_SYSCALL))
rpmMessage(RPMMESS_DEBUG, " %8s (%p)\n", cur, fsm->rfd);
(void) Fclose(fsm->rfd);
- /*@-mods@*/
errno = saveerrno;
- /*@=mods@*/
}
fsm->rfd = NULL;
break;
case FSM_WOPEN:
fsm->wfd = Fopen(fsm->path, "w.ufdio");
if (fsm->wfd == NULL || Ferror(fsm->wfd)) {
- if (fsm->wfd) (void) fsmStage(fsm, FSM_WCLOSE);
+ if (fsm->wfd != NULL) (void) fsmStage(fsm, FSM_WCLOSE);
fsm->wfd = NULL;
rc = CPIOERR_OPEN_FAILED;
}
rc = CPIOERR_WRITE_FAILED;
break;
case FSM_WCLOSE:
- if (fsm->wfd) {
+ if (fsm->wfd != NULL) {
if (_fsm_debug && (stage & FSM_SYSCALL))
rpmMessage(RPMMESS_DEBUG, " %8s (%p)\n", cur, fsm->wfd);
(void) Fclose(fsm->wfd);
- /*@-mods@*/
errno = saveerrno;
- /*@=mods@*/
}
fsm->wfd = NULL;
break;
* @return 0 on success
*/
int fsmStage(/*@partial@*/ FSM_t fsm, fileStage stage)
- /*@globals fileSystem, internalState @*/
- /*@modifies fsm, fileSystem, internalState @*/;
+ /*@globals errno, fileSystem, internalState @*/
+ /*@modifies fsm, errno, fileSystem, internalState @*/;
#ifdef __cplusplus
}
const char ** av = NULL;
int argc = (argcPtr ? *argcPtr : 0);
const char ** argv = (argvPtr ? *argvPtr : NULL);
- /*@-type@*/ /* FIX: cast? */
- FILE * f = fdGetFp(fd);
- /*@=type@*/
+/*@+voidabstract@*/
+ FILE * f = (FILE *) fdGetFp(fd);
+/*@=voidabstract@*/
int rc = 0;
int i;
#include "misc.h"
#include "debug.h"
-/*@access Header@*/ /* XXX compared with NULL */
-/*@access FD_t@*/ /* XXX compared with NULL */
-
rpmRC rpmMkdirPath (const char * dpath, const char * dname)
{
struct stat st;
errxit:
tempfn = _free(tempfn);
/*@-usereleased@*/
- if (fd) (void) Fclose(fd);
+ if (fd != NULL) (void) Fclose(fd);
/*@=usereleased@*/
return 1;
}
/*@access pgpDig @*/
/*@access pgpDigParams @*/
-/*@access rpmts @*/
/*@access Header @*/ /* XXX compared with NULL */
/*@access entryInfo @*/ /* XXX headerCheck */
/*@access indexEntry @*/ /* XXX headerCheck */
/*@unchecked@*/
int _psm_debug = _PSM_DEBUG;
-/*@access Header @*/ /* compared with NULL */
-/*@access rpmdbMatchIterator @*//* compared with NULL */
-/*@access FD_t @*/ /* compared with NULL */
-/*@access rpmdb @*/ /* compared with NULL */
-
-/*@access FSM_t @*/ /* compared with NULL */
+/*@access FD_t @*/ /* XXX void ptr args */
/*@access rpmpsm @*/
/*@access rpmfi @*/
int i;
memset(psm, 0, sizeof(*psm));
- /*@-assignexpose -usereleased @*/
psm->ts = rpmtsLink(ts, "InstallSourcePackage");
- /*@=assignexpose =usereleased @*/
rc = rpmReadPackageFile(ts, fd, "InstallSourcePackage", &h);
switch (rc) {
goto exit;
}
- (void) rpmtsAddInstallElement(ts, h, NULL, 0, NULL);
+ (void) rpmtsAddInstallElement(ts, h, NULL, 0, NULL);
fi = rpmfiNew(ts, h, RPMTAG_BASENAMES, scareMem);
h = headerFree(h);
/*@i@*/ (void) rpmInstallLoadMacros(fi, fi->h);
+ psm->fi = rpmfiLink(fi, NULL);
/*@-assignexpose -usereleased @*/
- psm->fi = fi;
psm->te = fi->te;
/*@=assignexpose =usereleased @*/
/*@i@*/ fi->dnl = hfd(fi->dnl, -1);
fi->dc = 2;
- fi->dnl = xmalloc(fi->dc * sizeof(*fi->dnl) + fi->fc * sizeof(*fi->dil) +
- speclen + sourcelen);
+ fi->dnl = xmalloc(fi->dc * sizeof(*fi->dnl)
+ + fi->fc * sizeof(*fi->dil)
+ + speclen + sourcelen);
+ /*@-dependenttrans@*/
fi->dil = (int *)(fi->dnl + fi->dc);
+ /*@=dependenttrans@*/
memset(fi->dil, 0, fi->fc * sizeof(*fi->dil));
fi->dil[i] = 1;
/*@-dependenttrans@*/
_specdir = _free(_specdir);
_sourcedir = _free(_sourcedir);
- if (h) h = headerFree(h);
+ psm->fi = rpmfiFree(psm->fi);
+ psm->te = NULL;
+
+ if (h != NULL) h = headerFree(h);
/*@-branchstate@*/
- if (fi) {
+ if (fi != NULL) {
fi->te->h = headerFree(fi->te->h);
- if (fi->te->fd)
+ if (fi->te->fd != NULL)
(void) Fclose(fi->te->fd);
fi->te->fd = NULL;
fi->te = NULL;
}
/*@=branchstate@*/
- psm->fi = NULL;
- psm->te = NULL;
-
/* XXX nuke the added package(s). */
rpmtsClean(ts);
}
/* Add remove transaction id to header. */
- if (psm->oh)
+ if (psm->oh != NULL)
{ int_32 tid = rpmtsGetTid(ts);
xx = headerAddEntry(psm->oh, RPMTAG_REMOVETID,
RPM_INT32_TYPE, &tid, 1);
/* Restore root directory if changed. */
xx = rpmpsmStage(psm, PSM_CHROOT_OUT);
- if (psm->fd) {
+ if (psm->fd != NULL) {
saveerrno = errno; /* XXX FIXME: Fclose with libio destroys errno */
xx = Fclose(psm->fd);
psm->fd = NULL;
/*@=nullstate@*/
}
+/*@-branchstate@*/
if (psm->goal == PSM_PKGERASE || psm->goal == PSM_PKGSAVE) {
-if (psm->te)
-if (psm->te->h)
+if (psm->te != NULL)
+if (psm->te->h != NULL)
psm->te->h = headerFree(psm->te->h);
- if (fi->h)
+ if (fi->h != NULL)
fi->h = headerFree(fi->h);
}
+/*@=branchstate@*/
psm->oh = headerFree(psm->oh);
psm->pkgURL = _free(psm->pkgURL);
psm->rpmio_flags = _free(psm->rpmio_flags);
&fi->record, sizeof(fi->record));
fi->h = rpmdbNextIterator(psm->mi);
- if (fi->h)
+ if (fi->h != NULL)
fi->h = headerLink(fi->h);
psm->mi = rpmdbFreeIterator(psm->mi);
- rc = (fi->h ? RPMRC_OK : RPMRC_FAIL);
+ rc = (fi->h != NULL ? RPMRC_OK : RPMRC_FAIL);
break;
case PSM_RPMDB_ADD:
if (rpmtsFlags(ts) & RPMTRANS_FLAG_TEST) break;
#include "debug.h"
-/*@access rpmdbMatchIterator@*/ /* XXX compared with NULL */
-/*@access Header@*/ /* XXX compared with NULL */
-/*@access FD_t@*/ /* XXX compared with NULL */
-
/**
*/
static void printFileInfo(char * te, const char * name,
if (fd == NULL || Ferror(fd)) {
rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), fileURL,
Fstrerror(fd));
- if (fd) (void) Fclose(fd);
+ if (fd != NULL) (void) Fclose(fd);
res = 1;
/*@loopbreak@*/ break;
}
if (fd == NULL || Ferror(fd)) {
rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), fileURL,
Fstrerror(fd));
- if (fd) (void) Fclose(fd);
+ if (fd != NULL) (void) Fclose(fd);
res = 1;
/*@loopbreak@*/ break;
}
#include "misc.h" /* XXX for makeTempFile() */
#include "debug.h"
-/*?access Header @*/ /* XXX compared with NULL */
/*@access FD_t @*/ /* XXX stealing digests */
/*@access pgpDig @*/
/*@access pgpDigParams @*/
#include "debug.h"
/*@access rpmts @*/ /* XXX ts->goal, ts->dbmode */
-/*@access rpmps @*/ /* XXX compared with NULL */
-/*@access Header @*/ /* XXX compared with NULL */
-/*@access rpmdb @*/ /* XXX compared with NULL */
-/*@access FD_t @*/ /* XXX compared with NULL */
/*@access IDTX @*/
/*@access IDT @*/
/*@modifies rpmcliHashesCurrent, rpmcliProgressCurrent, rpmcliProgressTotal,
fileSystem @*/
{
- /*@-castexpose@*/
+/*@-abstract -castexpose @*/
Header h = (Header) arg;
- /*@=castexpose@*/
+/*@=abstract =castexpose @*/
char * s;
int flags = (int) ((long)data);
void * rc = NULL;
- /*@-assignexpose -abstract @*/
+/*@-abstract -assignexpose @*/
const char * filename = (const char *)key;
- /*@=assignexpose =abstract @*/
+/*@=abstract =assignexpose @*/
static FD_t fd = NULL;
int xx;
if (fd == NULL || Ferror(fd)) {
rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), filename,
Fstrerror(fd));
- if (fd) {
+ if (fd != NULL) {
xx = Fclose(fd);
fd = NULL;
}
} else
fd = fdLink(fd, "persist (showProgress)");
/*@=type@*/
- return fd;
+/*@+voidabstract@*/
+ return (void *)fd;
+/*@=voidabstract@*/
/*@notreached@*/ break;
case RPMCALLBACK_INST_CLOSE_FILE:
/*@-type@*/ /* FIX: still necessary? */
fd = fdFree(fd, "persist (showProgress)");
/*@=type@*/
- if (fd) {
+ if (fd != NULL) {
xx = Fclose(fd);
fd = NULL;
}
if (eiu->fd == NULL || Ferror(eiu->fd)) {
rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), *eiu->fnp,
Fstrerror(eiu->fd));
- if (eiu->fd) {
+ if (eiu->fd != NULL) {
xx = Fclose(eiu->fd);
eiu->fd = NULL;
}
if (eiu->fd == NULL || Ferror(eiu->fd)) {
rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), *eiu->fnp,
Fstrerror(eiu->fd));
- if (eiu->fd) {
+ if (eiu->fd != NULL) {
xx = Fclose(eiu->fd);
eiu->fd = NULL;
}
if (eiu->fd == NULL || Ferror(eiu->fd)) {
rpmMessage(RPMMESS_ERROR, _("cannot open file %s: %s\n"),
eiu->sourceURL[i], Fstrerror(eiu->fd));
- if (eiu->fd) {
+ if (eiu->fd != NULL) {
xx = Fclose(eiu->fd);
eiu->fd = NULL;
}
fd = Fopen(arg, "r.ufdio");
if (fd == NULL || Ferror(fd)) {
rpmMessage(RPMMESS_ERROR, _("cannot open %s: %s\n"), arg, Fstrerror(fd));
- if (fd) (void) Fclose(fd);
+ if (fd != NULL) (void) Fclose(fd);
return 1;
}
idt = idtx->idt + idtx->nidt;
/*@=nullderef@*/
idt->h = headerLink(h);
-rpmMessage(RPMMESS_DEBUG, "\tidt %p h %p\n", idt, idt->h);
idt->key = NULL;
idt->instance = rpmdbGetIteratorOffset(mi);
idt->val.u32 = *tidp;
int xx;
int i;
-rpmMessage(RPMMESS_DEBUG, "IDTXglob(%p, %s, %d)\n", ts, globstr, tag);
av = NULL; ac = 0;
xx = rpmGlob(globstr, &ac, &av);
-rpmMessage(RPMMESS_DEBUG, "\txx %d ac %d av %p\n", xx, ac, av);
if (xx == 0)
for (i = 0; i < ac; i++) {
int_32 count;
int isSource;
-rpmMessage(RPMMESS_DEBUG, "\tav[%d] %s\n", i, av[i]);
fd = Fopen(av[i], "r.ufdio");
if (fd == NULL || Ferror(fd)) {
rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), av[i],
Fstrerror(fd));
- if (fd) (void) Fclose(fd);
+ if (fd != NULL) (void) Fclose(fd);
continue;
}
av[i] = _free(av[i]);
av = _free(av); ac = 0;
-rpmMessage(RPMMESS_DEBUG, "IDTXglob: returns %p\n", idtx);
-
return idtx;
}
ip = NULL;
niids = 0;
}
-rpmMessage(RPMMESS_DEBUG, "*** was installed, now remove %p[%d]\n", ip, niids);
{ const char * globstr = rpmExpand("%{_repackage_dir}/*.rpm", NULL);
if (globstr == NULL || *globstr == '%') {
}
globstr = _free(globstr);
}
-rpmMessage(RPMMESS_DEBUG, "*** was removed, now install %p[%d]\n", rp, nrids);
{ int notifyFlags, xx;
notifyFlags = ia->installInterfaceFlags | (rpmIsVerbose() ? INSTALL_LABEL : 0 );
/*@-bounds@*/
-/*@-mods@*/
#include "system.h"
#include <stdarg.h>
#include "misc.h"
#include "debug.h"
-/*@access FD_t@*/ /* compared with NULL */
-
/*@observer@*/ /*@unchecked@*/
static const char *defrcfiles = LIBRPMRC_FILENAME ":" VENDORRPMRC_FILENAME ":/etc/rpmrc:~/.rpmrc";
/* prototypes */
static int doReadRC( /*@killref@*/ FD_t fd, const char * urlfn)
- /*@globals rpmGlobalMacroContext,
- fileSystem, internalState @*/
- /*@modifies fd, fileSystem, internalState @*/;
+ /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
+ /*@modifies fd, rpmGlobalMacroContext, fileSystem, internalState @*/;
static void rpmSetVarArch(int var, const char * val,
/*@null@*/ const char * arch)
- /*@globals internalState @*/
- /*@modifies internalState @*/;
+ /*@globals values, internalState @*/
+ /*@modifies values, internalState @*/;
static void rebuildCompatTables(int type, const char * name)
/*@globals internalState @*/
/*@modifies internalState @*/;
static void rpmRebuildTargetVars(/*@null@*/ const char **target, /*@null@*/ const char ** canontarget)
- /*@globals rpmGlobalMacroContext,
- fileSystem, internalState @*/
- /*@modifies *canontarget, fileSystem, internalState @*/;
+ /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
+ /*@modifies *canontarget, rpmGlobalMacroContext,
+ fileSystem, internalState @*/;
static int optionCompare(const void * a, const void * b)
/*@*/
static void setVarDefault(int var, const char * macroname, const char * val,
/*@null@*/ const char * body)
- /*@globals rpmGlobalMacroContext,
- internalState @*/
- /*@modifies internalState @*/
+ /*@globals rpmGlobalMacroContext, internalState @*/
+ /*@modifies rpmGlobalMacroContext, internalState @*/
{
if (var >= 0) { /* XXX Dying ... */
if (rpmGetVar(var)) return;
}
static void setPathDefault(int var, const char * macroname, const char * subdir)
- /*@globals rpmGlobalMacroContext,
- internalState @*/
- /*@modifies internalState @*/
+ /*@globals rpmGlobalMacroContext, internalState @*/
+ /*@modifies rpmGlobalMacroContext, internalState @*/
{
if (var >= 0) { /* XXX Dying ... */
";
static void setDefaults(void)
- /*@globals rpmGlobalMacroContext,
- internalState @*/
- /*@modifies internalState @*/
+ /*@globals rpmGlobalMacroContext, internalState @*/
+ /*@modifies rpmGlobalMacroContext, internalState @*/
{
addMacro(NULL, "_usr", NULL, "/usr", RMIL_DEFAULT);
/*@-usedef@*/ /*@ FIX: se usage inconsistent, W2DO? */
static int doReadRC( /*@killref@*/ FD_t fd, const char * urlfn)
- /*@globals rpmGlobalMacroContext,
- fileSystem, internalState @*/
- /*@modifies fd, fileSystem, internalState @*/
+ /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
+ /*@modifies fd, rpmGlobalMacroContext, fileSystem, internalState @*/
{
const char *s;
char *se, *next;
}
void rpmSetVar(int var, const char * val)
+ /*@globals values @*/
+ /*@modifies values @*/
{
/*@-immediatetrans@*/
freeRpmVar(&values[var]);
}
static void rpmSetVarArch(int var, const char * val, const char * arch)
- /*@*/
{
struct rpmvarValue * next = values + var;
}
void rpmSetTables(int archTable, int osTable)
+ /*@globals currTables @*/
+ /*@modifies currTables @*/
{
const char * arch, * os;
}
void rpmSetMachine(const char * arch, const char * os)
+ /*@globals current @*/
+ /*@modifies current @*/
{
const char * host_cpu, * host_os;
}
void rpmFreeRpmrc(void)
+ /*@globals current, tables, values, defaultsInitialized,
+ platpat, nplatpat @*/
+ /*@modifies current, tables, values, defaultsInitialized,
+ platpat, nplatpat @*/
{
int i, j, k;
* @return 0 on succes
*/
static int rpmReadRC(/*@null@*/ const char * rcfiles)
- /*@globals rpmGlobalMacroContext, rpmCLIMacroContext,
- fileSystem, internalState @*/
- /*@modifies rpmGlobalMacroContext,
+ /*@globals defaultsInitialized, rpmGlobalMacroContext,
+ rpmCLIMacroContext, fileSystem, internalState @*/
+ /*@modifies defaultsInitialized, rpmGlobalMacroContext,
fileSystem, internalState @*/
{
char *myrcfiles, *r, *re;
return 0;
}
-/*@=mods@*/
/*@=bounds@*/
/*@access alKey @*/
/*@access rpmtsi @*/
-/*@access rpmts @*/
void rpmteCleanDS(rpmte te)
{
p->fi = rpmfiFree(p->fi);
- /*@-noeffectuncon@*/
if (p->fd != NULL)
p->fd = fdFree(p->fd, "delTE");
- /*@=noeffectuncon@*/
p->os = _free(p->os);
p->arch = _free(p->arch);
/*@access rpmdb @*/ /* XXX db->db_chrootDone, NULL */
-/*@access FD_t @*/ /* XXX compared with NULL */
/*@access rpmps @*/
/*@access rpmDiskSpaceInfo @*/
/*@access rpmte @*/
/*@access rpmtsi @*/
-/*@access rpmts @*/
/*@access fnpyKey @*/
/*@access pgpDig @*/
/*@access pgpDigParams @*/
if (fd == NULL || Ferror(fd)) {
rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), str,
Fstrerror(fd));
- if (fd) {
+ if (fd != NULL) {
xx = Fclose(fd);
fd = NULL;
}
ts->scriptFd = fdFree(ts->scriptFd, "rpmtsSetScriptFd");
ts->scriptFd = NULL;
}
+/*@+voidabstract@*/
if (scriptFd != NULL)
- ts->scriptFd = fdLink(scriptFd, "rpmtsSetScriptFd");
+ ts->scriptFd = fdLink((void *)scriptFd, "rpmtsSetScriptFd");
}
+/*@=voidabstract@*/
}
int rpmtsChrootDone(rpmts ts)
#include "header_internal.h"
#include "debug.h"
+/*@access FD_t@*/ /* XXX ufdio->read arg1 is void ptr */
/*@access Header@*/ /* XXX compared with NULL */
/*@access entryInfo @*/ /* XXX rpmReadSignature */
/*@access indexEntry @*/ /* XXX rpmReadSignature */
-/*@access FD_t@*/ /* XXX compared with NULL */
/*@access DIGEST_CTX@*/ /* XXX compared with NULL */
/*@access pgpDig@*/
/*@access pgpDigParams@*/
}
SHA1 = _free(SHA1);
h = headerFree(h);
- if (fd) (void) Fclose(fd);
+ if (fd != NULL) (void) Fclose(fd);
return ret;
}
#include "debug.h"
-/*@access FD_t @*/ /* XXX compared with NULL */
-/*@access Header @*/ /* XXX compared with NULL */
+/*@access Header @*/ /* XXX ts->notify arg1 is void ptr */
/*@access rpmps @*/ /* XXX need rpmProblemSetOK() */
/*@access dbiIndexSet @*/
-/*@access rpmdb @*/
/*@access rpmpsm @*/
#include "legacy.h" /* XXX domd5(), uidToUname(), gnameToGid */
#include "ugid.h"
-#include "misc.h" /* XXX for uidToUname() and gnameToGid() */
#include "debug.h"
/*@access rpmps @*/
/*@access rpmProblem @*/
/*@access rpmpsm @*/ /* XXX for %verifyscript through rpmpsmStage() */
-/*@access FD_t @*/ /* XXX compared with NULL */
#define S_ISDEV(m) (S_ISBLK((m)) || S_ISCHR((m)))
FD_t fdo = fdDup(STDOUT_FILENO);
if ((rc = rpmVerifyScript(qva, ts, fi, fdo)) != 0)
ec = rc;
- if (fdo)
+ if (fdo != NULL)
rc = Fclose(fdo);
}
+#if defined(HAVE_CONFIG_H)
+#include "system.h"
+#else
#include <sys/types.h>
#include <fcntl.h>
+#include <string.h>
+#endif
#include <rpmlib.h>
#include <rpmdb.h>
static rpmdb db;
int
-main(argc, argv)
-int argc;
-char **argv;
+main(int argc, char ** argv)
{
FD_t fd;
int offset;