diff options
53 files changed, 343 insertions, 416 deletions
@@ -10,6 +10,7 @@ - python: missed tuple refcount in IDTXload/IDTXglob. - fix: IDTXglob should return REMOVETID sorted headers (#89857). - fix: cut-n-paste error setting nopromote for Conflicts: (#81965). + - don't use error string after gzclose (Dmitry V. Levin). 4.1 -> 4.2: - set cachesize without a dbenv, the default is far too small. @@ -21,7 +21,7 @@ /** */ static int checkSpec(rpmts ts, Header h) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, h, rpmGlobalMacroContext, fileSystem, internalState @*/ { rpmps ps; @@ -57,7 +57,7 @@ static int checkSpec(rpmts ts, Header h) /** */ static int isSpecFile(const char * specfile) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fileSystem, internalState @*/ { char buf[256]; @@ -99,7 +99,7 @@ static int isSpecFile(const char * specfile) */ /*@-boundswrite@*/ static int buildForTarget(rpmts ts, const char * arg, BTA_t ba) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ { const char * passPhrase = ba->passPhrase; @@ -8,7 +8,7 @@ extern "C" { int build(rpmts ts, const char * arg, BTA_t ba, /*@null@*/ const char * rcfile) /*@globals rpmGlobalMacroContext, rpmCLIMacroContext, - fileSystem, internalState @*/ + h_errno, fileSystem, internalState @*/ /*@modifies ts, ba->buildAmount, rpmGlobalMacroContext, rpmCLIMacroContext, fileSystem, internalState @*/; diff --git a/build/.splintrc b/build/.splintrc index 8f683ee47..94feff0e1 100644 --- a/build/.splintrc +++ b/build/.splintrc @@ -3,7 +3,7 @@ +partial +forcehints --warnunixlib +#-warnunixlib -warnposix +unixlib diff --git a/build/build.c b/build/build.c index a68de293e..953aa314a 100644 --- a/build/build.c +++ b/build/build.c @@ -20,7 +20,7 @@ static int _build_debug = 0; /** */ static void doRmSource(Spec spec) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/ { struct Source *p; @@ -119,6 +119,8 @@ int doScript(Spec spec, int what, const char *name, StringBuf sb, int test) mPost = "%{___build_post}"; break; } + if (name == NULL) /* XXX shouldn't happen */ + name = "???"; /*@=branchstate@*/ if ((what != RPMBUILD_RMBUILD) && sb == NULL) { @@ -175,7 +177,7 @@ int doScript(Spec spec, int what, const char *name, StringBuf sb, int test) if (what == RPMBUILD_RMBUILD) { if (spec->buildSubdir) fprintf(fp, "rm -rf %s\n", spec->buildSubdir); - } else + } else if (sb != NULL) fprintf(fp, "%s", getStringBuf(sb)); (void) fputs(buildPost, fp); diff --git a/build/buildio.h b/build/buildio.h index b38ba93a0..f3641fa33 100644 --- a/build/buildio.h +++ b/build/buildio.h @@ -39,7 +39,7 @@ extern "C" { /*@out@*/ struct rpmlead * lead, /*@out@*/ Header * sigs, CSA_t csa) - /*@globals rpmGlobalMacroContext, + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies *specp, *lead, *sigs, csa, csa->cpioFdIn, rpmGlobalMacroContext, fileSystem, internalState @*/; @@ -65,7 +65,7 @@ int writeRPM(Header * hdrp, /*@null@*/ unsigned char ** pkgidp, CSA_t csa, /*@null@*/ char * passPhrase, /*@out@*/ const char ** cookie) - /*@globals rpmGlobalMacroContext, + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies *hdrp, *pkgidp, *cookie, csa, csa->cpioArchiveSize, rpmGlobalMacroContext, fileSystem, internalState @*/; diff --git a/build/expression.c b/build/expression.c index 84400d41f..d57cddf70 100644 --- a/build/expression.c +++ b/build/expression.c @@ -186,7 +186,7 @@ static const char *prToken(int val) */ /*@-boundswrite@*/ static int rdToken(ParseState state) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies state->nextToken, state->p, state->tokenValue, rpmGlobalMacroContext @*/ { @@ -325,7 +325,7 @@ static int rdToken(ParseState state) /*@null@*/ static Value doLogical(ParseState state) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies state->nextToken, state->p, state->tokenValue, rpmGlobalMacroContext @*/; @@ -334,7 +334,7 @@ static Value doLogical(ParseState state) */ /*@null@*/ static Value doPrimary(ParseState state) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies state->nextToken, state->p, state->tokenValue, rpmGlobalMacroContext @*/ { @@ -416,7 +416,7 @@ static Value doPrimary(ParseState state) */ /*@null@*/ static Value doMultiplyDivide(ParseState state) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies state->nextToken, state->p, state->tokenValue, rpmGlobalMacroContext @*/ { @@ -472,7 +472,7 @@ static Value doMultiplyDivide(ParseState state) /*@-boundswrite@*/ /*@null@*/ static Value doAddSubtract(ParseState state) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies state->nextToken, state->p, state->tokenValue, rpmGlobalMacroContext @*/ { @@ -537,7 +537,7 @@ static Value doAddSubtract(ParseState state) */ /*@null@*/ static Value doRelational(ParseState state) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies state->nextToken, state->p, state->tokenValue, rpmGlobalMacroContext @*/ { @@ -633,7 +633,7 @@ static Value doRelational(ParseState state) * @param state expression parser state */ static Value doLogical(ParseState state) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies state->nextToken, state->p, state->tokenValue, rpmGlobalMacroContext @*/ { diff --git a/build/files.c b/build/files.c index bb3f5c412..256362f49 100644 --- a/build/files.c +++ b/build/files.c @@ -814,7 +814,7 @@ static int parseForLang(char * buf, FileList fl) */ /*@-boundswrite@*/ static int parseForRegexLang(const char * fileName, /*@out@*/ char ** lang) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies *lang, rpmGlobalMacroContext @*/ { static int initialized = 0; @@ -893,7 +893,7 @@ VFA_t virtualFileAttributes[] = { /*@-boundswrite@*/ static int parseForSimple(/*@unused@*/Spec spec, Package pkg, char * buf, FileList fl, /*@out@*/ const char ** fileName) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies buf, fl->processingFailed, *fileName, fl->currentFlags, fl->docDirs, fl->docDirCount, fl->isDir, @@ -918,14 +918,19 @@ static int parseForSimple(/*@unused@*/Spec spec, Package pkg, char * buf, fl->processingFailed = 1; res = 1; } - fl->docDirs[fl->docDirCount++] = xstrdup(s); - if (strtokWithQuotes(NULL, " \t\n")) { + + if (s != NULL) + fl->docDirs[fl->docDirCount++] = xstrdup(s); + if (s == NULL || strtokWithQuotes(NULL, " \t\n")) { rpmError(RPMERR_INTERNAL, _("Only one arg for %%docdir\n")); fl->processingFailed = 1; res = 1; } break; } +#if defined(__LCLINT__) + assert(s != NULL); +#endif /* Set flags for virtual file attributes */ { VFA_t *vfa; @@ -1095,7 +1100,7 @@ static int checkHardLinks(FileList fl) /*@-bounds@*/ static void genCpioListAndHeader(/*@partial@*/ FileList fl, rpmfi * fip, Header h, int isSrc) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies h, *fip, fl->processingFailed, fl->fileList, rpmGlobalMacroContext, fileSystem, internalState @*/ { @@ -1443,7 +1448,7 @@ static /*@null@*/ FileListRec freeFileList(/*@only@*/ FileListRec fileList, /* forward ref */ static int recurseDir(FileList fl, const char * diskURL) - /*@globals check_fileList, rpmGlobalMacroContext, + /*@globals check_fileList, rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies *fl, fl->processingFailed, fl->fileList, fl->fileListRecsAlloced, fl->fileListRecsUsed, @@ -1461,7 +1466,7 @@ static int recurseDir(FileList fl, const char * diskURL) /*@-boundswrite@*/ static int addFile(FileList fl, const char * diskURL, /*@null@*/ struct stat * statp) - /*@globals check_fileList, rpmGlobalMacroContext, + /*@globals check_fileList, rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies *statp, *fl, fl->processingFailed, fl->fileList, fl->fileListRecsAlloced, fl->fileListRecsUsed, @@ -1719,7 +1724,7 @@ static int recurseDir(FileList fl, const char * diskURL) * @return 0 on success */ static int processPubkeyFile(Package pkg, FileList fl, const char * fileURL) - /*@globals check_fileList, rpmGlobalMacroContext, + /*@globals check_fileList, rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies pkg->header, *fl, fl->processingFailed, fl->fileList, fl->fileListRecsAlloced, fl->fileListRecsUsed, @@ -1780,7 +1785,7 @@ exit: */ static int processBinaryFile(/*@unused@*/ Package pkg, FileList fl, const char * fileURL) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies *fl, fl->processingFailed, fl->fileList, fl->fileListRecsAlloced, fl->fileListRecsUsed, fl->totalFileSize, fl->fileCount, @@ -1861,7 +1866,7 @@ exit: /*@-boundswrite@*/ static int processPackageFiles(Spec spec, Package pkg, int installSpecialDoc, int test) - /*@globals rpmGlobalMacroContext, + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState@*/ /*@modifies spec->macros, pkg->cpioList, pkg->fileList, pkg->specialDoc, pkg->header, @@ -2338,7 +2343,7 @@ int processSourceFiles(Spec spec) * @return -1 if skipped, 0 on OK, 1 on error */ static int checkFiles(StringBuf fileList) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/ { /*@-readonlytrans@*/ diff --git a/build/pack.c b/build/pack.c index d092bf5da..ec1728f31 100644 --- a/build/pack.c +++ b/build/pack.c @@ -55,7 +55,7 @@ static inline int genSourceRpmName(Spec spec) */ static int cpio_doio(FD_t fdo, /*@unused@*/ Header h, CSA_t csa, const char * fmodeMacro) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies fdo, csa, rpmGlobalMacroContext, fileSystem, internalState @*/ { @@ -130,7 +130,7 @@ static int cpio_copy(FD_t fdo, CSA_t csa) */ static /*@only@*/ /*@null@*/ StringBuf addFileToTagAux(Spec spec, const char * file, /*@only@*/ StringBuf sb) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/ { char buf[BUFSIZ]; @@ -167,7 +167,7 @@ static /*@only@*/ /*@null@*/ StringBuf addFileToTagAux(Spec spec, /** */ static int addFileToTag(Spec spec, const char * file, Header h, int tag) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies h, rpmGlobalMacroContext, fileSystem, internalState @*/ { HGE_t hge = (HGE_t)headerGetEntryMinMemory; @@ -191,7 +191,7 @@ static int addFileToTag(Spec spec, const char * file, Header h, int tag) /** */ static int addFileToArrayTag(Spec spec, const char *file, Header h, int tag) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies h, rpmGlobalMacroContext, fileSystem, internalState @*/ { StringBuf sb = newStringBuf(); @@ -210,7 +210,7 @@ static int addFileToArrayTag(Spec spec, const char *file, Header h, int tag) /** */ static int processScriptFiles(Spec spec, Package pkg) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies pkg->header, rpmGlobalMacroContext, fileSystem, internalState @*/ { @@ -383,7 +383,7 @@ static unsigned char header_magic[8] = { static int rpmpkg_version = -1; static int rpmLeadVersion(void) - /*@globals rpmpkg_version, rpmGlobalMacroContext @*/ + /*@globals rpmpkg_version, rpmGlobalMacroContext, h_errno @*/ /*@modifies rpmpkg_version, rpmGlobalMacroContext @*/ { int rpmlead_version; diff --git a/build/parsePreamble.c b/build/parsePreamble.c index 9f88757ef..16d3b123c 100644 --- a/build/parsePreamble.c +++ b/build/parsePreamble.c @@ -334,7 +334,7 @@ static struct optionalTag { /** */ static void fillOutMainPackage(Header h) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies h, rpmGlobalMacroContext @*/ { struct optionalTag *ot; @@ -355,7 +355,7 @@ static void fillOutMainPackage(Header h) */ /*@-boundswrite@*/ static int readIcon(Header h, const char * file) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies h, rpmGlobalMacroContext, fileSystem, internalState @*/ { const char *fn = NULL; @@ -460,7 +460,7 @@ extern int noLang; /*@-boundswrite@*/ static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, const char *lang) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies spec->macros, spec->st, spec->buildRootURL, spec->sources, spec->numSources, spec->noSource, spec->buildRestrictions, spec->BANames, spec->BACount, diff --git a/build/parsePrep.c b/build/parsePrep.c index 0a4eafa47..d1afd62e1 100644 --- a/build/parsePrep.c +++ b/build/parsePrep.c @@ -36,7 +36,7 @@ * @return 0 on success */ static int checkOwners(const char * urlfn) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fileSystem, internalState @*/ { struct stat sb; @@ -67,7 +67,7 @@ static int checkOwners(const char * urlfn) /*@-boundswrite@*/ /*@observer@*/ static char *doPatch(Spec spec, int c, int strip, const char *db, int reverse, int removeEmpties) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/ { const char *fn, *urlfn; @@ -161,7 +161,7 @@ static int checkOwners(const char * urlfn) */ /*@-boundswrite@*/ /*@observer@*/ static const char *doUntar(Spec spec, int c, int quietly) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/ { const char *fn, *urlfn; @@ -282,7 +282,7 @@ static int checkOwners(const char * urlfn) * @return 0 on success */ static int doSetupMacro(Spec spec, char *line) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies spec->buildSubdir, spec->macros, spec->prep, rpmGlobalMacroContext, fileSystem, internalState @*/ { @@ -438,7 +438,7 @@ static int doSetupMacro(Spec spec, char *line) */ /*@-boundswrite@*/ static int doPatchMacro(Spec spec, char *line) - /*@globals rpmGlobalMacroContext, + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies spec->prep, rpmGlobalMacroContext, fileSystem, internalState @*/ diff --git a/build/parseSpec.c b/build/parseSpec.c index edbffd73a..6fd6ef172 100644 --- a/build/parseSpec.c +++ b/build/parseSpec.c @@ -130,7 +130,7 @@ static void forceIncludeFile(Spec spec, const char * fileName) */ /*@-boundswrite@*/ static int copyNextLine(Spec spec, OFI_t *ofi, int strip) - /*@globals rpmGlobalMacroContext, + /*@globals rpmGlobalMacroContext, h_errno, fileSystem @*/ /*@modifies spec->nextline, spec->nextpeekc, spec->lbuf, spec->line, ofi->readPtr, diff --git a/build/rpmbuild.h b/build/rpmbuild.h index 44d1996aa..a6a918364 100644 --- a/build/rpmbuild.h +++ b/build/rpmbuild.h @@ -167,7 +167,7 @@ extern /*@observer@*/ int_32 * const getBuildTime(void) /*@*/; * @return 0 on success, 1 on EOF, <0 on error */ int readLine(Spec spec, int strip) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies spec->fileStack, spec->readStack, spec->line, spec->lineNum, spec->nextline, spec->nextpeekc, spec->lbuf, spec->sl, rpmGlobalMacroContext, fileSystem, internalState @*/; @@ -221,7 +221,7 @@ void addChangelogEntry(Header h, time_t time, const char * name, * @return >= 0 next rpmParseState, < 0 on error */ int parseBuildInstallClean(Spec spec, rpmParseState parsePart) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies spec->build, spec->install, spec->check, spec->clean, spec->macros, spec->fileStack, spec->readStack, spec->line, spec->lineNum, @@ -234,7 +234,7 @@ int parseBuildInstallClean(Spec spec, rpmParseState parsePart) * @return >= 0 next rpmParseState, < 0 on error */ int parseChangelog(Spec spec) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies spec->fileStack, spec->readStack, spec->line, spec->lineNum, spec->nextline, spec->nextpeekc, spec->lbuf, spec->sl, spec->packages->header, @@ -246,7 +246,7 @@ int parseChangelog(Spec spec) * @return >= 0 next rpmParseState, < 0 on error */ int parseDescription(Spec spec) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies spec->packages, spec->fileStack, spec->readStack, spec->line, spec->lineNum, spec->nextline, spec->nextpeekc, spec->lbuf, spec->sl, @@ -259,7 +259,7 @@ int parseDescription(Spec spec) * @return >= 0 next rpmParseState, < 0 on error */ int parseFiles(Spec spec) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies spec->packages, spec->fileStack, spec->readStack, spec->line, spec->lineNum, spec->nextline, spec->nextpeekc, spec->lbuf, spec->sl, @@ -272,7 +272,7 @@ int parseFiles(Spec spec) * @return >= 0 next rpmParseState, < 0 on error */ int parsePreamble(Spec spec, int initialPackage) - /*@globals rpmGlobalMacroContext, + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies spec->packages, spec->fileStack, spec->readStack, spec->line, spec->lineNum, @@ -290,7 +290,7 @@ int parsePreamble(Spec spec, int initialPackage) * @return >= 0 next rpmParseState, < 0 on error */ int parsePrep(Spec spec) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies spec->prep, spec->buildSubdir, spec->macros, spec->fileStack, spec->readStack, spec->line, spec->lineNum, spec->nextline, spec->nextpeekc, spec->lbuf, spec->sl, @@ -308,7 +308,7 @@ int parsePrep(Spec spec) */ int parseRCPOT(Spec spec, Package pkg, const char * field, int tag, int index, rpmsenseFlags tagflags) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies rpmGlobalMacroContext @*/; /** \ingroup rpmbuild @@ -318,7 +318,7 @@ int parseRCPOT(Spec spec, Package pkg, const char * field, int tag, int index, * @return >= 0 next rpmParseState, < 0 on error */ int parseScript(Spec spec, int parsePart) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies spec->packages, spec->fileStack, spec->readStack, spec->line, spec->lineNum, spec->nextline, spec->nextpeekc, spec->lbuf, spec->sl, @@ -331,7 +331,7 @@ int parseScript(Spec spec, int parsePart) * @return */ int parseExpressionBoolean(Spec spec, const char * expr) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies rpmGlobalMacroContext @*/; /** \ingroup rpmbuild @@ -342,7 +342,7 @@ int parseExpressionBoolean(Spec spec, const char * expr) */ /*@unused@*/ /*@null@*/ char * parseExpressionString(Spec spec, const char * expr) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies rpmGlobalMacroContext @*/; /** \ingroup rpmbuild @@ -357,7 +357,7 @@ char * parseExpressionString(Spec spec, const char * expr) */ int doScript(Spec spec, int what, /*@null@*/ const char * name, /*@null@*/ StringBuf sb, int test) - /*@globals rpmGlobalMacroContext, + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies spec->macros, rpmGlobalMacroContext, fileSystem, internalState @*/; @@ -436,8 +436,7 @@ int rpmlibNeedsFeature(Header h, const char * feature, const char * featureEVR) * @return 0 on success */ int processBinaryFiles(Spec spec, int installSpecialDoc, int test) - /*@globals rpmGlobalMacroContext, - fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies spec->macros, spec->packages->cpioList, spec->packages->fileList, spec->packages->specialDoc, spec->packages->header, @@ -458,7 +457,7 @@ void initSourceHeader(Spec spec) * @return 0 on success */ int processSourceFiles(Spec spec) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies spec->sourceHeader, spec->sourceCpioList, spec->buildRestrictions, spec->BANames, spec->packages->header, @@ -484,7 +483,7 @@ int parseSpec(rpmts ts, const char * specFile, /*@null@*/ const char * passPhrase, /*@null@*/ char * cookie, int anyarch, int force) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; /** \ingroup rpmbuild @@ -496,7 +495,7 @@ int parseSpec(rpmts ts, const char * specFile, * @return 0 on success */ int buildSpec(rpmts ts, Spec spec, int what, int test) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies spec->sourceHeader, spec->sourceCpioList, spec->cookie, spec->sourceRpmName, spec->sourcePkgId, spec->macros, spec->BASpecs, @@ -511,7 +510,7 @@ int buildSpec(rpmts ts, Spec spec, int what, int test) * @return 0 on success */ int packageBinaries(Spec spec) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies spec->packages->header, spec->packages->cpioList, spec->sourceRpmName, rpmGlobalMacroContext, fileSystem, internalState @*/; @@ -522,7 +521,7 @@ int packageBinaries(Spec spec) * @return 0 on success */ int packageSources(Spec spec) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies spec->sourceHeader, spec->cookie, spec->sourceCpioList, spec->sourceRpmName, spec->sourcePkgId, rpmGlobalMacroContext, fileSystem, internalState @*/; diff --git a/build/rpmfc.c b/build/rpmfc.c index 39a3a80b3..3d5813e32 100644 --- a/build/rpmfc.c +++ b/build/rpmfc.c @@ -22,7 +22,7 @@ /** */ static int rpmfcExpandAppend(/*@out@*/ ARGV_t * argvp, const ARGV_t av) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies *argvp, rpmGlobalMacroContext @*/ /*@requires maxRead(argvp) >= 0 @*/ { @@ -309,7 +309,7 @@ static char * rpmfcFileDep(/*@returned@*/ char * buf, int ix, * @return 0 on success */ static int rpmfcHelper(rpmfc fc, unsigned char deptype, const char * nsdep) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies fc, rpmGlobalMacroContext, fileSystem, internalState @*/ { const char * fn = fc->fn[fc->ix]; @@ -637,7 +637,7 @@ rpmfc rpmfcNew(void) * @return 0 on success */ static int rpmfcSCRIPT(rpmfc fc) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies fc, rpmGlobalMacroContext, fileSystem, internalState @*/ { const char * fn = fc->fn[fc->ix]; @@ -1324,7 +1324,7 @@ static void printDeps(Header h) /** */ static int rpmfcGenerateDependsHelper(const Spec spec, Package pkg, rpmfi fi) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies fi, rpmGlobalMacroContext, fileSystem, internalState @*/ { StringBuf sb_stdin; diff --git a/build/rpmfc.h b/build/rpmfc.h index 43e8bc7e7..3d5cd97f4 100644 --- a/build/rpmfc.h +++ b/build/rpmfc.h @@ -107,7 +107,7 @@ extern "C" { */ int rpmfcExec(ARGV_t av, StringBuf sb_stdin, /*@out@*/ StringBuf * sb_stdoutp, int failnonzero) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies *sb_stdoutp, rpmGlobalMacroContext, fileSystem, internalState @*/ /*@requires maxSet(sb_stdoutp) >= 0 @*/; @@ -184,7 +184,7 @@ int rpmfcApply(rpmfc fc) * @return 0 on success */ int rpmfcGenerateDepends(const Spec spec, Package pkg) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies pkg->cpioList, pkg->header, rpmGlobalMacroContext, fileSystem, internalState @*/; diff --git a/build/rpmspec.h b/build/rpmspec.h index bcbf73f35..ab71084e2 100644 --- a/build/rpmspec.h +++ b/build/rpmspec.h @@ -241,7 +241,7 @@ extern "C" { * @return 0 on success, else no. of failures */ int rpmspecQuery(rpmts ts, QVA_t qva, const char * arg) - /*@globals rpmGlobalMacroContext, + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, qva, rpmGlobalMacroContext, fileSystem, internalState @*/; @@ -267,7 +267,7 @@ spectag stashSt(Spec spec, Header h, int tag, const char * lang) * @param tag */ int addSource(Spec spec, Package pkg, const char * field, int tag) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies spec->sources, spec->numSources, spec->st, spec->macros, pkg->icon, diff --git a/lib/.splintrc b/lib/.splintrc index 165d898ac..c46cc2d0f 100644 --- a/lib/.splintrc +++ b/lib/.splintrc @@ -3,7 +3,7 @@ +partial +forcehints --warnunixlib +#-warnunixlib -warnposix +unixlib diff --git a/lib/cpio.h b/lib/cpio.h index 3f95a55b7..1dcaa2acf 100644 --- a/lib/cpio.h +++ b/lib/cpio.h @@ -102,7 +102,7 @@ extern "C" { * @return 0 on success */ int cpioTrailerWrite(FSM_t fsm) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fsm, fileSystem, internalState @*/; /** @@ -112,7 +112,7 @@ int cpioTrailerWrite(FSM_t fsm) * @return 0 on success */ int cpioHeaderWrite(FSM_t fsm, struct stat * st) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fsm, fileSystem, internalState @*/; /** @@ -122,7 +122,7 @@ int cpioHeaderWrite(FSM_t fsm, struct stat * st) * @return 0 on success */ int cpioHeaderRead(FSM_t fsm, struct stat * st) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fsm, *st, fileSystem, internalState @*/; /** \ingroup payload diff --git a/lib/depends.c b/lib/depends.c index a784d32df..f303ec3dd 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -331,7 +331,7 @@ int rpmtsAddEraseElement(rpmts ts, Header h, int dboffset) * @return 0 if satisfied, 1 if not satisfied, 2 if error */ static int unsatisfiedDepend(rpmts ts, rpmds dep, int adding) - /*@globals _cacheDependsRC, rpmGlobalMacroContext, + /*@globals _cacheDependsRC, rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, _cacheDependsRC, rpmGlobalMacroContext, fileSystem, internalState @*/ @@ -577,7 +577,7 @@ exit: static int checkPackageDeps(rpmts ts, const char * pkgNEVR, /*@null@*/ rpmds requires, /*@null@*/ rpmds conflicts, /*@null@*/ const char * depName, uint_32 tscolor, int adding) - /*@globals rpmGlobalMacroContext, + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, requires, conflicts, rpmGlobalMacroContext, fileSystem, internalState */ @@ -676,7 +676,7 @@ static int checkPackageDeps(rpmts ts, const char * pkgNEVR, */ static int checkPackageSet(rpmts ts, const char * dep, /*@only@*/ /*@null@*/ rpmdbMatchIterator mi, int adding) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, mi, rpmGlobalMacroContext, fileSystem, internalState @*/ { int scareMem = 1; @@ -717,7 +717,7 @@ static int checkPackageSet(rpmts ts, const char * dep, * @return 0 no problems found */ static int checkDependentPackages(rpmts ts, const char * dep) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ { rpmdbMatchIterator mi; @@ -732,7 +732,7 @@ static int checkDependentPackages(rpmts ts, const char * dep) * @return 0 no problems found */ static int checkDependentConflicts(rpmts ts, const char * dep) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ { int rc = 0; @@ -816,8 +816,10 @@ static void freeBadDeps(void) */ /*@-boundsread@*/ static int ignoreDep(const rpmte p, const rpmte q) - /*@globals badDeps, badDepsInitialized, rpmGlobalMacroContext @*/ - /*@modifies badDeps, badDepsInitialized, rpmGlobalMacroContext @*/ + /*@globals badDeps, badDepsInitialized, + rpmGlobalMacroContext, h_errno @*/ + /*@modifies badDeps, badDepsInitialized, + rpmGlobalMacroContext @*/ { struct badDeps_s * bdp; @@ -1000,7 +1002,7 @@ static inline int addRelation(rpmts ts, /*@dependent@*/ rpmte p, unsigned char * selected, rpmds requires) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, p, *selected, rpmGlobalMacroContext, fileSystem, internalState @*/ { diff --git a/lib/formats.c b/lib/formats.c index 54994a830..b86a5a054 100644 --- a/lib/formats.c +++ b/lib/formats.c @@ -604,7 +604,7 @@ static int instprefixTag(Header h, /*@null@*/ /*@out@*/ rpmTagType * type, static int fssizesTag(Header h, /*@out@*/ rpmTagType * type, /*@out@*/ const void ** data, /*@out@*/ int_32 * count, /*@out@*/ int * freeData) - /*@globals rpmGlobalMacroContext, + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies *type, *data, *count, *freeData, rpmGlobalMacroContext, fileSystem, internalState @*/ @@ -911,7 +911,7 @@ static const char * _macro_i18ndomains = "%{?_i18ndomains}"; static int i18nTag(Header h, int_32 tag, /*@out@*/ rpmTagType * type, /*@out@*/ const void ** data, /*@out@*/ int_32 * count, /*@out@*/ int * freeData) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies *type, *data, *count, *freeData, rpmGlobalMacroContext @*/ /*@requires maxSet(type) >= 0 /\ maxSet(data) >= 0 /\ maxSet(count) >= 0 /\ maxSet(freeData) >= 0 @*/ @@ -1001,7 +1001,7 @@ static int i18nTag(Header h, int_32 tag, /*@out@*/ rpmTagType * type, static int summaryTag(Header h, /*@out@*/ rpmTagType * type, /*@out@*/ const void ** data, /*@out@*/ int_32 * count, /*@out@*/ int * freeData) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies *type, *data, *count, *freeData, rpmGlobalMacroContext @*/ /*@requires maxSet(type) >= 0 /\ maxSet(data) >= 0 /\ maxSet(count) >= 0 /\ maxSet(freeData) >= 0 @*/ @@ -1021,7 +1021,7 @@ static int summaryTag(Header h, /*@out@*/ rpmTagType * type, static int descriptionTag(Header h, /*@out@*/ rpmTagType * type, /*@out@*/ const void ** data, /*@out@*/ int_32 * count, /*@out@*/ int * freeData) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies *type, *data, *count, *freeData, rpmGlobalMacroContext @*/ /*@requires maxSet(type) >= 0 /\ maxSet(data) >= 0 /\ maxSet(count) >= 0 /\ maxSet(freeData) >= 0 @*/ @@ -1041,7 +1041,7 @@ static int descriptionTag(Header h, /*@out@*/ rpmTagType * type, static int groupTag(Header h, /*@out@*/ rpmTagType * type, /*@out@*/ const void ** data, /*@out@*/ int_32 * count, /*@out@*/ int * freeData) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies *type, *data, *count, *freeData, rpmGlobalMacroContext @*/ /*@requires maxSet(type) >= 0 /\ maxSet(data) >= 0 /\ maxSet(count) >= 0 /\ maxSet(freeData) >= 0 @*/ @@ -392,7 +392,7 @@ const char * dnlNextIterator(/*@null@*/ DNLI_t dnli) /*@=boundsread@*/ static void * fsmThread(void * arg) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies arg, fileSystem, internalState @*/ { FSM_t fsm = arg; @@ -402,7 +402,7 @@ static void * fsmThread(void * arg) } int fsmNext(FSM_t fsm, fileStage nstage) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fsm, fileSystem, internalState @*/ { fsm->nstage = nstage; @@ -421,7 +421,7 @@ static int saveHardLink(/*@special@*/ /*@partial@*/ FSM_t fsm) /*@uses fsm->links, fsm->ix, fsm->sb, fsm->goal, fsm->nsuffix @*/ /*@defines fsm->li @*/ /*@releases fsm->path @*/ - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fsm, fileSystem, internalState @*/ { struct stat * st = &fsm->sb; @@ -778,7 +778,7 @@ int fsmMapAttrs(FSM_t fsm) /*@-compdef@*/ static int expandRegular(/*@special@*/ FSM_t fsm) /*@uses fsm->fmd5sum, fsm->md5sum, fsm->sb, fsm->wfd @*/ - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fsm, fileSystem, internalState @*/ { const struct stat * st = &fsm->sb; @@ -847,7 +847,7 @@ exit: /*@-compdef -compmempass@*/ static int writeFile(/*@special@*/ /*@partial@*/ FSM_t fsm, int writeData) /*@uses fsm->path, fsm->opath, fsm->sb, fsm->osb, fsm->cfd @*/ - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fsm, fileSystem, internalState @*/ { const char * path = fsm->path; @@ -990,7 +990,7 @@ exit: */ static int writeLinkedFile(/*@special@*/ /*@partial@*/ FSM_t fsm) /*@uses fsm->path, fsm->nsuffix, fsm->ix, fsm->li, fsm->failedFile @*/ - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fsm, fileSystem, internalState @*/ { const char * path = fsm->path; @@ -1043,7 +1043,7 @@ static int writeLinkedFile(/*@special@*/ /*@partial@*/ FSM_t fsm) /*@-compdef@*/ static int fsmMakeLinks(/*@special@*/ /*@partial@*/ FSM_t fsm) /*@uses fsm->path, fsm->opath, fsm->nsuffix, fsm->ix, fsm->li @*/ - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fsm, fileSystem, internalState @*/ { const char * path = fsm->path; @@ -1110,7 +1110,7 @@ static int fsmMakeLinks(/*@special@*/ /*@partial@*/ FSM_t fsm) static int fsmCommitLinks(/*@special@*/ /*@partial@*/ FSM_t fsm) /*@uses fsm->path, fsm->nsuffix, fsm->ix, fsm->sb, fsm->li, fsm->links @*/ - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fsm, fileSystem, internalState @*/ { const char * path = fsm->path; @@ -1157,7 +1157,7 @@ static int fsmCommitLinks(/*@special@*/ /*@partial@*/ FSM_t fsm) */ static int fsmRmdirs(/*@special@*/ /*@partial@*/ FSM_t fsm) /*@uses fsm->path, fsm->dnlx, fsm->ldn, fsm->rdbuf, fsm->iter @*/ - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fsm, fileSystem, internalState @*/ { const char * path = fsm->path; @@ -1216,7 +1216,7 @@ static int fsmMkdirs(/*@special@*/ /*@partial@*/ FSM_t fsm) /*@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 @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fsm, fileSystem, internalState @*/ { struct stat * st = &fsm->sb; @@ -251,7 +251,7 @@ int fsmSetup(FSM_t fsm, fileStage goal, FD_t cfd, /*@out@*/ unsigned int * archiveSize, /*@out@*/ const char ** failedFile) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fsm, ts, fi, *archiveSize, *failedFile, fileSystem, internalState @*/; @@ -261,7 +261,7 @@ int fsmSetup(FSM_t fsm, fileStage goal, * @return 0 on success */ int fsmTeardown(FSM_t fsm) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fsm, fileSystem, internalState @*/; /*@-exportlocal@*/ @@ -303,7 +303,7 @@ int fsmMapAttrs(FSM_t fsm) * @return 0 on success */ int fsmNext(FSM_t fsm, fileStage nstage) - /*@globals errno, fileSystem, internalState @*/ + /*@globals errno, h_errno, fileSystem, internalState @*/ /*@modifies fsm, errno, fileSystem, internalState @*/; /** @@ -314,7 +314,7 @@ int fsmNext(FSM_t fsm, fileStage nstage) */ /*@-exportlocal@*/ int fsmStage(/*@partial@*/ FSM_t fsm, fileStage stage) - /*@globals errno, fileSystem, internalState @*/ + /*@globals errno, h_errno, fileSystem, internalState @*/ /*@modifies fsm, errno, fileSystem, internalState @*/; /*@=exportlocal@*/ diff --git a/lib/misc.h b/lib/misc.h index ed93b9905..bb3dd748a 100644 --- a/lib/misc.h +++ b/lib/misc.h @@ -18,7 +18,7 @@ extern "C" { * @return rpmRC return code */ rpmRC rpmMkdirPath (const char * dpath, const char * dname) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fileSystem, internalState @*/; /** @@ -92,7 +92,7 @@ int doputenv(const char * str) int makeTempFile(/*@null@*/ const char * prefix, /*@null@*/ /*@out@*/ const char ** fnptr, /*@out@*/ FD_t * fdptr) - /*@globals rpmGlobalMacroContext, + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies *fnptr, *fdptr, rpmGlobalMacroContext, fileSystem, internalState @*/; diff --git a/lib/poptALL.c b/lib/poptALL.c index de4c52735..6d9ed6a05 100644 --- a/lib/poptALL.c +++ b/lib/poptALL.c @@ -118,7 +118,7 @@ static void printVersion(FILE * fp) /*@mayexit@*/ void rpmcliConfigured(void) /*@globals rpmcliInitialized, rpmCLIMacroContext, rpmGlobalMacroContext, - fileSystem, internalState @*/ + h_errno, fileSystem, internalState @*/ /*@modifies rpmcliInitialized, rpmCLIMacroContext, rpmGlobalMacroContext, fileSystem, internalState @*/ { @@ -137,7 +137,7 @@ static void rpmcliAllArgCallback( /*@unused@*/ poptContext con, const struct poptOption * opt, const char * arg, /*@unused@*/ const void * data) /*@globals rpmcliQueryFlags, rpmCLIMacroContext, rpmGlobalMacroContext, - fileSystem, internalState @*/ + h_errno, fileSystem, internalState @*/ /*@modifies rpmcliQueryFlags, rpmCLIMacroContext, rpmGlobalMacroContext, fileSystem, internalState @*/ { @@ -154,7 +154,7 @@ static int rpmInstallLoadMacros(rpmfi fi, Header h) */ /*@-bounds@*/ static rpmRC markReplacedFiles(const rpmpsm psm) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies psm, rpmGlobalMacroContext, fileSystem, internalState @*/ { const rpmts ts = psm->ts; @@ -514,7 +514,7 @@ static const char * ldconfig_path = "/sbin/ldconfig"; static rpmRC runScript(rpmpsm psm, Header h, const char * sln, int progArgc, const char ** progArgv, const char * script, int arg1, int arg2) - /*@globals ldconfig_done, rpmGlobalMacroContext, + /*@globals ldconfig_done, rpmGlobalMacroContext, h_errno, fileSystem, internalState@*/ /*@modifies psm, ldconfig_done, rpmGlobalMacroContext, fileSystem, internalState @*/ @@ -785,7 +785,7 @@ static rpmRC runScript(rpmpsm psm, Header h, const char * sln, * @return rpmRC return code */ static rpmRC runInstScript(rpmpsm psm) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies psm, rpmGlobalMacroContext, fileSystem, internalState @*/ { rpmfi fi = psm->fi; @@ -840,7 +840,7 @@ exit: static rpmRC handleOneTrigger(const rpmpsm psm, Header sourceH, Header triggeredH, int arg2, unsigned char * triggersAlreadyRun) - /*@globals rpmGlobalMacroContext, fileSystem, internalState@*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState@*/ /*@modifies psm, sourceH, triggeredH, *triggersAlreadyRun, rpmGlobalMacroContext, fileSystem, internalState @*/ { @@ -938,7 +938,7 @@ static rpmRC handleOneTrigger(const rpmpsm psm, * @return 0 on success */ static rpmRC runTriggers(rpmpsm psm) - /*@globals rpmGlobalMacroContext, + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies psm, rpmGlobalMacroContext, fileSystem, internalState @*/ @@ -979,7 +979,7 @@ static rpmRC runTriggers(rpmpsm psm) * @return 0 on success */ static rpmRC runImmedTriggers(rpmpsm psm) - /*@globals rpmGlobalMacroContext, + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies psm, rpmGlobalMacroContext, fileSystem, internalState @*/ @@ -1148,7 +1148,7 @@ rpmpsm rpmpsmNew(rpmts ts, rpmte te, rpmfi fi) } static void * rpmpsmThread(void * arg) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies arg, rpmGlobalMacroContext, fileSystem, internalState @*/ { rpmpsm psm = arg; @@ -1158,7 +1158,7 @@ static void * rpmpsmThread(void * arg) } static int rpmpsmNext(rpmpsm psm, pkgStage nstage) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies psm, rpmGlobalMacroContext, fileSystem, internalState @*/ { psm->nstage = nstage; @@ -179,7 +179,7 @@ rpmpsm rpmpsmNew(rpmts ts, /*@null@*/ rpmte te, rpmfi fi) * @return 0 on success */ rpmRC rpmpsmStage(rpmpsm psm, pkgStage stage) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies psm, rpmGlobalMacroContext, fileSystem, internalState @*/; #define rpmpsmUNSAFE rpmpsmSTAGE diff --git a/lib/rpmchecksig.c b/lib/rpmchecksig.c index 92ccf0cd0..1ddc4482a 100644 --- a/lib/rpmchecksig.c +++ b/lib/rpmchecksig.c @@ -30,7 +30,7 @@ static int _print_pkts = 0; static int manageFile(/*@out@*/ FD_t *fdp, /*@null@*/ /*@out@*/ const char **fnp, int flags, /*@unused@*/ int rc) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies *fdp, *fnp, rpmGlobalMacroContext, fileSystem, internalState @*/ { @@ -90,7 +90,7 @@ static int manageFile(/*@out@*/ FD_t *fdp, /*@-boundsread@*/ static int copyFile(FD_t *sfdp, const char **sfnp, FD_t *tfdp, const char **tfnp) - /*@globals rpmGlobalMacroContext, + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies *sfdp, *sfnp, *tfdp, *tfnp, rpmGlobalMacroContext, fileSystem, internalState @*/ @@ -167,7 +167,7 @@ static int getSignid(Header sig, int sigtag, unsigned char * signid) */ static int rpmReSign(/*@unused@*/ rpmts ts, QVA_t qva, const char ** argv) - /*@globals rpmGlobalMacroContext, + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/ @@ -548,7 +548,7 @@ exit: static int rpmcliImportPubkeys(const rpmts ts, /*@unused@*/ QVA_t qva, /*@null@*/ const char ** argv) - /*@globals RPMVERSION, rpmGlobalMacroContext, + /*@globals RPMVERSION, rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/ diff --git a/lib/rpmcli.h b/lib/rpmcli.h index 8f9fabd6d..28b7b65a9 100644 --- a/lib/rpmcli.h +++ b/lib/rpmcli.h @@ -46,7 +46,7 @@ extern const char * rpmcliRootDir; /*@null@*/ poptContext rpmcliInit(int argc, char *const argv[], struct poptOption * optionsTable) - /*@globals rpmCLIMacroContext, rpmGlobalMacroContext, stderr, + /*@globals rpmCLIMacroContext, rpmGlobalMacroContext, h_errno, stderr, fileSystem, internalState @*/ /*@modifies rpmCLIMacroContext, rpmGlobalMacroContext, stderr, fileSystem, internalState @*/; @@ -57,7 +57,7 @@ rpmcliInit(int argc, char *const argv[], struct poptOption * optionsTable) */ /*@mayexit@*/ void rpmcliConfigured(void) - /*@globals rpmCLIMacroContext, rpmGlobalMacroContext, + /*@globals rpmCLIMacroContext, rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies rpmCLIMacroContext, rpmGlobalMacroContext, fileSystem, internalState @*/; @@ -226,7 +226,7 @@ typedef struct rpmQVKArguments_s * QVA_t; * @return 0 on success */ typedef int (*QVF_t) (QVA_t qva, rpmts ts, Header h) - /*@globals fileSystem@*/ + /*@globals fileSystem @*/ /*@modifies qva, ts, fileSystem @*/; /** \ingroup rpmcli @@ -238,7 +238,7 @@ typedef int (*QVF_t) (QVA_t qva, rpmts ts, Header h) * @return 0 on success */ typedef int (*QSpecF_t) (rpmts ts, QVA_t qva, const char * arg) - /*@globals rpmGlobalMacroContext, + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, qva, rpmGlobalMacroContext, fileSystem, internalState @*/; @@ -316,7 +316,7 @@ extern struct poptOption rpmVerifyPoptTable[]; * @return result of last non-zero showPackage() return */ int rpmcliShowMatches(QVA_t qva, rpmts ts) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies qva, rpmGlobalMacroContext, fileSystem, internalState @*/; /** \ingroup rpmcli @@ -324,7 +324,7 @@ int rpmcliShowMatches(QVA_t qva, rpmts ts) * @param fp file handle to use for display */ void rpmDisplayQueryTags(FILE * fp) - /*@globals fileSystem@*/ + /*@globals fileSystem @*/ /*@modifies *fp, fileSystem @*/; /** \ingroup rpmcli @@ -340,7 +340,7 @@ void rpmDisplayQueryTags(FILE * fp) * @return showPackage() result, 1 if rpmdbInitIterator() is NULL */ int rpmQueryVerify(QVA_t qva, rpmts ts, const char * arg) - /*@globals rpmGlobalMacroContext, + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies qva, ts, rpmGlobalMacroContext, fileSystem, internalState @*/; @@ -366,7 +366,7 @@ int showQueryPackage(QVA_t qva, rpmts ts, Header h) * @return 0 on success, else no. of failures */ int rpmcliQuery(rpmts ts, QVA_t qva, /*@null@*/ const char ** argv) - /*@globals rpmGlobalMacroContext, + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, qva, rpmGlobalMacroContext, fileSystem, internalState @*/; @@ -383,7 +383,7 @@ int rpmcliQuery(rpmts ts, QVA_t qva, /*@null@*/ const char ** argv) /*@-incondefs@*/ int rpmVerifyFile(const rpmts ts, rpmfi fi, /*@out@*/ rpmVerifyAttrs * res, rpmVerifyAttrs omitMask) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fi, *res, fileSystem, internalState @*/ /*@requires maxSet(res) >= 0 @*/; /*@=incondefs@*/ @@ -396,7 +396,7 @@ int rpmVerifyFile(const rpmts ts, rpmfi fi, * @return result of last non-zero verify return */ int showVerifyPackage(QVA_t qva, rpmts ts, Header h) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, h, rpmGlobalMacroContext, fileSystem, internalState @*/; /** @@ -408,8 +408,8 @@ int showVerifyPackage(QVA_t qva, rpmts ts, Header h) * @return 0 on success, 1 on failure */ int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd, const char * fn) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ - /*@modifies qva, ts, fd, rpmGlobalMacroContext, + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ + /*@modifies qva, ts, fd, rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/; /** \ingroup rpmcli @@ -421,7 +421,7 @@ int rpmVerifySignatures(QVA_t qva, rpmts ts, FD_t fd, const char * fn) * @return 0 on success, else no. of failures */ int rpmcliVerify(rpmts ts, QVA_t qva, /*@null@*/ const char ** argv) - /*@globals rpmGlobalMacroContext, + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, qva, rpmGlobalMacroContext, fileSystem, internalState @*/; @@ -512,7 +512,7 @@ void * rpmShowProgress(/*@null@*/ const void * arg, /*@null@*/ void * data) /*@globals rpmcliHashesCurrent, rpmcliProgressCurrent, rpmcliProgressTotal, - fileSystem, internalState @*/ + h_errno, fileSystem, internalState @*/ /*@modifies rpmcliHashesCurrent, rpmcliProgressCurrent, rpmcliProgressTotal, fileSystem, internalState @*/; @@ -528,7 +528,7 @@ void * rpmShowProgress(/*@null@*/ const void * arg, int rpmInstallSource(rpmts ts, const char * arg, /*@null@*/ /*@out@*/ const char ** specFilePtr, /*@null@*/ /*@out@*/ const char ** cookie) - /*@globals rpmGlobalMacroContext, + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState@*/ /*@modifies ts, *specFilePtr, *cookie, rpmGlobalMacroContext, fileSystem, internalState @*/; @@ -563,7 +563,7 @@ struct rpmInstallArguments_s { */ int rpmInstall(rpmts ts, struct rpmInstallArguments_s * ia, /*@null@*/ const char ** fileArgv) - /*@globals rpmcliPackagesTotal, rpmGlobalMacroContext, + /*@globals rpmcliPackagesTotal, rpmGlobalMacroContext, h_errno, fileSystem, internalState@*/ /*@modifies ts, ia, rpmcliPackagesTotal, rpmGlobalMacroContext, fileSystem, internalState @*/; @@ -577,7 +577,7 @@ int rpmInstall(rpmts ts, struct rpmInstallArguments_s * ia, */ int rpmErase(rpmts ts, struct rpmInstallArguments_s * ia, /*@null@*/ const char ** argv) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, ia, rpmGlobalMacroContext, fileSystem, internalState @*/; @@ -652,7 +652,7 @@ IDTX IDTXsort(/*@only@*/ /*@null@*/ IDTX idtx) */ /*@only@*/ /*@null@*/ IDTX IDTXload(rpmts ts, rpmTag tag) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; /** @@ -664,7 +664,7 @@ IDTX IDTXload(rpmts ts, rpmTag tag) */ /*@only@*/ /*@null@*/ IDTX IDTXglob(rpmts ts, const char * globstr, rpmTag tag) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; /** \ingroup rpmcli @@ -676,7 +676,7 @@ IDTX IDTXglob(rpmts ts, const char * globstr, rpmTag tag) */ int rpmRollback(rpmts ts, struct rpmInstallArguments_s * ia, /*@null@*/ const char ** argv) - /*@globals rpmcliPackagesTotal, rpmGlobalMacroContext, + /*@globals rpmcliPackagesTotal, rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, ia, rpmcliPackagesTotal, rpmGlobalMacroContext, fileSystem, internalState @*/; @@ -731,7 +731,7 @@ extern struct poptOption rpmDatabasePoptTable[]; */ rpmRC rpmcliImportPubkey(const rpmts ts, const unsigned char * pkt, ssize_t pktlen) - /*@globals RPMVERSION, rpmGlobalMacroContext, + /*@globals RPMVERSION, rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; @@ -762,7 +762,7 @@ extern struct poptOption rpmSignPoptTable[]; * @return 0 on success */ int rpmcliSign(rpmts ts, QVA_t qva, /*@null@*/ const char ** argv) - /*@globals RPMVERSION, rpmGlobalMacroContext, + /*@globals RPMVERSION, rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, qva, rpmGlobalMacroContext, fileSystem, internalState @*/; diff --git a/lib/rpmlib.h b/lib/rpmlib.h index a5c5b6e81..cbd51735f 100644 --- a/lib/rpmlib.h +++ b/lib/rpmlib.h @@ -576,7 +576,7 @@ enum rpm_machtable_e { */ int rpmReadConfigFiles(/*@null@*/ const char * file, /*@null@*/ const char * target) - /*@globals rpmGlobalMacroContext, rpmCLIMacroContext, + /*@globals rpmGlobalMacroContext, rpmCLIMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies rpmGlobalMacroContext, rpmCLIMacroContext, fileSystem, internalState @*/; @@ -623,7 +623,7 @@ int rpmMachineScore(int type, const char * name) * @return 0 always */ int rpmShowRC(FILE * fp) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies *fp, rpmGlobalMacroContext, fileSystem, internalState @*/; /** \ingroup rpmrc @@ -634,7 +634,7 @@ int rpmShowRC(FILE * fp) * @param osTable */ void rpmSetTables(int archTable, int osTable) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/; /** \ingroup rpmrc @@ -648,7 +648,7 @@ void rpmSetTables(int archTable, int osTable) * @param os os name (or NULL) */ void rpmSetMachine(/*@null@*/ const char * arch, /*@null@*/ const char * os) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/; /** \ingroup rpmrc @@ -869,7 +869,7 @@ int headerVerifyInfo(int il, int dl, const void * pev, void * iv, int negate) */ rpmRC headerCheck(rpmts ts, const void * uh, size_t uc, /*@out@*/ /*@null@*/ const char ** msg) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, *msg, rpmGlobalMacroContext, fileSystem, internalState @*/; @@ -883,7 +883,7 @@ rpmRC headerCheck(rpmts ts, const void * uh, size_t uc, */ rpmRC rpmReadHeader(rpmts ts, FD_t fd, /*@out@*/ Header *hdrp, /*@out@*/ /*@null@*/ const char ** msg) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, *hdrp, *msg, rpmGlobalMacroContext, fileSystem, internalState @*/; @@ -897,7 +897,7 @@ rpmRC rpmReadHeader(rpmts ts, FD_t fd, /*@out@*/ Header *hdrp, */ rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, const char * fn, /*@null@*/ /*@out@*/ Header * hdrp) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, fd, *hdrp, rpmGlobalMacroContext, fileSystem, internalState @*/; @@ -912,7 +912,7 @@ rpmRC rpmReadPackageFile(rpmts ts, FD_t fd, rpmRC rpmInstallSourcePackage(rpmts ts, FD_t fd, /*@null@*/ /*@out@*/ const char ** specFilePtr, /*@null@*/ /*@out@*/ const char ** cookie) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, fd, *specFilePtr, *cookie, rpmGlobalMacroContext, fileSystem, internalState @*/; @@ -1101,7 +1101,7 @@ int rpmGetFilesystemList( /*@null@*/ /*@out@*/ const char *** listptr, int rpmGetFilesystemUsage(const char ** fileList, int_32 * fssizes, int numFiles, /*@null@*/ /*@out@*/ uint_32 ** usagesPtr, int flags) - /*@globals rpmGlobalMacroContext, + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies *usagesPtr, rpmGlobalMacroContext, fileSystem, internalState @*/ @@ -1180,7 +1180,7 @@ enum rpmtagSignature { */ rpmRC rpmVerifySignature(const rpmts ts, /*@out@*/ char * result) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, *result, rpmGlobalMacroContext, fileSystem, internalState @*/; diff --git a/lib/rpmrc.c b/lib/rpmrc.c index 284f4570f..a5f7eca54 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -142,7 +142,7 @@ static int defaultsInitialized = 0; /* prototypes */ static int doReadRC( /*@killref@*/ FD_t fd, const char * urlfn) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies fd, rpmGlobalMacroContext, fileSystem, internalState @*/; static void rpmSetVarArch(int var, const char * val, @@ -155,7 +155,7 @@ static void rebuildCompatTables(int type, const char * name) /*@modifies internalState @*/; static void rpmRebuildTargetVars(/*@null@*/ const char **target, /*@null@*/ const char ** canontarget) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies *canontarget, rpmGlobalMacroContext, fileSystem, internalState @*/; @@ -463,7 +463,7 @@ static void setVarDefault(int var, const char * macroname, const char * val, } static void setPathDefault(int var, const char * macroname, const char * subdir) - /*@globals rpmGlobalMacroContext, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ /*@modifies rpmGlobalMacroContext, internalState @*/ { @@ -514,7 +514,7 @@ export RPM_BUILD_ROOT\n}\ "; static void setDefaults(void) - /*@globals rpmGlobalMacroContext, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ /*@modifies rpmGlobalMacroContext, internalState @*/ { @@ -552,7 +552,7 @@ static void setDefaults(void) /*@-usedef@*/ /*@ FIX: se usage inconsistent, W2DO? */ static int doReadRC( /*@killref@*/ FD_t fd, const char * urlfn) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies fd, rpmGlobalMacroContext, fileSystem, internalState @*/ { const char *s; @@ -777,7 +777,7 @@ static int doReadRC( /*@killref@*/ FD_t fd, const char * urlfn) /*@-bounds@*/ static int rpmPlatform(const char * platform) /*@globals nplatpat, platpat, - rpmGlobalMacroContext, fileSystem, internalState @*/ + rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies nplatpat, platpat, rpmGlobalMacroContext, fileSystem, internalState @*/ { @@ -1052,7 +1052,7 @@ static void mfspr_ill(int notused) */ static void defaultMachine(/*@out@*/ const char ** arch, /*@out@*/ const char ** os) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies *arch, *os, rpmGlobalMacroContext, fileSystem, internalState @*/ { static struct utsname un; @@ -1723,7 +1723,7 @@ void rpmFreeRpmrc(void) */ static int rpmReadRC(/*@null@*/ const char * rcfiles) /*@globals defaultsInitialized, rpmGlobalMacroContext, - rpmCLIMacroContext, fileSystem, internalState @*/ + rpmCLIMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies defaultsInitialized, rpmGlobalMacroContext, fileSystem, internalState @*/ { diff --git a/lib/rpmts.h b/lib/rpmts.h index 891e678a6..0bd3fdfb5 100644 --- a/lib/rpmts.h +++ b/lib/rpmts.h @@ -244,7 +244,7 @@ extern "C" { * @return 0 on success */ int rpmtsCheck(rpmts ts) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; /** \ingroup rpmts @@ -264,7 +264,7 @@ int rpmtsCheck(rpmts ts) * @return no. of (added) packages that could not be ordered */ int rpmtsOrder(rpmts ts) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; /** \ingroup rpmts @@ -276,7 +276,7 @@ int rpmtsOrder(rpmts ts) * @return 0 on success, -1 on error, >0 with newProbs set */ int rpmtsRun(rpmts ts, rpmps okProbs, rpmprobFilterFlags ignoreSet) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; /** \ingroup rpmts @@ -331,7 +331,7 @@ int rpmtsCloseDB(rpmts ts) * @return 0 on success */ int rpmtsOpenDB(rpmts ts, int dbmode) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; /** \ingroup rpmts @@ -342,7 +342,7 @@ int rpmtsOpenDB(rpmts ts, int dbmode) * @return 0 on success */ int rpmtsInitDB(rpmts ts, int dbmode) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; /** \ingroup rpmts @@ -351,7 +351,7 @@ int rpmtsInitDB(rpmts ts, int dbmode) * @return 0 on success */ int rpmtsRebuildDB(rpmts ts) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; /** \ingroup rpmts @@ -360,7 +360,7 @@ int rpmtsRebuildDB(rpmts ts) * @return 0 on success */ int rpmtsVerifyDB(rpmts ts) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; /** \ingroup rpmts @@ -374,7 +374,7 @@ int rpmtsVerifyDB(rpmts ts) /*@only@*/ /*@null@*/ rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, /*@null@*/ const void * keyp, size_t keylen) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; /** @@ -383,7 +383,7 @@ rpmdbMatchIterator rpmtsInitIterator(const rpmts ts, rpmTag rpmtag, * @return RPMRC_OK on success, RPMRC_NOKEY if not found */ rpmRC rpmtsFindPubkey(rpmts ts) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState */; /** \ingroup rpmts @@ -405,7 +405,7 @@ int rpmtsCloseSDB(rpmts ts) */ /*@-exportlocal@*/ int rpmtsOpenSDB(rpmts ts, int dbmode) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; /*@=exportlocal@*/ @@ -418,7 +418,7 @@ int rpmtsOpenSDB(rpmts ts, int dbmode) */ /*@-exportlocal@*/ int rpmtsSolve(rpmts ts, rpmds ds, const void * data) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, rpmGlobalMacroContext, fileSystem, internalState @*/; /*@=exportlocal@*/ @@ -857,7 +857,7 @@ int rpmtsSetNotifyCallback(rpmts ts, */ /*@newref@*/ rpmts rpmtsCreate(void) - /*@globals rpmGlobalMacroContext, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ /*@modifies rpmGlobalMacroContext, internalState @*/; /** \ingroup rpmts @@ -876,7 +876,7 @@ rpmts rpmtsCreate(void) int rpmtsAddInstallElement(rpmts ts, Header h, /*@exposed@*/ /*@null@*/ const fnpyKey key, int upgrade, /*@null@*/ rpmRelocation * relocs) - /*@globals rpmcliPackagesTotal, rpmGlobalMacroContext, + /*@globals rpmcliPackagesTotal, rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, h, rpmcliPackagesTotal, rpmGlobalMacroContext, fileSystem, internalState @*/; diff --git a/lib/signature.c b/lib/signature.c index 9d44d4f23..a6a0eed0b 100644 --- a/lib/signature.c +++ b/lib/signature.c @@ -376,7 +376,7 @@ Header rpmFreeSignature(Header h) */ static int makePGPSignature(const char * file, /*@out@*/ byte ** pkt, /*@out@*/ int_32 * pktlen, /*@null@*/ const char * passPhrase) - /*@globals errno, rpmGlobalMacroContext, + /*@globals errno, rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies errno, *pkt, *pktlen, rpmGlobalMacroContext, fileSystem, internalState @*/ @@ -511,7 +511,7 @@ static int makePGPSignature(const char * file, /*@out@*/ byte ** pkt, */ static int makeGPGSignature(const char * file, /*@out@*/ byte ** pkt, /*@out@*/ int_32 * pktlen, /*@null@*/ const char * passPhrase) - /*@globals rpmGlobalMacroContext, + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies *pkt, *pktlen, rpmGlobalMacroContext, fileSystem, internalState @*/ @@ -626,7 +626,7 @@ static int makeGPGSignature(const char * file, /*@out@*/ byte ** pkt, */ static int makeHDRSignature(Header sig, const char * file, int_32 sigTag, /*@null@*/ const char * passPhrase) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies sig, rpmGlobalMacroContext, fileSystem, internalState @*/ { Header h = NULL; @@ -782,7 +782,7 @@ int rpmAddSignature(Header sig, const char * file, int_32 sigTag, } static int checkPassPhrase(const char * passPhrase, const int sigTag) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/ { int passPhrasePipe[2]; @@ -1135,7 +1135,7 @@ static inline unsigned char nibble(char c) static rpmRC verifyPGPSignature(rpmts ts, /*@out@*/ char * t, /*@null@*/ DIGEST_CTX md5ctx) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, *t, rpmGlobalMacroContext, fileSystem, internalState */ { const void * sig = rpmtsSig(ts); @@ -1255,7 +1255,7 @@ exit: static rpmRC verifyGPGSignature(rpmts ts, /*@out@*/ char * t, /*@null@*/ DIGEST_CTX sha1ctx) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, *t, rpmGlobalMacroContext, fileSystem, internalState */ { const void * sig = rpmtsSig(ts); diff --git a/lib/signature.h b/lib/signature.h index 9c4ca2067..036af89fc 100644 --- a/lib/signature.h +++ b/lib/signature.h @@ -71,7 +71,7 @@ int rpmWriteSignature(FD_t fd, Header h) */ int rpmAddSignature(Header sig, const char * file, int_32 sigTag, /*@null@*/ const char * passPhrase) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies sig, rpmGlobalMacroContext, fileSystem, internalState @*/; /******************************************************************/ @@ -89,7 +89,7 @@ int rpmAddSignature(Header sig, const char * file, * @return sigTag to use, 0 if none, -1 on error */ int rpmLookupSignatureType(int action) - /*@globals rpmGlobalMacroContext, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, internalState @*/ /*@modifies rpmGlobalMacroContext, internalState @*/; /** \ingroup signature @@ -101,7 +101,7 @@ int rpmLookupSignatureType(int action) /*@dependent@*/ /*@null@*/ char * rpmGetPassPhrase(/*@null@*/ const char * prompt, const int sigTag) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/; /** \ingroup signature @@ -112,7 +112,7 @@ char * rpmGetPassPhrase(/*@null@*/ const char * prompt, /*@-exportlocal -redecl@*/ /*@null@*/ const char * rpmDetectPGPVersion( /*@null@*/ /*@out@*/ pgpVersion * pgpVer) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies *pgpVer, rpmGlobalMacroContext @*/; /*@=exportlocal =redecl@*/ diff --git a/lib/transaction.c b/lib/transaction.c index d019de475..f99c81217 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -84,7 +84,7 @@ static int sharedCmp(const void * one, const void * two) /*@-boundsread@*/ static fileAction decideFileFate(const rpmts ts, const rpmfi ofi, rpmfi nfi) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies nfi, fileSystem, internalState @*/ { const char * fn = rpmfiFN(nfi); @@ -210,7 +210,7 @@ static int handleInstInstalledFiles(const rpmts ts, rpmte p, rpmfi fi, sharedFileInfo shared, int sharedCount, int reportConflicts) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, fi, rpmGlobalMacroContext, fileSystem, internalState @*/ { uint_32 tscolor = rpmtsColor(ts); @@ -322,7 +322,7 @@ static int handleInstInstalledFiles(const rpmts ts, /* XXX only ts->rpmdb modified */ static int handleRmvdInstalledFiles(const rpmts ts, rpmfi fi, sharedFileInfo shared, int sharedCount) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, fi, rpmGlobalMacroContext, fileSystem, internalState @*/ { HGE_t hge = fi->hge; @@ -515,7 +515,7 @@ bingoFps->baseName); /* XXX only ts->{probs,di} modified */ static void handleOverlappedFiles(const rpmts ts, const rpmte p, rpmfi fi) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies ts, fi, fileSystem, internalState @*/ { uint_32 fixupSize = 0; @@ -748,7 +748,7 @@ static int ensureOlder(rpmts ts, /*@-mustmod@*/ /* FIX: fi->actions is modified. */ /*@-bounds@*/ static void skipFiles(const rpmts ts, rpmfi fi) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies fi, rpmGlobalMacroContext @*/ { uint_32 tscolor = rpmtsColor(ts); diff --git a/lib/verify.c b/lib/verify.c index 36af08cc6..d4c1155cf 100644 --- a/lib/verify.c +++ b/lib/verify.c @@ -217,7 +217,7 @@ int rpmVerifyFile(const rpmts ts, const rpmfi fi, */ static int rpmVerifyScript(/*@unused@*/ QVA_t qva, rpmts ts, rpmfi fi, /*@null@*/ FD_t scriptFd) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, fi, scriptFd, rpmGlobalMacroContext, fileSystem, internalState @*/ { @@ -251,7 +251,7 @@ static int rpmVerifyScript(/*@unused@*/ QVA_t qva, rpmts ts, * @return 0 no problems, 1 problems found */ static int verifyHeader(QVA_t qva, const rpmts ts, rpmfi fi) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fi, fileSystem, internalState @*/ { char buf[BUFSIZ]; @@ -362,7 +362,7 @@ static int verifyHeader(QVA_t qva, const rpmts ts, rpmfi fi) */ static int verifyDependencies(/*@unused@*/ QVA_t qva, rpmts ts, Header h) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies ts, h, rpmGlobalMacroContext, fileSystem, internalState @*/ { rpmps ps; diff --git a/rpmdb/.splintrc b/rpmdb/.splintrc index baa53e40c..6a7ed8ff0 100644 --- a/rpmdb/.splintrc +++ b/rpmdb/.splintrc @@ -3,7 +3,7 @@ +partial +forcehints --warnunixlib +#-warnunixlib -warnposix +unixlib diff --git a/rpmdb/fprint.h b/rpmdb/fprint.h index 0012d4b5e..79bb7e443 100644 --- a/rpmdb/fprint.h +++ b/rpmdb/fprint.h @@ -75,7 +75,7 @@ extern "C" { */ int rpmdbFindFpList(/*@null@*/ rpmdb db, fingerPrint * fpList, /*@out@*/ dbiIndexSet * matchList, int numItems) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies db, *matchList, rpmGlobalMacroContext, fileSystem, internalState @*/; diff --git a/rpmdb/legacy.c b/rpmdb/legacy.c index 715d2f2e4..ee7f637bd 100644 --- a/rpmdb/legacy.c +++ b/rpmdb/legacy.c @@ -34,7 +34,7 @@ * @return -1 on error, otherwise, an open file descriptor */ static int open_dso(const char * path, /*@null@*/ pid_t * pidp, /*@null@*/ size_t *fsizep) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies *pidp, *fsizep, rpmGlobalMacroContext, fileSystem, internalState @*/ { diff --git a/rpmdb/legacy.h b/rpmdb/legacy.h index 5a4fcd914..adde0a67c 100644 --- a/rpmdb/legacy.h +++ b/rpmdb/legacy.h @@ -27,7 +27,7 @@ extern "C" { */ int domd5(const char * fn, /*@out@*/ unsigned char * digest, int asAscii, /*@null@*/ /*@out@*/ size_t *fsizep) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies digest, *fsizep, fileSystem, internalState @*/; /** diff --git a/rpmdb/rpmdb.c b/rpmdb/rpmdb.c index 946d7d262..486becf0f 100644 --- a/rpmdb/rpmdb.c +++ b/rpmdb/rpmdb.c @@ -170,10 +170,11 @@ static int dbiTagToDbix(int rpmtag) * Initialize database (index, tag) tuple from configuration. */ static void dbiTagsInit(void) - /*@globals rpmGlobalMacroContext, dbiTags, dbiTagsMax @*/ - /*@modifies rpmGlobalMacroContext, dbiTags, dbiTagsMax @*/ + /*@globals dbiTags, dbiTagsMax, rpmGlobalMacroContext, h_errno @*/ + /*@modifies dbiTags, dbiTagsMax, rpmGlobalMacroContext @*/ { -/*@observer@*/ static const char * const _dbiTagStr_default = +/*@observer@*/ + static const char * const _dbiTagStr_default = "Packages:Name:Basenames:Group:Requirename:Providename:Conflictname:Triggername:Dirnames:Requireversion:Provideversion:Installtid:Sigmd5:Sha1header:Filemd5s:Depends:Pubkeys"; char * dbiTagStr = NULL; char * o, * oe; @@ -880,7 +881,7 @@ static /*@only@*/ /*@null@*/ rpmdb newRpmdb(/*@kept@*/ /*@null@*/ const char * root, /*@kept@*/ /*@null@*/ const char * home, int mode, int perms, int flags) - /*@globals _db_filter_dups, rpmGlobalMacroContext @*/ + /*@globals _db_filter_dups, rpmGlobalMacroContext, h_errno @*/ /*@modifies _db_filter_dups, rpmGlobalMacroContext @*/ { rpmdb db = xcalloc(sizeof(*db), 1); @@ -933,7 +934,7 @@ static int openDatabase(/*@null@*/ const char * prefix, /*@null@*/ const char * dbpath, int _dbapi, /*@null@*/ /*@out@*/ rpmdb *dbp, int mode, int perms, int flags) - /*@globals rpmdbRock, rpmGlobalMacroContext, + /*@globals rpmdbRock, rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies rpmdbRock, *dbp, rpmGlobalMacroContext, fileSystem, internalState @*/ @@ -1128,7 +1129,7 @@ int rpmdbVerify(const char * prefix) */ static int rpmdbFindByFile(rpmdb db, /*@null@*/ const char * filespec, DBT * key, DBT * data, /*@out@*/ dbiIndexSet * matches) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies db, *key, *data, *matches, rpmGlobalMacroContext, fileSystem, internalState @*/ /*@requires maxSet(matches) >= 0 @*/ @@ -1344,7 +1345,7 @@ static rpmRC dbiFindMatches(dbiIndex dbi, DBC * dbcursor, /*@null@*/ const char * version, /*@null@*/ const char * release, /*@out@*/ dbiIndexSet * matches) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies dbi, *dbcursor, *key, *data, *matches, rpmGlobalMacroContext, fileSystem, internalState @*/ /*@requires maxSet(matches) >= 0 @*/ @@ -1440,7 +1441,7 @@ exit: */ static rpmRC dbiFindByLabel(dbiIndex dbi, DBC * dbcursor, DBT * key, DBT * data, /*@null@*/ const char * arg, /*@out@*/ dbiIndexSet * matches) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies dbi, *dbcursor, *key, *data, *matches, rpmGlobalMacroContext, fileSystem, internalState @*/ /*@requires maxSet(matches) >= 0 @*/ @@ -2279,7 +2280,7 @@ static void rpmdbSortIterator(/*@null@*/ rpmdbMatchIterator mi) /*@-bounds@*/ /* LCL: segfault */ static int rpmdbGrowIterator(/*@null@*/ rpmdbMatchIterator mi, int fpNum) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies mi, rpmGlobalMacroContext, fileSystem, internalState @*/ { DBC * dbcursor; @@ -3377,7 +3378,7 @@ if (key->size == 0) key->size++; /* XXX "/" fixup. */ * @return 1 if file exists, 0 if not */ static int rpmioFileExists(const char * urlfn) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fileSystem, internalState @*/ { const char *fn; @@ -3411,7 +3412,7 @@ static int rpmioFileExists(const char * urlfn) static int rpmdbRemoveDatabase(const char * prefix, const char * dbpath, int _dbapi) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fileSystem, internalState @*/ { int i; @@ -3468,7 +3469,7 @@ static int rpmdbRemoveDatabase(const char * prefix, static int rpmdbMoveDatabase(const char * prefix, const char * olddbpath, int _olddbapi, const char * newdbpath, int _newdbapi) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fileSystem, internalState @*/ { int i; diff --git a/rpmdb/rpmdb.h b/rpmdb/rpmdb.h index afb460931..d756b6d90 100644 --- a/rpmdb/rpmdb.h +++ b/rpmdb/rpmdb.h @@ -462,7 +462,7 @@ extern "C" { */ /*@unused@*/ /*@only@*/ /*@null@*/ dbiIndex db3New(rpmdb rpmdb, rpmTag rpmtag) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies rpmGlobalMacroContext @*/; /** \ingroup db3 @@ -495,7 +495,7 @@ extern const char *const prDbiOpenFlags(int dbflags, int print_dbenv_flags) */ /*@only@*/ /*@null@*/ dbiIndex dbiOpen(/*@null@*/ rpmdb db, rpmTag rpmtag, unsigned int flags) - /*@globals rpmGlobalMacroContext, errno @*/ + /*@globals rpmGlobalMacroContext, errno, h_errno @*/ /*@modifies db, rpmGlobalMacroContext, errno @*/; /*@-globuse -mustmod @*/ /* FIX: vector annotations */ @@ -860,7 +860,7 @@ rpmdb XrpmdbLink (rpmdb db, const char * msg, */ int rpmdbOpen (/*@null@*/ const char * prefix, /*@null@*/ /*@out@*/ rpmdb * dbp, int mode, int perms) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies *dbp, rpmGlobalMacroContext, fileSystem, internalState @*/; /** \ingroup rpmdb @@ -870,7 +870,7 @@ int rpmdbOpen (/*@null@*/ const char * prefix, /*@null@*/ /*@out@*/ rpmdb * dbp, * @return 0 on success */ int rpmdbInit(/*@null@*/ const char * prefix, int perms) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/; /** \ingroup rpmdb @@ -879,7 +879,7 @@ int rpmdbInit(/*@null@*/ const char * prefix, int perms) * @return 0 on success */ int rpmdbVerify(/*@null@*/ const char * prefix) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/; /** @@ -917,7 +917,7 @@ int rpmdbSync (/*@null@*/ rpmdb db) */ /*@-exportlocal@*/ int rpmdbOpenAll (/*@null@*/ rpmdb db) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies db, rpmGlobalMacroContext @*/; /*@=exportlocal@*/ @@ -928,7 +928,7 @@ int rpmdbOpenAll (/*@null@*/ rpmdb db) * @return number of instances */ int rpmdbCountPackages(/*@null@*/ rpmdb db, const char * name) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/; /** \ingroup rpmdb @@ -981,7 +981,7 @@ int rpmdbPruneIterator(/*@null@*/ rpmdbMatchIterator mi, */ int rpmdbSetIteratorRE(/*@null@*/ rpmdbMatchIterator mi, rpmTag tag, rpmMireMode mode, /*@null@*/ const char * pattern) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies mi, mode, rpmGlobalMacroContext @*/; /** \ingroup rpmdb @@ -1025,7 +1025,7 @@ int rpmdbSetHdrChk(/*@null@*/ rpmdbMatchIterator mi, /*@null@*/ rpmts ts, /*@only@*/ /*@null@*/ rpmdbMatchIterator rpmdbInitIterator(/*@null@*/ rpmdb db, rpmTag rpmtag, /*@null@*/ const void * keyp, size_t keylen) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/; /** \ingroup rpmdb @@ -1035,7 +1035,7 @@ rpmdbMatchIterator rpmdbInitIterator(/*@null@*/ rpmdb db, rpmTag rpmtag, */ /*@null@*/ Header rpmdbNextIterator(/*@null@*/ rpmdbMatchIterator mi) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies mi, rpmGlobalMacroContext, fileSystem, internalState @*/; /** \ingroup rpmdb @@ -1053,7 +1053,7 @@ int rpmdbCheckSignals(void) */ /*@null@*/ rpmdbMatchIterator rpmdbFreeIterator(/*@only@*/ /*@null@*/rpmdbMatchIterator mi) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies mi, rpmGlobalMacroContext, fileSystem, internalState @*/; /** \ingroup rpmdb @@ -1067,7 +1067,7 @@ rpmdbMatchIterator rpmdbFreeIterator(/*@only@*/ /*@null@*/rpmdbMatchIterator mi) */ int rpmdbAdd(/*@null@*/ rpmdb db, int iid, Header h, /*@null@*/ rpmts ts, /*@null@*/ rpmRC (*hdrchk) (rpmts ts, const void *uh, size_t uc, const char ** msg)) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies db, h, rpmGlobalMacroContext, fileSystem, internalState @*/; /** \ingroup rpmdb @@ -1082,7 +1082,7 @@ int rpmdbAdd(/*@null@*/ rpmdb db, int iid, Header h, /*@null@*/ rpmts ts, int rpmdbRemove(/*@null@*/ rpmdb db, /*@unused@*/ int rid, unsigned int hdrNum, /*@null@*/ rpmts ts, /*@null@*/ rpmRC (*hdrchk) (rpmts ts, const void *uh, size_t uc, const char ** msg)) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies db, rpmGlobalMacroContext, fileSystem, internalState @*/; /** \ingroup rpmdb @@ -1094,7 +1094,7 @@ int rpmdbRemove(/*@null@*/ rpmdb db, /*@unused@*/ int rid, unsigned int hdrNum, */ int rpmdbRebuild(/*@null@*/ const char * prefix, /*@null@*/ rpmts ts, /*@null@*/ rpmRC (*hdrchk) (rpmts ts, const void *uh, size_t uc, const char ** msg)) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/; /** diff --git a/rpmio/macro.c b/rpmio/macro.c index cfa7c3351..27f6415e6 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -114,7 +114,7 @@ int print_expand_trace = 0; /* forward ref */ static int expandMacro(MacroBuf mb) /*@globals rpmGlobalMacroContext, - print_macro_trace, print_expand_trace, fileSystem @*/ + print_macro_trace, print_expand_trace, h_errno, fileSystem @*/ /*@modifies mb, rpmGlobalMacroContext, print_macro_trace, print_expand_trace, fileSystem @*/; @@ -492,7 +492,7 @@ printExpansion(MacroBuf mb, const char * t, const char * te) */ static int expandT(MacroBuf mb, const char * f, size_t flen) - /*@globals rpmGlobalMacroContext, fileSystem@*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem@*/ /*@modifies mb, rpmGlobalMacroContext, fileSystem @*/ { char *sbuf; @@ -546,7 +546,7 @@ expandS(MacroBuf mb, char * tbuf, size_t tbuflen) /*@-boundswrite@*/ static int expandU(MacroBuf mb, char * u, size_t ulen) - /*@globals rpmGlobalMacroContext, fileSystem@*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem@*/ /*@modifies mb, *u, rpmGlobalMacroContext, fileSystem @*/ { const char *s = mb->s; @@ -585,7 +585,7 @@ expandU(MacroBuf mb, char * u, size_t ulen) /*@-boundswrite@*/ static int doShellEscape(MacroBuf mb, const char * cmd, size_t clen) - /*@globals rpmGlobalMacroContext, fileSystem @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem @*/ /*@modifies mb, rpmGlobalMacroContext, fileSystem @*/ { char pcmd[BUFSIZ]; @@ -624,7 +624,7 @@ doShellEscape(MacroBuf mb, const char * cmd, size_t clen) */ /*@dependent@*/ static const char * doDefine(MacroBuf mb, /*@returned@*/ const char * se, int level, int expandbody) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies mb, rpmGlobalMacroContext @*/ { const char *s = se; @@ -1032,7 +1032,7 @@ grabArgs(MacroBuf mb, const MacroEntry me, /*@returned@*/ const char * se, char */ static void doOutput(MacroBuf mb, int waserror, const char * msg, size_t msglen) - /*@globals rpmGlobalMacroContext, fileSystem @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem @*/ /*@modifies mb, rpmGlobalMacroContext, fileSystem @*/ { char buf[BUFSIZ]; @@ -1058,7 +1058,7 @@ doOutput(MacroBuf mb, int waserror, const char * msg, size_t msglen) static void doFoo(MacroBuf mb, int negate, const char * f, size_t fn, /*@null@*/ const char * g, size_t gn) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies mb, rpmGlobalMacroContext, fileSystem, internalState @*/ { char buf[BUFSIZ], *b = NULL, *be; @@ -1160,7 +1160,7 @@ doFoo(MacroBuf mb, int negate, const char * f, size_t fn, static int expandMacro(MacroBuf mb) /*@globals rpmGlobalMacroContext, - print_macro_trace, print_expand_trace, fileSystem @*/ + print_macro_trace, print_expand_trace, h_errno, fileSystem @*/ /*@modifies mb, rpmGlobalMacroContext, print_macro_trace, print_expand_trace, fileSystem @*/ { diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c index 8d80138a8..b4a027fe8 100644 --- a/rpmio/rpmio.c +++ b/rpmio/rpmio.c @@ -1,4 +1,3 @@ -/*@-type@*/ /* LCL: function typedefs */ /** \ingroup rpmio * \file rpmio/rpmio.c */ @@ -15,18 +14,6 @@ #if HAVE_NETINET_IN_SYSTM_H # include <sys/types.h> - -#if defined(__LCLINT__) -/*@-redef@*/ /* FIX: rpmdb/db3.c also declares */ -typedef unsigned int u_int32_t; -typedef unsigned short u_int16_t; -typedef unsigned char u_int8_t; -/*@-incondefs@*/ /* LCLint 3.0.0.15 */ -typedef int int32_t; -/*@=incondefs@*/ -/*@=redef@*/ -#endif - # include <netinet/in_systm.h> #endif @@ -34,7 +21,8 @@ typedef int int32_t; #define _USE_LIBIO 1 #endif -#if !defined(HAVE_HERRNO) && defined(__hpux) /* XXX HP-UX w/o -D_XOPEN_SOURCE needs */ +/* XXX HP-UX w/o -D_XOPEN_SOURCE needs */ +#if !defined(HAVE_HERRNO) && (defined(__hpux) || defined(__LCLINT__)) /*@unchecked@*/ extern int h_errno; #endif @@ -67,15 +55,20 @@ static int inet_aton(const char *cp, struct in_addr *inp) #include <rpmio_internal.h> #undef fdFileno #undef fdOpen +#define fdOpen __fdOpen #undef fdRead +#define fdRead __fdRead #undef fdWrite +#define fdWrite __fdWrite #undef fdClose +#define fdClose __fdClose #include "ugid.h" #include "rpmmessages.h" #include "debug.h" +/*@access FILE @*/ /* XXX to permit comparison/conversion with void *. */ /*@access urlinfo @*/ /*@access FDSTAT_t @*/ @@ -138,7 +131,6 @@ _free(/*@only@*/ /*@null@*/ /*@out@*/ const void * p) /* =============================================================== */ /*@-boundswrite@*/ -/*@-modfilesys@*/ static /*@observer@*/ const char * fdbg(/*@null@*/ FD_t fd) /*@*/ { @@ -176,8 +168,6 @@ static /*@observer@*/ const char * fdbg(/*@null@*/ FD_t fd) sprintf(be, "FD %d fp %p", fps->fdno, fps->fp); } else if (fps->io == ufdio) { sprintf(be, "UFD %d fp %p", fps->fdno, fps->fp); - } else if (fps->io == fadio) { - sprintf(be, "FAD %d fp %p", fps->fdno, fps->fp); } else if (fps->io == gzdio) { sprintf(be, "GZD %p fdno %d", fps->fp, fps->fdno); #if HAVE_BZLIB_H @@ -199,7 +189,6 @@ static /*@observer@*/ const char * fdbg(/*@null@*/ FD_t fd) } return buf; } -/*@=modfilesys@*/ /*@=boundswrite@*/ /* =============================================================== */ @@ -237,9 +226,7 @@ FD_t fdDup(int fdno) return NULL; fd = fdNew("open (fdDup)"); fdSetFdno(fd, nfdno); -/*@-modfilesys@*/ DBGIO(fd, (stderr, "==> fdDup(%d) fd %p %s\n", fdno, (fd ? fd : NULL), fdbg(fd))); -/*@=modfilesys@*/ /*@-refcounttrans@*/ return fd; /*@=refcounttrans@*/ } @@ -263,16 +250,13 @@ FILE *fdFdopen(void * cookie, const char *fmode) fdno = fdFileno(fd); if (fdno < 0) return NULL; fp = fdopen(fdno, fmode); -/*@-modfilesys@*/ DBGIO(fd, (stderr, "==> fdFdopen(%p,\"%s\") fdno %d -> fp %p fdno %d\n", cookie, fmode, fdno, fp, fileno(fp))); -/*@=modfilesys@*/ fd = fdFree(fd, "open (fdFdopen)"); return fp; } #endif /* =============================================================== */ -/*@-modfilesys@*/ /*@-mustmod@*/ /* FIX: cookie is modified */ static inline /*@null@*/ FD_t XfdLink(void * cookie, const char * msg, const char * file, unsigned line) @@ -291,9 +275,7 @@ DBGREFS(fd, (stderr, "--> fd %p ++ %d %s at %s:%u %s\n", fd, fd->nrefs, msg, fi return fd; } /*@=mustmod@*/ -/*@=modfilesys@*/ -/*@-modfilesys@*/ static inline /*@null@*/ FD_t XfdFree( /*@killref@*/ FD_t fd, const char *msg, const char *file, unsigned line) @@ -321,7 +303,6 @@ DBGREFS(fd, (stderr, "--> fd %p -- %d %s at %s:%u %s\n", fd, fd->nrefs, msg, fi } return NULL; } -/*@=modfilesys@*/ static inline /*@null@*/ FD_t XfdNew(const char * msg, const char * file, unsigned line) @@ -339,9 +320,7 @@ FD_t XfdNew(const char * msg, const char * file, unsigned line) fd->nfps = 0; memset(fd->fps, 0, sizeof(fd->fps)); - /*@-assignexpose@*/ fd->fps[0].io = fdio; - /*@=assignexpose@*/ fd->fps[0].fp = NULL; fd->fps[0].fdno = -1; @@ -364,9 +343,11 @@ FD_t XfdNew(const char * msg, const char * file, unsigned line) return XfdLink(fd, msg, file, line); } -/*@-redef@*/ /* FIX: legacy API should be made static */ -ssize_t fdRead(void * cookie, /*@out@*/ char * buf, size_t count) -/*@=redef@*/ +static ssize_t fdRead(void * cookie, /*@out@*/ char * buf, size_t count) + /*@globals errno, fileSystem, internalState @*/ + /*@modifies *buf, errno, fileSystem, internalState @*/ + /*@requires maxSet(buf) >= (count - 1) @*/ + /*@ensures maxRead(buf) == result @*/ { FD_t fd = c2f(cookie); ssize_t rc; @@ -381,16 +362,14 @@ ssize_t fdRead(void * cookie, /*@out@*/ char * buf, size_t count) if (fd->ndigests && rc > 0) fdUpdateDigests(fd, buf, rc); -/*@-modfilesys@*/ DBGIO(fd, (stderr, "==>\tfdRead(%p,%p,%ld) rc %ld %s\n", cookie, buf, (long)count, (long)rc, fdbg(fd))); -/*@=modfilesys@*/ return rc; } -/*@-redef@*/ /* FIX: legacy API should be made static */ -ssize_t fdWrite(void * cookie, const char * buf, size_t count) -/*@=redef@*/ +static ssize_t fdWrite(void * cookie, const char * buf, size_t count) + /*@globals errno, fileSystem, internalState @*/ + /*@modifies errno, fileSystem, internalState @*/ { FD_t fd = c2f(cookie); int fdno = fdFileno(fd); @@ -422,9 +401,7 @@ ssize_t fdWrite(void * cookie, const char * buf, size_t count) if (ec == -1) fd->syserrno = errno; } -/*@-modfilesys@*/ DBGIO(fd, (stderr, "==>\tfdWrite(%p,%p,%ld) rc %ld %s\n", cookie, buf, (long)count, (long)rc, fdbg(fd))); -/*@=modfilesys@*/ return rc; } @@ -446,16 +423,14 @@ static inline int fdSeek(void * cookie, _libio_pos_t pos, int whence) rc = lseek(fdFileno(fd), p, whence); fdstat_exit(fd, FDSTAT_SEEK, rc); -/*@-modfilesys@*/ DBGIO(fd, (stderr, "==>\tfdSeek(%p,%ld,%d) rc %lx %s\n", cookie, (long)p, whence, (unsigned long)rc, fdbg(fd))); -/*@=modfilesys@*/ return rc; } -/*@-redef@*/ /* FIX: legacy API should be made static */ -int fdClose( /*@only@*/ void * cookie) -/*@=redef@*/ +static int fdClose( /*@only@*/ void * cookie) + /*@globals errno, fileSystem, systemState, internalState @*/ + /*@modifies errno, fileSystem, systemState, internalState @*/ { FD_t fd; int fdno; @@ -471,17 +446,15 @@ int fdClose( /*@only@*/ void * cookie) rc = ((fdno >= 0) ? close(fdno) : -2); fdstat_exit(fd, FDSTAT_CLOSE, rc); -/*@-modfilesys@*/ DBGIO(fd, (stderr, "==>\tfdClose(%p) rc %lx %s\n", (fd ? fd : NULL), (unsigned long)rc, fdbg(fd))); -/*@=modfilesys@*/ fd = fdFree(fd, "open (fdClose)"); return rc; } -/*@-redef@*/ /* FIX: legacy API should be made static */ -/*@null@*/ FD_t fdOpen(const char *path, int flags, mode_t mode) -/*@=redef@*/ +/*@null@*/ static FD_t fdOpen(const char *path, int flags, mode_t mode) + /*@globals errno, fileSystem, internalState @*/ + /*@modifies errno, fileSystem, internalState @*/ { FD_t fd; int fdno; @@ -495,22 +468,18 @@ DBGIO(fd, (stderr, "==>\tfdClose(%p) rc %lx %s\n", (fd ? fd : NULL), (unsigned l fd = fdNew("open (fdOpen)"); fdSetFdno(fd, fdno); fd->flags = flags; -/*@-modfilesys@*/ DBGIO(fd, (stderr, "==>\tfdOpen(\"%s\",%x,0%o) %s\n", path, (unsigned)flags, (unsigned)mode, fdbg(fd))); -/*@=modfilesys@*/ /*@-refcounttrans@*/ return fd; /*@=refcounttrans@*/ } +/*@-type@*/ /* LCL: function typedefs */ static struct FDIO_s fdio_s = { fdRead, fdWrite, fdSeek, fdClose, XfdLink, XfdFree, XfdNew, fdFileno, fdOpen, NULL, fdGetFp, NULL, mkdir, chdir, rmdir, rename, unlink }; +/*@=type@*/ FDIO_t fdio = /*@-compmempass@*/ &fdio_s /*@=compmempass@*/ ; -/*@-redef@*/ /* see lib/falloc.c */ -FDIO_t fadio; /* XXX usually NULL, filled in when linked with rpm */ -/*@=redef@*/ - int fdWritable(FD_t fd, int secs) { int fdno; @@ -726,21 +695,18 @@ const char *urlStrerror(const char *url) #if !defined(USE_ALT_DNS) || !USE_ALT_DNS static int mygethostbyname(const char * host, /*@out@*/ struct in_addr * address) + /*@globals h_errno @*/ /*@modifies *address @*/ { struct hostent * hostinfo; - /*@-unrecog -multithreaded @*/ - /*@-globs@*/ /* FIX: h_errno access */ + /*@-multithreaded @*/ hostinfo = gethostbyname(host); - /*@=globs@*/ - /*@=unrecog =multithreaded @*/ + /*@=multithreaded @*/ if (!hostinfo) return 1; /*@-boundswrite@*/ - /*@-nullderef@*/ memcpy(address, hostinfo->h_addr_list[0], sizeof(*address)); - /*@=nullderef@*/ /*@=boundswrite@*/ return 0; } @@ -749,29 +715,27 @@ static int mygethostbyname(const char * host, /*@-boundsread@*/ /*@-compdef@*/ /* FIX: address->s_addr undefined. */ static int getHostAddress(const char * host, /*@out@*/ struct in_addr * address) - /*@globals errno @*/ + /*@globals errno, h_errno @*/ /*@modifies *address, errno @*/ { #if 0 /* XXX workaround nss_foo module hand-off using valgrind. */ if (!strcmp(host, "localhost")) { - /*@-unrecog -moduncon @*/ + /*@-moduncon @*/ if (!inet_aton("127.0.0.1", address)) return FTPERR_BAD_HOST_ADDR; - /*@=unrecog =moduncon @*/ + /*@=moduncon @*/ } else #endif if (xisdigit(host[0])) { - /*@-unrecog -moduncon @*/ + /*@-moduncon @*/ if (!inet_aton(host, address)) return FTPERR_BAD_HOST_ADDR; - /*@=unrecog =moduncon @*/ + /*@=moduncon @*/ } else { - /*@-globs@*/ /* FIX: h_errno access */ if (mygethostbyname(host, address)) { - errno = /*@-unrecog@*/ h_errno /*@=unrecog@*/; + errno = h_errno; return FTPERR_BAD_HOSTNAME; } - /*@=globs@*/ } return 0; @@ -780,7 +744,7 @@ static int getHostAddress(const char * host, /*@out@*/ struct in_addr * address) /*@=boundsread@*/ static int tcpConnect(FD_t ctrl, const char * host, int port) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies ctrl, fileSystem, internalState @*/ { struct sockaddr_in sin; @@ -1065,7 +1029,7 @@ fprintf(stderr, "-> %s", t); } static int ftpLogin(urlinfo u) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies u, fileSystem, internalState @*/ { const char * host; @@ -1355,10 +1319,8 @@ int ufdCopy(FD_t sfd, FD_t tfd) } } -/*@-modfilesys@*/ DBGIO(sfd, (stderr, "++ copied %d bytes: %s\n", itemsCopied, ftpStrerror(rc))); -/*@=modfilesys@*/ if (urlNotify) { /*@-boundsread@*/ @@ -1373,7 +1335,7 @@ int ufdCopy(FD_t sfd, FD_t tfd) } static int urlConnect(const char * url, /*@out@*/ urlinfo * uret) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies *uret, fileSystem, internalState @*/ { urlinfo u; @@ -1480,9 +1442,7 @@ static int ftpAbort(urlinfo u, FD_t data) } ctrl = u->ctrl; -/*@-modfilesys@*/ DBGIO(0, (stderr, "-> ABOR\n")); -/*@=modfilesys@*/ /*@-usereleased -compdef@*/ if (send(fdFileno(ctrl), ipbuf, sizeof(ipbuf), MSG_OOB) != sizeof(ipbuf)) { @@ -1569,7 +1529,7 @@ fprintf(stderr, "*** httpResp: rc %d ec %d\n", rc, ec); } static int httpReq(FD_t ctrl, const char * httpCmd, const char * httpArg) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies ctrl, fileSystem, internalState @*/ { urlinfo u = ctrl->url; @@ -2013,7 +1973,7 @@ exit: /*@-nullstate@*/ /* FIX: u->{ctrl,data}->url undef after XurlLink. */ static /*@null@*/ FD_t httpOpen(const char * url, /*@unused@*/ int flags, /*@unused@*/ mode_t mode, /*@out@*/ urlinfo * uret) - /*@globals internalState @*/ + /*@globals h_errno, internalState @*/ /*@modifies *uret, internalState @*/ { urlinfo u = NULL; @@ -2059,7 +2019,7 @@ exit: /*@=nullstate@*/ static /*@null@*/ FD_t ufdOpen(const char * url, int flags, mode_t mode) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fileSystem, internalState @*/ { FD_t fd = NULL; @@ -2142,16 +2102,16 @@ fprintf(stderr, "*** ufdOpen(%s,0x%x,0%o)\n", url, (unsigned)flags, (unsigned)mo (void) ufdClose(fd); return NULL; } -/*@-modfilesys@*/ DBGIO(fd, (stderr, "==>\tufdOpen(\"%s\",%x,0%o) %s\n", url, (unsigned)flags, (unsigned)mode, fdbg(fd))); -/*@=modfilesys@*/ return fd; } +/*@-type@*/ /* LCL: function typedefs */ static struct FDIO_s ufdio_s = { ufdRead, ufdWrite, ufdSeek, ufdClose, XfdLink, XfdFree, XfdNew, fdFileno, ufdOpen, NULL, fdGetFp, NULL, Mkdir, Chdir, Rmdir, Rename, Unlink }; +/*@=type@*/ FDIO_t ufdio = /*@-compmempass@*/ &ufdio_s /*@=compmempass@*/ ; /* =============================================================== */ @@ -2190,26 +2150,23 @@ FD_t gzdOpen(const char * path, const char * fmode) /*@modifies fileSystem, internalState @*/ { FD_t fd; - gzFile *gzfile; + gzFile gzfile; if ((gzfile = gzopen(path, fmode)) == NULL) return NULL; fd = fdNew("open (gzdOpen)"); fdPop(fd); fdPush(fd, gzdio, gzfile, -1); -/*@-modfilesys@*/ DBGIO(fd, (stderr, "==>\tgzdOpen(\"%s\", \"%s\") fd %p %s\n", path, fmode, (fd ? fd : NULL), fdbg(fd))); -/*@=modfilesys@*/ return fdLink(fd, "gzdOpen"); } -/*@-globuse@*/ static /*@null@*/ FD_t gzdFdopen(void * cookie, const char *fmode) /*@globals fileSystem, internalState @*/ /*@modifies fileSystem, internalState @*/ { FD_t fd = c2f(cookie); int fdno; - gzFile *gzfile; + gzFile gzfile; if (fmode == NULL) return NULL; fdno = fdFileno(fd); @@ -2222,28 +2179,24 @@ static /*@null@*/ FD_t gzdFdopen(void * cookie, const char *fmode) return fdLink(fd, "gzdFdopen"); } -/*@=globuse@*/ -/*@-globuse@*/ static int gzdFlush(FD_t fd) /*@globals fileSystem @*/ /*@modifies fileSystem @*/ { - gzFile *gzfile; + gzFile gzfile; gzfile = gzdFileno(fd); if (gzfile == NULL) return -2; return gzflush(gzfile, Z_SYNC_FLUSH); /* XXX W2DO? */ } -/*@=globuse@*/ /* =============================================================== */ -/*@-mustmod@*/ /* LCL: *buf is modified */ static ssize_t gzdRead(void * cookie, /*@out@*/ char * buf, size_t count) /*@globals fileSystem, internalState @*/ /*@modifies *buf, fileSystem, internalState @*/ { FD_t fd = c2f(cookie); - gzFile *gzfile; + gzFile gzfile; ssize_t rc; if (fd == NULL || fd->bytesRemain == 0) return 0; /* XXX simulate EOF */ @@ -2252,12 +2205,8 @@ static ssize_t gzdRead(void * cookie, /*@out@*/ char * buf, size_t count) if (gzfile == NULL) return -2; /* XXX can't happen */ fdstat_enter(fd, FDSTAT_READ); - /*@-compdef@*/ /* LCL: *buf is undefined */ rc = gzread(gzfile, buf, count); -/*@-modfilesys@*/ DBGIO(fd, (stderr, "==>\tgzdRead(%p,%p,%u) rc %lx %s\n", cookie, buf, (unsigned)count, (unsigned long)rc, fdbg(fd))); -/*@=modfilesys@*/ - /*@=compdef@*/ if (rc < 0) { int zerror = 0; fd->errcookie = gzerror(gzfile, &zerror); @@ -2267,20 +2216,17 @@ DBGIO(fd, (stderr, "==>\tgzdRead(%p,%p,%u) rc %lx %s\n", cookie, buf, (unsigned) } } else if (rc >= 0) { fdstat_exit(fd, FDSTAT_READ, rc); - /*@-compdef@*/ if (fd->ndigests && rc > 0) fdUpdateDigests(fd, buf, rc); - /*@=compdef@*/ } return rc; } -/*@=mustmod@*/ static ssize_t gzdWrite(void * cookie, const char * buf, size_t count) /*@globals fileSystem, internalState @*/ /*@modifies fileSystem, internalState @*/ { FD_t fd = c2f(cookie); - gzFile *gzfile; + gzFile gzfile; ssize_t rc; if (fd == NULL || fd->bytesRemain == 0) return 0; /* XXX simulate EOF */ @@ -2292,9 +2238,7 @@ static ssize_t gzdWrite(void * cookie, const char * buf, size_t count) fdstat_enter(fd, FDSTAT_WRITE); rc = gzwrite(gzfile, (void *)buf, count); -/*@-modfilesys@*/ DBGIO(fd, (stderr, "==>\tgzdWrite(%p,%p,%u) rc %lx %s\n", cookie, buf, (unsigned)count, (unsigned long)rc, fdbg(fd))); -/*@=modfilesys@*/ if (rc < 0) { int zerror = 0; fd->errcookie = gzerror(gzfile, &zerror); @@ -2321,7 +2265,7 @@ static inline int gzdSeek(void * cookie, _libio_pos_t pos, int whence) int rc; #if HAVE_GZSEEK FD_t fd = c2f(cookie); - gzFile *gzfile; + gzFile gzfile; if (fd == NULL) return -2; assert(fd->bytesRemain == -1); /* XXX FIXME */ @@ -2331,9 +2275,7 @@ static inline int gzdSeek(void * cookie, _libio_pos_t pos, int whence) fdstat_enter(fd, FDSTAT_SEEK); rc = gzseek(gzfile, p, whence); -/*@-modfilesys@*/ DBGIO(fd, (stderr, "==>\tgzdSeek(%p,%ld,%d) rc %lx %s\n", cookie, (long)p, whence, (unsigned long)rc, fdbg(fd))); -/*@=modfilesys@*/ if (rc < 0) { int zerror = 0; fd->errcookie = gzerror(gzfile, &zerror); @@ -2355,7 +2297,7 @@ static int gzdClose( /*@only@*/ void * cookie) /*@modifies fileSystem, internalState @*/ { FD_t fd = c2f(cookie); - gzFile *gzfile; + gzFile gzfile; int rc; gzfile = gzdFileno(fd); @@ -2369,9 +2311,7 @@ static int gzdClose( /*@only@*/ void * cookie) /* XXX TODO: preserve fd if errors */ if (fd) { -/*@-modfilesys@*/ DBGIO(fd, (stderr, "==>\tgzdClose(%p) zerror %d %s\n", cookie, rc, fdbg(fd))); -/*@=modfilesys@*/ if (rc < 0) { fd->errcookie = "gzclose error"; if (rc == Z_ERRNO) { @@ -2383,9 +2323,7 @@ DBGIO(fd, (stderr, "==>\tgzdClose(%p) zerror %d %s\n", cookie, rc, fdbg(fd))); } } -/*@-modfilesys@*/ DBGIO(fd, (stderr, "==>\tgzdClose(%p) rc %lx %s\n", cookie, (unsigned long)rc, fdbg(fd))); -/*@=modfilesys@*/ if (_rpmio_debug || rpmIsDebug()) fdstat_print(fd, "GZDIO", stderr); /*@-branchstate@*/ @@ -2395,10 +2333,12 @@ DBGIO(fd, (stderr, "==>\tgzdClose(%p) rc %lx %s\n", cookie, (unsigned long)rc, f return rc; } +/*@-type@*/ /* LCL: function typedefs */ static struct FDIO_s gzdio_s = { gzdRead, gzdWrite, gzdSeek, gzdClose, XfdLink, XfdFree, XfdNew, fdFileno, NULL, gzdOpen, gzdFileno, gzdFlush, NULL, NULL, NULL, NULL, NULL }; +/*@=type@*/ FDIO_t gzdio = /*@-compmempass@*/ &gzdio_s /*@=compmempass@*/ ; /*@=moduncon@*/ @@ -2585,9 +2525,7 @@ static int bzdClose( /*@only@*/ void * cookie) } } -/*@-modfilesys@*/ DBGIO(fd, (stderr, "==>\tbzdClose(%p) rc %lx %s\n", cookie, (unsigned long)rc, fdbg(fd))); -/*@=modfilesys@*/ if (_rpmio_debug || rpmIsDebug()) fdstat_print(fd, "BZDIO", stderr); /*@-branchstate@*/ @@ -2597,10 +2535,12 @@ DBGIO(fd, (stderr, "==>\tbzdClose(%p) rc %lx %s\n", cookie, (unsigned long)rc, f return rc; } +/*@-type@*/ /* LCL: function typedefs */ static struct FDIO_s bzdio_s = { bzdRead, bzdWrite, bzdSeek, bzdClose, XfdLink, XfdFree, XfdNew, fdFileno, NULL, bzdOpen, bzdFileno, bzdFlush, NULL, NULL, NULL, NULL, NULL }; +/*@=type@*/ FDIO_t bzdio = /*@-compmempass@*/ &bzdio_s /*@=compmempass@*/ ; /*@=moduncon@*/ @@ -2650,9 +2590,7 @@ size_t Fread(void *buf, size_t size, size_t nmemb, FD_t fd) { int rc; FDSANE(fd); -/*@-modfilesys@*/ DBGIO(fd, (stderr, "==> Fread(%p,%u,%u,%p) %s\n", buf, (unsigned)size, (unsigned)nmemb, (fd ? fd : NULL), fdbg(fd))); -/*@=modfilesys@*/ if (fdGetIo(fd) == fpio) { /*@+voidabstract -nullpass@*/ @@ -2675,9 +2613,7 @@ size_t Fwrite(const void *buf, size_t size, size_t nmemb, FD_t fd) int rc; FDSANE(fd); -/*@-modfilesys@*/ DBGIO(fd, (stderr, "==> Fwrite(%p,%u,%u,%p) %s\n", buf, (unsigned)size, (unsigned)nmemb, (fd ? fd : NULL), fdbg(fd))); -/*@=modfilesys@*/ if (fdGetIo(fd) == fpio) { /*@-boundsread@*/ @@ -2708,9 +2644,7 @@ int Fseek(FD_t fd, _libio_off_t offset, int whence) { long int rc; FDSANE(fd); -/*@-modfilesys@*/ DBGIO(fd, (stderr, "==> Fseek(%p,%ld,%d) %s\n", fd, (long)offset, whence, fdbg(fd))); -/*@=modfilesys@*/ if (fdGetIo(fd) == fpio) { FILE *fp; @@ -2735,9 +2669,7 @@ int Fclose(FD_t fd) int rc = 0, ec = 0; FDSANE(fd); -/*@-modfilesys@*/ DBGIO(fd, (stderr, "==> Fclose(%p) %s\n", (fd ? fd : NULL), fdbg(fd))); -/*@=modfilesys@*/ fd = fdLink(fd, "Fclose"); /*@-branchstate@*/ @@ -2928,8 +2860,6 @@ fprintf(stderr, "*** Fdopen(%p,%s) %s\n", fd, fmode, fdbg(fd)); #endif } else if (!strcmp(end, "ufdio")) { iof = ufdio; - } else if (!strcmp(end, "fadio")) { - iof = fadio; } else if (!strcmp(end, "fpio")) { iof = fpio; if (noLibio) { @@ -2973,9 +2903,7 @@ fprintf(stderr, "*** Fdopen fpio fp %p\n", (void *)fp); ciof.seek = iof->seek; ciof.close = iof->close; fp = fopencookie(fd, stdio, ciof); -/*@-modfilesys@*/ DBGIO(fd, (stderr, "==> fopencookie(%p,\"%s\",*%p) returns fp %p\n", fd, stdio, iof, fp)); -/*@=modfilesys@*/ } #endif @@ -2992,9 +2920,7 @@ DBGIO(fd, (stderr, "==> fopencookie(%p,\"%s\",*%p) returns fp %p\n", fd, stdio, /*@=branchstate@*/ } -/*@-modfilesys@*/ DBGIO(fd, (stderr, "==> Fdopen(%p,\"%s\") returns fd %p %s\n", ofd, fmode, (fd ? fd : NULL), fdbg(fd))); -/*@=modfilesys@*/ /*@-refcounttrans -retalias@*/ return fd; /*@=refcounttrans =retalias@*/ } /*@=boundswrite@*/ @@ -3024,14 +2950,6 @@ fprintf(stderr, "*** Fopen fdio path %s fmode %s\n", path, fmode); if (fd) (void) fdClose(fd); return NULL; } - } else if (!strcmp(end, "fadio")) { -if (_rpmio_debug) -fprintf(stderr, "*** Fopen fadio path %s fmode %s\n", path, fmode); - fd = fadio->_open(path, flags, perms); - if (fdFileno(fd) < 0) { - /*@-refcounttrans@*/ (void) fdClose(fd); /*@=refcounttrans@*/ - return NULL; - } } else { FILE *fp; int fdno; @@ -3061,7 +2979,8 @@ fprintf(stderr, "*** Fopen WTFO path %s fmode %s\n", path, fmode); } /* XXX persistent HTTP/1.1 returns the previously opened fp */ - if (isHTTP && ((fp = fdGetFp(fd)) != NULL) && ((fdno = fdGetFdno(fd)) >= 0)) { + if (isHTTP && ((fp = fdGetFp(fd)) != NULL) && ((fdno = fdGetFdno(fd)) >= 0)) + { /*@+voidabstract@*/ fdPush(fd, fpio, fp, fileno(fp)); /* Push fpio onto stack */ /*@=voidabstract@*/ @@ -3128,9 +3047,7 @@ int Ferror(FD_t fd) if (rc == 0 && ec) rc = ec; } -/*@-modfilesys@*/ DBGIO(fd, (stderr, "==> Ferror(%p) rc %d %s\n", fd, rc, fdbg(fd))); -/*@=modfilesys@*/ return rc; } @@ -3143,9 +3060,7 @@ int Fileno(FD_t fd) rc = fd->fps[i].fdno; /*@=boundsread@*/ } -/*@-modfilesys@*/ DBGIO(fd, (stderr, "==> Fileno(%p) rc %d %s\n", (fd ? fd : NULL), rc, fdbg(fd))); -/*@=modfilesys@*/ return rc; } @@ -3263,9 +3178,10 @@ exit: } /*@=boundswrite@*/ +/*@-type@*/ /* LCL: function typedefs */ static struct FDIO_s fpio_s = { ufdRead, ufdWrite, fdSeek, ufdClose, XfdLink, XfdFree, XfdNew, fdFileno, ufdOpen, NULL, fdGetFp, NULL, Mkdir, Chdir, Rmdir, Rename, Unlink }; -FDIO_t fpio = /*@-compmempass@*/ &fpio_s /*@=compmempass@*/ ; /*@=type@*/ +FDIO_t fpio = /*@-compmempass@*/ &fpio_s /*@=compmempass@*/ ; diff --git a/rpmio/rpmio.h b/rpmio/rpmio.h index c4e3ddc52..538fcf717 100644 --- a/rpmio/rpmio.h +++ b/rpmio/rpmio.h @@ -282,7 +282,7 @@ int Fclose( /*@killref@*/ FD_t fd) */ /*@null@*/ FD_t Fopen(/*@null@*/ const char * path, /*@null@*/ const char * fmode) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fileSystem, internalState @*/; @@ -325,28 +325,28 @@ int Fcntl(FD_t fd, int op, void *lip) * mkdir(2) clone. */ int Mkdir(const char * path, mode_t mode) - /*@globals errno, fileSystem, internalState @*/ + /*@globals errno, h_errno, fileSystem, internalState @*/ /*@modifies errno, fileSystem, internalState @*/; /** * chdir(2) clone. */ int Chdir(const char * path) - /*@globals errno, fileSystem, internalState @*/ + /*@globals errno, h_errno, fileSystem, internalState @*/ /*@modifies errno, fileSystem, internalState @*/; /** * rmdir(2) clone. */ int Rmdir(const char * path) - /*@globals errno, fileSystem, internalState @*/ + /*@globals errno, h_errno, fileSystem, internalState @*/ /*@modifies errno, fileSystem, internalState @*/; /** * rename(2) clone. */ int Rename(const char * oldpath, const char * newpath) - /*@globals errno, fileSystem, internalState @*/ + /*@globals errno, h_errno, fileSystem, internalState @*/ /*@modifies errno, fileSystem, internalState @*/; /** @@ -360,7 +360,7 @@ int Link(const char * oldpath, const char * newpath) * unlink(2) clone. */ int Unlink(const char * path) - /*@globals errno, fileSystem, internalState @*/ + /*@globals errno, h_errno, fileSystem, internalState @*/ /*@modifies errno, fileSystem, internalState @*/; /** @@ -368,7 +368,7 @@ int Unlink(const char * path) */ /*@-incondefs@*/ int Readlink(const char * path, /*@out@*/ char * buf, size_t bufsiz) - /*@globals errno, fileSystem, internalState @*/ + /*@globals errno, h_errno, fileSystem, internalState @*/ /*@modifies *buf, errno, fileSystem, internalState @*/ /*@requires maxSet(buf) >= (bufsiz - 1) @*/ /*@ensures maxRead(buf) <= bufsiz @*/; @@ -378,14 +378,14 @@ int Readlink(const char * path, /*@out@*/ char * buf, size_t bufsiz) * stat(2) clone. */ int Stat(const char * path, /*@out@*/ struct stat * st) - /*@globals errno, fileSystem, internalState @*/ + /*@globals errno, h_errno, fileSystem, internalState @*/ /*@modifies *st, errno, fileSystem, internalState @*/; /** * lstat(2) clone. */ int Lstat(const char * path, /*@out@*/ struct stat * st) - /*@globals errno, fileSystem, internalState @*/ + /*@globals errno, h_errno, fileSystem, internalState @*/ /*@modifies *st, errno, fileSystem, internalState @*/; /** @@ -418,7 +418,7 @@ void Globfree( /*@only@*/ glob_t * pglob) */ /*@null@*/ DIR * Opendir(const char * path) - /*@globals errno, fileSystem, internalState @*/ + /*@globals errno, h_errno, fileSystem, internalState @*/ /*@modifies errno, fileSystem, internalState @*/; /** @@ -552,7 +552,7 @@ int fdReadable(FD_t fd, int secs) * @return 0 on success, errno (or -1) on error */ int rpmioMkpath(const char * path, mode_t mode, uid_t uid, gid_t gid) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fileSystem, internalState @*/; /** @@ -593,7 +593,7 @@ typedef enum ftperrCode_e { /*@-redecl@*/ /*@unused@*/ /*@observer@*/ const char * urlStrerror(const char * url) - /*@globals internalState @*/ + /*@globals h_errno, internalState @*/ /*@modifies internalState @*/; /*@=redecl@*/ diff --git a/rpmio/rpmio_internal.h b/rpmio/rpmio_internal.h index b4ddb8c10..cb4f3edbb 100644 --- a/rpmio/rpmio_internal.h +++ b/rpmio/rpmio_internal.h @@ -96,6 +96,7 @@ struct pgpDig_s { /** \ingroup rpmio */ typedef struct _FDSTACK_s { +/*@exposed@*/ FDIO_t io; /*@dependent@*/ void * fp; int fdno; @@ -180,7 +181,9 @@ extern int _ftp_debug; /*@=redecl@*/ #define DBG(_f, _m, _x) \ - if ((_rpmio_debug | ((_f) ? ((FD_t)(_f))->flags : 0)) & (_m)) fprintf _x + /*@-modfilesys@*/ \ + if ((_rpmio_debug | ((_f) ? ((FD_t)(_f))->flags : 0)) & (_m)) fprintf _x \ + /*@=modfilesys@*/ #if defined(__LCLINT__XXX) #define DBGIO(_f, _x) @@ -204,7 +207,7 @@ int fdFgets(FD_t fd, char * buf, size_t len) */ /*@null@*/ FD_t ftpOpen(const char *url, /*@unused@*/ int flags, /*@unused@*/ mode_t mode, /*@out@*/ urlinfo *uret) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies *uret, fileSystem, internalState @*/; /** \ingroup rpmio @@ -216,7 +219,7 @@ int ftpReq(FD_t data, const char * ftpCmd, const char * ftpArg) /** \ingroup rpmio */ int ftpCmd(const char * cmd, const char * url, const char * arg2) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fileSystem, internalState @*/; /** \ingroup rpmio @@ -596,7 +599,7 @@ int fdFileno(/*@null@*/ void * cookie) */ int rpmioSlurp(const char * fn, /*@out@*/ const unsigned char ** bp, /*@out@*/ ssize_t * blenp) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies *bp, *blenp, fileSystem, internalState @*/; #ifdef __cplusplus diff --git a/rpmio/rpmlog.h b/rpmio/rpmlog.h index 6cbd01b39..d9d01a409 100644 --- a/rpmio/rpmlog.h +++ b/rpmio/rpmlog.h @@ -176,7 +176,7 @@ int rpmlogGetNrecs(void) /*@*/; * Print all rpmError() messages. * @param f file handle (NULL uses stderr) */ -void rpmlogPrint(FILE *f) +void rpmlogPrint(/*@null@*/ FILE *f) /*@modifies *f @*/; /** diff --git a/rpmio/rpmmacro.h b/rpmio/rpmmacro.h index 97eae6a3b..aeac1dd8e 100644 --- a/rpmio/rpmmacro.h +++ b/rpmio/rpmmacro.h @@ -64,8 +64,7 @@ extern "C" { */ void rpmDumpMacroTable (/*@null@*/ MacroContext mc, /*@null@*/ FILE * fp) - /*@globals rpmGlobalMacroContext, - fileSystem@*/ + /*@globals rpmGlobalMacroContext, fileSystem @*/ /*@modifies *fp, fileSystem @*/; /** @@ -81,8 +80,7 @@ void rpmDumpMacroTable (/*@null@*/ MacroContext mc, int expandMacros (/*@null@*/ void * spec, /*@null@*/ MacroContext mc, /*@in@*/ /*@out@*/ char * sbuf, size_t slen) - /*@globals rpmGlobalMacroContext, - fileSystem @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem @*/ /*@modifies *sbuf, rpmGlobalMacroContext, fileSystem @*/; /** @@ -97,7 +95,7 @@ int expandMacros (/*@null@*/ void * spec, /*@null@*/ MacroContext mc, void addMacro (/*@null@*/ MacroContext mc, const char * n, /*@null@*/ const char * o, /*@null@*/ const char * b, int level) - /*@globals rpmGlobalMacroContext@*/ + /*@globals rpmGlobalMacroContext @*/ /*@modifies mc, rpmGlobalMacroContext @*/; /** @@ -106,7 +104,7 @@ void addMacro (/*@null@*/ MacroContext mc, const char * n, * @param n macro name */ void delMacro (/*@null@*/ MacroContext mc, const char * n) - /*@globals rpmGlobalMacroContext@*/ + /*@globals rpmGlobalMacroContext @*/ /*@modifies mc, rpmGlobalMacroContext @*/; /** @@ -118,7 +116,7 @@ void delMacro (/*@null@*/ MacroContext mc, const char * n) */ int rpmDefineMacro (/*@null@*/ MacroContext mc, const char * macro, int level) - /*@globals rpmGlobalMacroContext@*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies mc, rpmGlobalMacroContext @*/; /** @@ -127,7 +125,7 @@ int rpmDefineMacro (/*@null@*/ MacroContext mc, const char * macro, * @param level macro recursion level (0 is entry API) */ void rpmLoadMacros (/*@null@*/ MacroContext mc, int level) - /*@globals rpmGlobalMacroContext@*/ + /*@globals rpmGlobalMacroContext @*/ /*@modifies rpmGlobalMacroContext @*/; /** @@ -137,7 +135,7 @@ void rpmLoadMacros (/*@null@*/ MacroContext mc, int level) */ void rpmInitMacros (/*@null@*/ MacroContext mc, const char * macrofiles) /*@globals rpmGlobalMacroContext, rpmCLIMacroContext, - fileSystem, internalState @*/ + h_errno, fileSystem, internalState @*/ /*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/; /** @@ -145,7 +143,7 @@ void rpmInitMacros (/*@null@*/ MacroContext mc, const char * macrofiles) * @param mc macro context (NULL uses global context). */ void rpmFreeMacros (/*@null@*/ MacroContext mc) - /*@globals rpmGlobalMacroContext@*/ + /*@globals rpmGlobalMacroContext @*/ /*@modifies mc, rpmGlobalMacroContext @*/; typedef enum rpmCompressedMagic_e { @@ -163,7 +161,7 @@ typedef enum rpmCompressedMagic_e { */ int isCompressed (const char * file, /*@out@*/ rpmCompressedMagic * compressed) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies *compressed, fileSystem, internalState @*/; /** @@ -172,7 +170,7 @@ int isCompressed (const char * file, * @return macro expansion (malloc'ed) */ char * rpmExpand (/*@null@*/ const char * arg, ...) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies rpmGlobalMacroContext @*/; /** @@ -191,7 +189,7 @@ char * rpmCleanPath (/*@returned@*/ /*@null@*/ char * path) */ /*@-redecl@*/ /* LCL: shrug */ const char * rpmGetPath (/*@null@*/ const char * path, ...) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies rpmGlobalMacroContext @*/; /*@=redecl@*/ @@ -209,7 +207,7 @@ const char * rpmGetPath (/*@null@*/ const char * path, ...) const char * rpmGenPath (/*@null@*/ const char * urlroot, /*@null@*/ const char * urlmdir, /*@null@*/ const char * urlfile) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies rpmGlobalMacroContext @*/; /*@=redecl@*/ @@ -221,7 +219,7 @@ const char * rpmGenPath (/*@null@*/ const char * urlroot, * @return numeric value */ int rpmExpandNumeric (const char * arg) - /*@globals rpmGlobalMacroContext @*/ + /*@globals rpmGlobalMacroContext, h_errno @*/ /*@modifies rpmGlobalMacroContext @*/; #ifdef __cplusplus diff --git a/rpmio/rpmpgp.h b/rpmio/rpmpgp.h index 3c9a097e9..32167f70a 100644 --- a/rpmio/rpmpgp.h +++ b/rpmio/rpmpgp.h @@ -1227,7 +1227,7 @@ int pgpPrtPkts(const byte *pkts, unsigned int pktlen, pgpDig dig, int printing) */ pgpArmor pgpReadPkts(const char * fn, /*@out@*/ const byte ** pkt, /*@out@*/ size_t * pktlen) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies *pkt, *pktlen, fileSystem, internalState @*/; /** diff --git a/rpmio/rpmrpc.c b/rpmio/rpmrpc.c index 950638a35..ec434a14b 100644 --- a/rpmio/rpmrpc.c +++ b/rpmio/rpmrpc.c @@ -12,13 +12,13 @@ #include "ugid.h" #include "debug.h" -/*@access DIR@*/ -/*@access FD_t@*/ -/*@access urlinfo@*/ +/*@access DIR @*/ +/*@access FD_t @*/ +/*@access urlinfo @*/ /* =============================================================== */ static int ftpMkdir(const char * path, /*@unused@*/ mode_t mode) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fileSystem, internalState @*/ { int rc; @@ -34,21 +34,21 @@ static int ftpMkdir(const char * path, /*@unused@*/ mode_t mode) } static int ftpChdir(const char * path) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fileSystem, internalState @*/ { return ftpCmd("CWD", path, NULL); } static int ftpRmdir(const char * path) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fileSystem, internalState @*/ { return ftpCmd("RMD", path, NULL); } static int ftpRename(const char * oldpath, const char * newpath) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fileSystem, internalState @*/ { int rc; @@ -58,7 +58,7 @@ static int ftpRename(const char * oldpath, const char * newpath) } static int ftpUnlink(const char * path) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fileSystem, internalState @*/ { return ftpCmd("DELE", path, NULL); @@ -825,7 +825,7 @@ static int ftpNLST(const char * url, ftpSysCall_t ftpSysCall, /*@out@*/ /*@null@*/ struct stat * st, /*@out@*/ /*@null@*/ char * rlbuf, size_t rlbufsiz) /*@globals ftpBufAlloced, ftpBuf, - fileSystem, internalState @*/ + h_errno, fileSystem, internalState @*/ /*@modifies *st, *rlbuf, ftpBufAlloced, ftpBuf, fileSystem, internalState @*/ { @@ -1035,7 +1035,7 @@ static const char * statstr(const struct stat * st, static int ftp_st_ino = 0xdead0000; static int ftpStat(const char * path, /*@out@*/ struct stat *st) - /*@globals ftp_st_ino, fileSystem, internalState @*/ + /*@globals ftp_st_ino, h_errno, fileSystem, internalState @*/ /*@modifies *st, ftp_st_ino, fileSystem, internalState @*/ { char buf[1024]; @@ -1050,7 +1050,7 @@ fprintf(stderr, "*** ftpStat(%s) rc %d\n%s", path, rc, statstr(st, buf)); } static int ftpLstat(const char * path, /*@out@*/ struct stat *st) - /*@globals ftp_st_ino, fileSystem, internalState @*/ + /*@globals ftp_st_ino, h_errno, fileSystem, internalState @*/ /*@modifies *st, ftp_st_ino, fileSystem, internalState @*/ { char buf[1024]; @@ -1065,7 +1065,7 @@ fprintf(stderr, "*** ftpLstat(%s) rc %d\n%s\n", path, rc, statstr(st, buf)); } static int ftpReadlink(const char * path, /*@out@*/ char * buf, size_t bufsiz) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies *buf, fileSystem, internalState @*/ { int rc; @@ -1109,7 +1109,7 @@ static int ftpmagicdir = 0x8440291; /*@-boundswrite@*/ /*@null@*/ static DIR * ftpOpendir(const char * path) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fileSystem, internalState @*/ { FTPDIR mydir; diff --git a/rpmio/rpmurl.h b/rpmio/rpmurl.h index 770c610c3..09743f4d2 100644 --- a/rpmio/rpmurl.h +++ b/rpmio/rpmurl.h @@ -153,7 +153,7 @@ urltype urlPath(const char * url, /*@out@*/ const char ** pathp) * @return 0 on success, -1 on error */ int urlSplit(const char * url, /*@out@*/ urlinfo * uret) - /*@globals internalState @*/ + /*@globals h_errno, internalState @*/ /*@modifies *uret, internalState @*/; /** @@ -163,7 +163,7 @@ int urlSplit(const char * url, /*@out@*/ urlinfo * uret) * @return 0 on success, otherwise FTPERR_* code */ int urlGetFile(const char * url, /*@null@*/ const char * dest) - /*@globals fileSystem, internalState @*/ + /*@globals h_errno, fileSystem, internalState @*/ /*@modifies fileSystem, internalState @*/; #ifdef __cplusplus diff --git a/rpmio/url.c b/rpmio/url.c index 685375c44..bc46e5e8b 100644 --- a/rpmio/url.c +++ b/rpmio/url.c @@ -193,7 +193,7 @@ static int urlStrcmp(/*@null@*/ const char * str1, /*@null@*/ const char * str2) /*@-boundswrite@*/ /*@-mods@*/ static void urlFind(/*@null@*/ /*@in@*/ /*@out@*/ urlinfo * uret, int mustAsk) - /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/ + /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/ /*@modifies *uret, rpmGlobalMacroContext, fileSystem, internalState @*/ { urlinfo u; @@ -160,7 +160,7 @@ int main(int argc, const char ** argv) #endif /*@globals __assert_program_name, rpmEVR, RPMVERSION, rpmGlobalMacroContext, rpmCLIMacroContext, - fileSystem, internalState@*/ + h_errno, fileSystem, internalState@*/ /*@modifies __assert_program_name, fileSystem, internalState@*/ { diff --git a/zlib/zlib.h b/zlib/zlib.h index a4591059f..c233facfc 100644 --- a/zlib/zlib.h +++ b/zlib/zlib.h @@ -845,7 +845,7 @@ ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)) opened for writing. */ -ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)) +ZEXTERN int ZEXPORT gzread OF((gzFile file, /*@out@*/ voidp buf, unsigned len)) /*@globals errno, fileSystem @*/ /*@modifies file, *buf, errno, fileSystem @*/; /* |