diff options
author | jbj <devnull@localhost> | 2001-04-30 22:32:22 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2001-04-30 22:32:22 +0000 |
commit | 0ecdbba93587408c670124e88d39451c681a77eb (patch) | |
tree | 0953710c0f014faf772aa6c1ab0fdc1933ffdd8c | |
parent | a57a13b1350ff1a094c202c90391f8676f487582 (diff) | |
download | rpm-0ecdbba93587408c670124e88d39451c681a77eb.tar.gz rpm-0ecdbba93587408c670124e88d39451c681a77eb.tar.bz2 rpm-0ecdbba93587408c670124e88d39451c681a77eb.zip |
- yet more boring lclint annotations and fiddles.
CVS patchset: 4732
CVS date: 2001/04/30 22:32:22
54 files changed, 1678 insertions, 1528 deletions
@@ -39,6 +39,7 @@ - transaction iterator(s) need to run in reverse order on pure erasures. - erasures not yet strict, warn & chug on unlink(2)/rmdir(2) failure. - more boring lclint annotations and fiddles. + - yet more boring lclint annotations and fiddles. 4.0 -> 4.0.[12] - add doxygen and lclint annotations most everywhere. diff --git a/build/.lclintrc b/build/.lclintrc index d52e965ab..42c8960fd 100644 --- a/build/.lclintrc +++ b/build/.lclintrc @@ -11,20 +11,14 @@ -unrecogcomments # don't-bother-me-yet parameters --branchstate -#-immediatetrans --mustfree -#-observertrans -#-statictrans +-branchstate # ~39 +-mustfree # ~325 # not-yet normal parameters --boolops # w->n --fixedformalarray --null --predboolint # w->n --predboolothers # w->n --retvalint # w->n --type +-boolops # ~351 w->n +#-null # ~68 +-predboolint # ~200 w->n +-type # ~271 # -weak paramaters diff --git a/build/build.c b/build/build.c index ecda494ae..1505fb530 100644 --- a/build/build.c +++ b/build/build.c @@ -13,6 +13,7 @@ static int _build_debug = 0; /*@access StringBuf @*/ +/*@access urlinfo @*/ /* XXX compared with NULL */ /*@access FD_t @*/ /** @@ -29,7 +30,7 @@ static void doRmSource(Spec spec) for (p = spec->sources; p != NULL; p = p->next) { if (! (p->flags & RPMBUILD_ISNO)) { const char *fn = rpmGetPath("%{_sourcedir}/", p->source, NULL); - Unlink(fn); + (void) Unlink(fn); fn = _free(fn); } } @@ -38,7 +39,7 @@ static void doRmSource(Spec spec) for (p = pkg->icon; p != NULL; p = p->next) { if (! (p->flags & RPMBUILD_ISNO)) { const char *fn = rpmGetPath("%{_sourcedir}/", p->source, NULL); - Unlink(fn); + (void) Unlink(fn); fn = _free(fn); } } @@ -147,7 +148,7 @@ int doScript(Spec spec, int what, const char *name, StringBuf sb, int test) buildTemplate = rpmExpand(mTemplate, NULL); buildPost = rpmExpand(mPost, NULL); - fputs(buildTemplate, fp); + (void) fputs(buildTemplate, fp); if (what != RPMBUILD_PREP && what != RPMBUILD_RMBUILD && spec->buildSubdir) fprintf(fp, "cd %s\n", spec->buildSubdir); @@ -158,9 +159,9 @@ int doScript(Spec spec, int what, const char *name, StringBuf sb, int test) } else fprintf(fp, "%s", getStringBuf(sb)); - fputs(buildPost, fp); + (void) fputs(buildPost, fp); - Fclose(xfd); + (void) Fclose(xfd); if (test) { rc = 0; @@ -174,7 +175,7 @@ fprintf(stderr, "*** rootURL %s buildDirURL %s\n", rootURL, buildDirURL); rc = RPMERR_SCRIPT; goto exit; } - if (u) { + if (u != NULL) { switch (u->urltype) { case URL_IS_FTP: if (_build_debug) @@ -191,13 +192,13 @@ fprintf(stderr, "*** addMacros\n"); } buildCmd = rpmExpand("%{___build_cmd}", " ", buildScript, NULL); - poptParseArgvString(buildCmd, &argc, &argv); + (void) poptParseArgvString(buildCmd, &argc, &argv); rpmMessage(RPMMESS_NORMAL, _("Executing(%s): %s\n"), name, buildCmd); if (!(child = fork())) { errno = 0; - execvp(argv[0], (char *const *)argv); + (void) execvp(argv[0], (char *const *)argv); rpmError(RPMERR_SCRIPT, _("Exec of %s failed (%s): %s\n"), scriptName, name, strerror(errno)); @@ -217,10 +218,10 @@ fprintf(stderr, "*** addMacros\n"); exit: if (scriptName) { if (!rc) - Unlink(scriptName); + (void) Unlink(scriptName); scriptName = _free(scriptName); } - if (u) { + if (u != NULL) { switch (u->urltype) { case URL_IS_FTP: case URL_IS_HTTP: @@ -303,7 +304,7 @@ int buildSpec(Spec spec, int what, int test) doRmSource(spec); if (what & RPMBUILD_RMSPEC) - Unlink(spec->specFile); + (void) Unlink(spec->specFile); exit: if (rc && rpmlogGetNrecs() > 0) { diff --git a/build/expression.c b/build/expression.c index abdfb3e2c..14b059bad 100644 --- a/build/expression.c +++ b/build/expression.c @@ -645,7 +645,7 @@ int parseExpressionBoolean(Spec spec, const char *expr) state.spec = spec; state.nextToken = 0; state.tokenValue = NULL; - rdToken(&state); + (void) rdToken(&state); /* Parse the expression. */ v = doLogical(&state); @@ -692,7 +692,7 @@ char * parseExpressionString(Spec spec, const char *expr) state.spec = spec; state.nextToken = 0; state.tokenValue = NULL; - rdToken(&state); + (void) rdToken(&state); /* Parse the expression. */ v = doLogical(&state); diff --git a/build/files.c b/build/files.c index 1b8fa9a3d..b58615560 100644 --- a/build/files.c +++ b/build/files.c @@ -247,8 +247,8 @@ static void timeCheck(int tc, Header h) int count, x; time_t currentTime = time(NULL); - hge(h, RPMTAG_OLDFILENAMES, &fnt, (void **) &files, &count); - hge(h, RPMTAG_FILEMTIMES, NULL, (void **) &mtime, NULL); + (void) hge(h, RPMTAG_OLDFILENAMES, &fnt, (void **) &files, &count); + (void) hge(h, RPMTAG_FILEMTIMES, NULL, (void **) &mtime, NULL); for (x = 0; x < count; x++) { if ((currentTime - mtime[x]) > tc) @@ -331,13 +331,13 @@ static int parseForVerify(char *buf, FileList fl) not = 0; verifyFlags = RPMVERIFY_NONE; - for (p = q; *p; p = pe) { + for (p = q; *p != '\0'; p = pe) { SKIPWHITE(p); if (*p == '\0') break; pe = p; SKIPNONWHITE(pe); - if (*pe) + if (*pe != '\0') *pe++ = '\0'; { VFA_t *vfa; @@ -409,7 +409,7 @@ static int parseForAttr(char *buf, FileList fl) q = pe; q++; SKIPSPACE(q); - if (*q) { + if (*q != '\0') { rpmError(RPMERR_BADSPEC, _("Non-white space follows %s(): %s\n"), name, q); fl->processingFailed = 1; @@ -427,23 +427,23 @@ static int parseForAttr(char *buf, FileList fl) nullAttrRec(ar); p = q; SKIPWHITE(p); - if (*p) { - pe = p; SKIPNONWHITE(pe); if (*pe) *pe++ = '\0'; + if (*p != '\0') { + pe = p; SKIPNONWHITE(pe); if (*pe != '\0') *pe++ = '\0'; ar->ar_fmodestr = p; p = pe; SKIPWHITE(p); } - if (*p) { - pe = p; SKIPNONWHITE(pe); if (*pe) *pe++ = '\0'; + if (*p != '\0') { + pe = p; SKIPNONWHITE(pe); if (*pe != '\0') *pe++ = '\0'; ar->ar_user = p; p = pe; SKIPWHITE(p); } - if (*p) { - pe = p; SKIPNONWHITE(pe); if (*pe) *pe++ = '\0'; + if (*p != '\0') { + pe = p; SKIPNONWHITE(pe); if (*pe != '\0') *pe++ = '\0'; ar->ar_group = p; p = pe; SKIPWHITE(p); } - if (*p && ret_ar == &(fl->def_ar)) { /* %defattr */ - pe = p; SKIPNONWHITE(pe); if (*pe) *pe++ = '\0'; + if (*p != '\0' && ret_ar == &(fl->def_ar)) { /* %defattr */ + pe = p; SKIPNONWHITE(pe); if (*pe != '\0') *pe++ = '\0'; ar->ar_dmodestr = p; p = pe; SKIPWHITE(p); } @@ -530,13 +530,13 @@ static int parseForConfig(char *buf, FileList fl) while (p <= pe) *p++ = ' '; - for (p = q; *p; p = pe) { + for (p = q; *p != '\0'; p = pe) { SKIPWHITE(p); if (*p == '\0') break; pe = p; SKIPNONWHITE(pe); - if (*pe) + if (*pe != '\0') *pe++ = '\0'; if (!strcmp(p, "missingok")) { fl->currentFlags |= RPMFILE_MISSINGOK; @@ -597,7 +597,7 @@ static int parseForLang(char *buf, FileList fl) *p++ = ' '; /* Parse multiple arguments from %lang */ - for (p = q; *p; p = pe) { + for (p = q; *p != '\0'; p = pe) { char *newp; size_t np; int i; @@ -828,7 +828,7 @@ static int parseForSimple(/*@unused@*/Spec spec, Package pkg, char *buf, /* XXX WATCHOUT: buf is an arg */ { const char *ddir, *n, *v; - headerNVR(pkg->header, &n, &v, NULL); + (void) headerNVR(pkg->header, &n, &v, NULL); ddir = rpmGetPath("%{_docdir}/", n, "-", v, NULL); strcpy(buf, ddir); @@ -1058,65 +1058,65 @@ static void genCpioListAndHeader(/*@partial@*/ FileList fl, * compressed file list write before we write the actual package to * disk. */ - headerAddOrAppendEntry(h, RPMTAG_OLDFILENAMES, RPM_STRING_ARRAY_TYPE, + (void) headerAddOrAppendEntry(h, RPMTAG_OLDFILENAMES, RPM_STRING_ARRAY_TYPE, &(flp->fileURL), 1); if (sizeof(flp->fl_size) != sizeof(uint_32)) { uint_32 psize = (uint_32)flp->fl_size; - headerAddOrAppendEntry(h, RPMTAG_FILESIZES, RPM_INT32_TYPE, + (void) headerAddOrAppendEntry(h, RPMTAG_FILESIZES, RPM_INT32_TYPE, &(psize), 1); } else { - headerAddOrAppendEntry(h, RPMTAG_FILESIZES, RPM_INT32_TYPE, + (void) headerAddOrAppendEntry(h, RPMTAG_FILESIZES, RPM_INT32_TYPE, &(flp->fl_size), 1); } - headerAddOrAppendEntry(h, RPMTAG_FILEUSERNAME, RPM_STRING_ARRAY_TYPE, + (void) headerAddOrAppendEntry(h, RPMTAG_FILEUSERNAME, RPM_STRING_ARRAY_TYPE, &(flp->uname), 1); - headerAddOrAppendEntry(h, RPMTAG_FILEGROUPNAME, RPM_STRING_ARRAY_TYPE, + (void) headerAddOrAppendEntry(h, RPMTAG_FILEGROUPNAME, RPM_STRING_ARRAY_TYPE, &(flp->gname), 1); - headerAddOrAppendEntry(h, RPMTAG_FILEMTIMES, RPM_INT32_TYPE, + (void) headerAddOrAppendEntry(h, RPMTAG_FILEMTIMES, RPM_INT32_TYPE, &(flp->fl_mtime), 1); if (sizeof(flp->fl_mode) != sizeof(uint_16)) { uint_16 pmode = (uint_16)flp->fl_mode; - headerAddOrAppendEntry(h, RPMTAG_FILEMODES, RPM_INT16_TYPE, + (void) headerAddOrAppendEntry(h, RPMTAG_FILEMODES, RPM_INT16_TYPE, &(pmode), 1); } else { - headerAddOrAppendEntry(h, RPMTAG_FILEMODES, RPM_INT16_TYPE, + (void) headerAddOrAppendEntry(h, RPMTAG_FILEMODES, RPM_INT16_TYPE, &(flp->fl_mode), 1); } if (sizeof(flp->fl_rdev) != sizeof(uint_16)) { uint_16 prdev = (uint_16)flp->fl_rdev; - headerAddOrAppendEntry(h, RPMTAG_FILERDEVS, RPM_INT16_TYPE, + (void) headerAddOrAppendEntry(h, RPMTAG_FILERDEVS, RPM_INT16_TYPE, &(prdev), 1); } else { - headerAddOrAppendEntry(h, RPMTAG_FILERDEVS, RPM_INT16_TYPE, + (void) headerAddOrAppendEntry(h, RPMTAG_FILERDEVS, RPM_INT16_TYPE, &(flp->fl_rdev), 1); } if (sizeof(flp->fl_dev) != sizeof(uint_32)) { uint_32 pdevice = (uint_32)flp->fl_dev; - headerAddOrAppendEntry(h, RPMTAG_FILEDEVICES, RPM_INT32_TYPE, + (void) headerAddOrAppendEntry(h, RPMTAG_FILEDEVICES, RPM_INT32_TYPE, &(pdevice), 1); } else { - headerAddOrAppendEntry(h, RPMTAG_FILEDEVICES, RPM_INT32_TYPE, + (void) headerAddOrAppendEntry(h, RPMTAG_FILEDEVICES, RPM_INT32_TYPE, &(flp->fl_dev), 1); } - headerAddOrAppendEntry(h, RPMTAG_FILEINODES, RPM_INT32_TYPE, + (void) headerAddOrAppendEntry(h, RPMTAG_FILEINODES, RPM_INT32_TYPE, &(flp->fl_ino), 1); - headerAddOrAppendEntry(h, RPMTAG_FILELANGS, RPM_STRING_ARRAY_TYPE, + (void) headerAddOrAppendEntry(h, RPMTAG_FILELANGS, RPM_STRING_ARRAY_TYPE, &(flp->langs), 1); /* We used to add these, but they should not be needed */ - /* headerAddOrAppendEntry(h, RPMTAG_FILEUIDS, + /* (void) headerAddOrAppendEntry(h, RPMTAG_FILEUIDS, * RPM_INT32_TYPE, &(flp->fl_uid), 1); - * headerAddOrAppendEntry(h, RPMTAG_FILEGIDS, + * (void) headerAddOrAppendEntry(h, RPMTAG_FILEGIDS, * RPM_INT32_TYPE, &(flp->fl_gid), 1); */ buf[0] = '\0'; if (S_ISREG(flp->fl_mode)) - mdfile(flp->diskURL, buf); + (void) mdfile(flp->diskURL, buf); s = buf; - headerAddOrAppendEntry(h, RPMTAG_FILEMD5S, RPM_STRING_ARRAY_TYPE, + (void) headerAddOrAppendEntry(h, RPMTAG_FILEMD5S, RPM_STRING_ARRAY_TYPE, &s, 1); buf[0] = '\0'; @@ -1136,14 +1136,14 @@ static void genCpioListAndHeader(/*@partial@*/ FileList fl, } } s = buf; - headerAddOrAppendEntry(h, RPMTAG_FILELINKTOS, RPM_STRING_ARRAY_TYPE, + (void) headerAddOrAppendEntry(h, RPMTAG_FILELINKTOS, RPM_STRING_ARRAY_TYPE, &s, 1); if (flp->flags & RPMFILE_GHOST) { flp->verifyFlags &= ~(RPMVERIFY_MD5 | RPMVERIFY_FILESIZE | RPMVERIFY_LINKTO | RPMVERIFY_MTIME); } - headerAddOrAppendEntry(h, RPMTAG_FILEVERIFYFLAGS, RPM_INT32_TYPE, + (void) headerAddOrAppendEntry(h, RPMTAG_FILEVERIFYFLAGS, RPM_INT32_TYPE, &(flp->verifyFlags), 1); if (!isSrc && isDoc(fl, flp->fileURL)) @@ -1152,11 +1152,11 @@ static void genCpioListAndHeader(/*@partial@*/ FileList fl, if (S_ISDIR(flp->fl_mode)) flp->flags &= ~(RPMFILE_CONFIG|RPMFILE_DOC); - headerAddOrAppendEntry(h, RPMTAG_FILEFLAGS, RPM_INT32_TYPE, + (void) headerAddOrAppendEntry(h, RPMTAG_FILEFLAGS, RPM_INT32_TYPE, &(flp->flags), 1); } - headerAddEntry(h, RPMTAG_SIZE, RPM_INT32_TYPE, + (void) headerAddEntry(h, RPMTAG_SIZE, RPM_INT32_TYPE, &(fl->totalFileSize), 1); /* XXX This should be added always so that packages look alike. @@ -1164,11 +1164,11 @@ static void genCpioListAndHeader(/*@partial@*/ FileList fl, * XXX existence (rather than value) that will need to change as well. */ if (multiLibMask) - headerAddEntry(h, RPMTAG_MULTILIBS, RPM_INT32_TYPE, + (void) headerAddEntry(h, RPMTAG_MULTILIBS, RPM_INT32_TYPE, &multiLibMask, 1); if (_addDotSlash) - rpmlibNeedsFeature(h, "PayloadFilesHavePrefix", "4.0-1"); + (void) rpmlibNeedsFeature(h, "PayloadFilesHavePrefix", "4.0-1"); /* Choose how filenames are represented. */ if (_noDirTokens) @@ -1176,7 +1176,7 @@ static void genCpioListAndHeader(/*@partial@*/ FileList fl, else { compressFilelist(h); /* Binary packages with dirNames cannot be installed by legacy rpm. */ - rpmlibNeedsFeature(h, "CompressedFileNames", "3.0.4-1"); + (void) rpmlibNeedsFeature(h, "CompressedFileNames", "3.0.4-1"); } { TFI_t fi = xcalloc(sizeof(*fi), 1); @@ -1336,7 +1336,7 @@ static int addFile(FileList fl, const char * diskURL, struct stat *statp) fl->inFtw = 1; /* Flag to indicate file has buildRootURL prefixed */ fl->isDir = 1; /* Keep it from following myftw() again */ - myftw(diskURL, 16, (myftwFunc) addFile, fl); + (void) myftw(diskURL, 16, (myftwFunc) addFile, fl); fl->isDir = 0; fl->inFtw = 0; return 0; @@ -1379,7 +1379,7 @@ static int addFile(FileList fl, const char * diskURL, struct stat *statp) #endif rpmMessage(RPMMESS_DEBUG, _("File %4d: %07o %s.%s\t %s\n"), fl->fileCount, - fileMode, fileUname, fileGname, fileURL); + (unsigned)fileMode, fileUname, fileGname, fileURL); /* Add to the file list */ if (fl->fileListRecsUsed == fl->fileListRecsAlloced) { @@ -1412,7 +1412,7 @@ static int addFile(FileList fl, const char * diskURL, struct stat *statp) for (i = 0; i < fl->nLangs; i++) { const char *ocl; if (i) *ncl++ = '|'; - for (ocl = fl->currentLangs[i]; *ocl; ocl++) + for (ocl = fl->currentLangs[i]; *ocl != '\0'; ocl++) *ncl++ = *ocl; *ncl = '\0'; } @@ -1557,7 +1557,7 @@ static int processPackageFiles(Spec spec, Package pkg, } appendStringBuf(pkg->fileList, buf); } - Fclose(fd); + (void) Fclose(fd); } /* Init the file list structure */ @@ -1632,7 +1632,9 @@ static int processPackageFiles(Spec spec, Package pkg, if (fl.currentLangs) { int i; for (i = 0; i < fl.nLangs; i++) + /*@-unqualifiedtrans@*/ fl.currentLangs[i] = _free(fl.currentLangs[i]); + /*@=unqualifiedtrans@*/ fl.currentLangs = _free(fl.currentLangs); } fl.nLangs = 0; @@ -1658,14 +1660,14 @@ static int processPackageFiles(Spec spec, Package pkg, specialDoc = xstrdup(fileName); dupAttrRec(&fl.cur_ar, specialDocAttrRec); } else { - processBinaryFile(pkg, &fl, fileName); + (void) processBinaryFile(pkg, &fl, fileName); } } /* Now process special doc, if there is one */ if (specialDoc) { if (installSpecialDoc) { - doScript(spec, RPMBUILD_STRINGBUF, "%doc", pkg->specialDoc, test); + (void) doScript(spec, RPMBUILD_STRINGBUF, "%doc", pkg->specialDoc, test); } /* Reset for %doc */ @@ -1678,7 +1680,9 @@ static int processPackageFiles(Spec spec, Package pkg, if (fl.currentLangs) { int i; for (i = 0; i < fl.nLangs; i++) + /*@-unqualifiedtrans@*/ fl.currentLangs[i] = _free(fl.currentLangs[i]); + /*@=unqualifiedtrans@*/ fl.currentLangs = _free(fl.currentLangs); } fl.nLangs = 0; @@ -1686,7 +1690,7 @@ static int processPackageFiles(Spec spec, Package pkg, dupAttrRec(specialDocAttrRec, &fl.cur_ar); freeAttrRec(specialDocAttrRec); - processBinaryFile(pkg, &fl, specialDoc); + (void) processBinaryFile(pkg, &fl, specialDoc); specialDoc = _free(specialDoc); } @@ -1714,7 +1718,9 @@ exit: if (fl.currentLangs) { int i; for (i = 0; i < fl.nLangs; i++) + /*@-unqualifiedtrans@*/ fl.currentLangs[i] = _free(fl.currentLangs[i]); + /*@=unqualifiedtrans@*/ fl.currentLangs = _free(fl.currentLangs); } @@ -1756,7 +1762,7 @@ void initSourceHeader(Spec spec) case RPMTAG_CHANGELOGTEXT: case RPMTAG_URL: case HEADER_I18NTABLE: - headerAddEntry(spec->sourceHeader, tag, type, ptr, count); + (void) headerAddEntry(spec->sourceHeader, tag, type, ptr, count); break; default: /* do not copy */ @@ -1770,12 +1776,12 @@ void initSourceHeader(Spec spec) headerNextIterator(hi, &tag, &type, &ptr, &count); ptr = headerFreeData(ptr, type)) { - headerAddEntry(spec->sourceHeader, tag, type, ptr, count); + (void) headerAddEntry(spec->sourceHeader, tag, type, ptr, count); } headerFreeIterator(hi); if (spec->buildArchitectureCount) { - headerAddEntry(spec->sourceHeader, RPMTAG_BUILDARCHS, + (void) headerAddEntry(spec->sourceHeader, RPMTAG_BUILDARCHS, RPM_STRING_ARRAY_TYPE, spec->buildArchitectures, spec->buildArchitectureCount); } @@ -1803,18 +1809,18 @@ int processSourceFiles(Spec spec) appendLineStringBuf(sourceFiles, spec->specFile); for (srcPtr = spec->sources; srcPtr != NULL; srcPtr = srcPtr->next) { if (srcPtr->flags & RPMBUILD_ISSOURCE) { - headerAddOrAppendEntry(spec->sourceHeader, RPMTAG_SOURCE, + (void) headerAddOrAppendEntry(spec->sourceHeader, RPMTAG_SOURCE, RPM_STRING_ARRAY_TYPE, &srcPtr->source, 1); if (srcPtr->flags & RPMBUILD_ISNO) { - headerAddOrAppendEntry(spec->sourceHeader, RPMTAG_NOSOURCE, + (void) headerAddOrAppendEntry(spec->sourceHeader, RPMTAG_NOSOURCE, RPM_INT32_TYPE, &srcPtr->num, 1); } } if (srcPtr->flags & RPMBUILD_ISPATCH) { - headerAddOrAppendEntry(spec->sourceHeader, RPMTAG_PATCH, + (void) headerAddOrAppendEntry(spec->sourceHeader, RPMTAG_PATCH, RPM_STRING_ARRAY_TYPE, &srcPtr->source, 1); if (srcPtr->flags & RPMBUILD_ISNO) { - headerAddOrAppendEntry(spec->sourceHeader, RPMTAG_NOPATCH, + (void) headerAddOrAppendEntry(spec->sourceHeader, RPMTAG_NOPATCH, RPM_INT32_TYPE, &srcPtr->num, 1); } } @@ -1929,25 +1935,25 @@ static StringBuf getOutputFrom(char *dir, char *argv[], oldhandler = signal(SIGPIPE, SIG_IGN); toProg[0] = toProg[1] = 0; - pipe(toProg); + (void) pipe(toProg); fromProg[0] = fromProg[1] = 0; - pipe(fromProg); + (void) pipe(fromProg); if (!(progPID = fork())) { - close(toProg[1]); - close(fromProg[0]); + (void) close(toProg[1]); + (void) close(fromProg[0]); - dup2(toProg[0], STDIN_FILENO); /* Make stdin the in pipe */ - dup2(fromProg[1], STDOUT_FILENO); /* Make stdout the out pipe */ + (void) dup2(toProg[0], STDIN_FILENO); /* Make stdin the in pipe */ + (void) dup2(fromProg[1], STDOUT_FILENO); /* Make stdout the out pipe */ - close(toProg[0]); - close(fromProg[1]); + (void) close(toProg[0]); + (void) close(fromProg[1]); if (dir) { - chdir(dir); + (void) chdir(dir); } - execvp(argv[0], argv); + (void) execvp(argv[0], argv); /* XXX this error message is probably not seen. */ rpmError(RPMERR_EXEC, _("Couldn't exec %s: %s\n"), argv[0], strerror(errno)); @@ -1959,12 +1965,12 @@ static StringBuf getOutputFrom(char *dir, char *argv[], return NULL; } - close(toProg[0]); - close(fromProg[1]); + (void) close(toProg[0]); + (void) close(fromProg[1]); /* Do not block reading or writing from/to prog. */ - fcntl(fromProg[0], F_SETFL, O_NONBLOCK); - fcntl(toProg[1], F_SETFL, O_NONBLOCK); + (void) fcntl(fromProg[0], F_SETFL, O_NONBLOCK); + (void) fcntl(toProg[1], F_SETFL, O_NONBLOCK); readBuff = newStringBuf(); @@ -2008,7 +2014,7 @@ top: writeBytesLeft -= nbw; writePtr += nbw; } else if (toProg[1] >= 0) { /* close write fd */ - close(toProg[1]); + (void) close(toProg[1]); toProg[1] = -1; } } @@ -2028,10 +2034,10 @@ top: /* Clean up */ if (toProg[1] >= 0) - close(toProg[1]); + (void) close(toProg[1]); if (fromProg[0] >= 0) - close(fromProg[0]); - (void)signal(SIGPIPE, oldhandler); + (void) close(fromProg[0]); + (void) signal(SIGPIPE, oldhandler); /* Collect status from prog */ (void)waitpid(progPID, &status, 0); @@ -2290,7 +2296,7 @@ static void printDeps(Header h) break; default: versions = hfd(versions, dvt); - hge(h, dm->vtag, &dvt, (void **) &versions, NULL); + (void) hge(h, dm->vtag, &dvt, (void **) &versions, NULL); break; } switch (dm->ftag) { @@ -2300,7 +2306,7 @@ static void printDeps(Header h) case -1: break; default: - hge(h, dm->ftag, NULL, (void **) &flags, NULL); + (void) hge(h, dm->ftag, NULL, (void **) &flags, NULL); break; } printDepMsg(dm, count, names, versions, flags); @@ -2321,7 +2327,7 @@ int processBinaryFiles(Spec spec, int installSpecialDoc, int test) if (pkg->fileList == NULL) continue; - headerNVR(pkg->header, &n, &v, &r); + (void) headerNVR(pkg->header, &n, &v, &r); rpmMessage(RPMMESS_NORMAL, _("Processing files: %s-%s-%s\n"), n, v, r); if ((rc = processPackageFiles(spec, pkg, installSpecialDoc, test))) @@ -2332,10 +2338,10 @@ int processBinaryFiles(Spec spec, int installSpecialDoc, int test) * XXX existence (rather than value) that will need to change as well. */ if (headerIsEntry(pkg->header, RPMTAG_MULTILIBS)) { - generateDepends(spec, pkg, pkg->cpioList, 1); - generateDepends(spec, pkg, pkg->cpioList, 2); + (void) generateDepends(spec, pkg, pkg->cpioList, 1); + (void) generateDepends(spec, pkg, pkg->cpioList, 2); } else - generateDepends(spec, pkg, pkg->cpioList, 0); + (void) generateDepends(spec, pkg, pkg->cpioList, 0); printDeps(pkg->header); } diff --git a/build/myftw.c b/build/myftw.c index 976a7f883..b58a52908 100644 --- a/build/myftw.c +++ b/build/myftw.c @@ -107,7 +107,7 @@ myftw_dir (DIR **dirs, int level, int descriptors, newlev = (level + 1) % descriptors; if (dirs[newlev] != NULL) - Closedir (dirs[newlev]); + (void) Closedir (dirs[newlev]); dirs[newlev] = Opendir (dir); if (dirs[newlev] != NULL) @@ -134,7 +134,7 @@ myftw_dir (DIR **dirs, int level, int descriptors, int save; save = errno; - Closedir (dirs[newlev]); + (void) Closedir (dirs[newlev]); errno = save; dirs[newlev] = NULL; } @@ -228,7 +228,7 @@ int myftw (const char *dir, int save; save = errno; - Closedir (dirs[0]); + (void) Closedir (dirs[0]); errno = save; } } diff --git a/build/names.c b/build/names.c index da2787ac5..03e08dc0d 100644 --- a/build/names.c +++ b/build/names.c @@ -126,7 +126,7 @@ const char *const buildHost(void) struct hostent *hbn; if (! gotit) { - gethostname(hostname, sizeof(hostname)); + (void) gethostname(hostname, sizeof(hostname)); if ((hbn = /*@-unrecog@*/ gethostbyname(hostname) /*@=unrecog@*/ )) strcpy(hostname, hbn->h_name); else diff --git a/build/pack.c b/build/pack.c index 43fc29a23..8baf97118 100644 --- a/build/pack.c +++ b/build/pack.c @@ -29,7 +29,7 @@ static inline int genSourceRpmName(Spec spec) const char *name, *version, *release; char fileName[BUFSIZ]; - headerNVR(spec->packages->header, &name, &version, &release); + (void) headerNVR(spec->packages->header, &name, &version, &release); sprintf(fileName, "%s-%s-%s.%ssrc.rpm", name, version, release, spec->noSource ? "no" : ""); spec->sourceRpmName = xstrdup(fileName); @@ -60,7 +60,7 @@ static int cpio_doio(FD_t fdo, /*@unused@*/ Header h, CSA_t * csa, rc = fsmSetup(fi->fsm, FSM_PKGBUILD, ts, fi, cfd, &csa->cpioArchiveSize, &failedFile); - Fclose(cfd); + (void) Fclose(cfd); (void) fsmTeardown(fi->fsm); if (rc) { @@ -101,10 +101,12 @@ static int cpio_copy(FD_t fdo, CSA_t *csa) /** */ -static StringBuf addFileToTagAux(Spec spec, const char *file, StringBuf sb) +static /*@only@*/ /*@null@*/ StringBuf addFileToTagAux(Spec spec, + const char * file, /*@only@*/ StringBuf sb) { char buf[BUFSIZ]; - const char *fn = buf; + const char * fn = buf; + FILE * f; FD_t fd; /* XXX use rpmGenPath(rootdir, "%{_buildir}/%{_buildsubdir}/", file) */ @@ -116,15 +118,18 @@ static StringBuf addFileToTagAux(Spec spec, const char *file, StringBuf sb) freeStringBuf(sb); return NULL; } - while (fgets(buf, sizeof(buf), (FILE *)fdGetFp(fd))) { + f = fdGetFp(fd); + while (fgets(buf, sizeof(buf), f)) { /* XXX display fn in error msg */ if (expandMacros(spec, spec->macros, buf, sizeof(buf))) { rpmError(RPMERR_BADSPEC, _("line: %s\n"), buf); - return NULL; + freeStringBuf(sb); + sb = NULL; + break; } appendStringBuf(sb, buf); } - Fclose(fd); + (void) Fclose(fd); return sb; } @@ -139,13 +144,13 @@ static int addFileToTag(Spec spec, const char * file, Header h, int tag) if (hge(h, tag, NULL, (void **)&s, NULL)) { appendLineStringBuf(sb, s); - headerRemoveEntry(h, tag); + (void) headerRemoveEntry(h, tag); } if ((sb = addFileToTagAux(spec, file, sb)) == NULL) return 1; - headerAddEntry(h, tag, RPM_STRING_TYPE, getStringBuf(sb), 1); + (void) headerAddEntry(h, tag, RPM_STRING_TYPE, getStringBuf(sb), 1); freeStringBuf(sb); return 0; @@ -162,7 +167,7 @@ static int addFileToArrayTag(Spec spec, const char *file, Header h, int tag) return 1; s = getStringBuf(sb); - headerAddOrAppendEntry(h, tag, RPM_STRING_ARRAY_TYPE, &s, 1); + (void) headerAddOrAppendEntry(h, tag, RPM_STRING_ARRAY_TYPE, &s, 1); freeStringBuf(sb); return 0; @@ -212,10 +217,10 @@ static int processScriptFiles(Spec spec, Package pkg) } for (p = pkg->triggerFiles; p != NULL; p = p->next) { - headerAddOrAppendEntry(pkg->header, RPMTAG_TRIGGERSCRIPTPROG, + (void) headerAddOrAppendEntry(pkg->header, RPMTAG_TRIGGERSCRIPTPROG, RPM_STRING_ARRAY_TYPE, &(p->prog), 1); if (p->script) { - headerAddOrAppendEntry(pkg->header, RPMTAG_TRIGGERSCRIPTS, + (void) headerAddOrAppendEntry(pkg->header, RPMTAG_TRIGGERSCRIPTS, RPM_STRING_ARRAY_TYPE, &(p->script), 1); } else if (p->fileName) { if (addFileToArrayTag(spec, p->fileName, pkg->header, @@ -229,7 +234,7 @@ static int processScriptFiles(Spec spec, Package pkg) /* This is dumb. When the header supports NULL string */ /* this will go away. */ char *bull = ""; - headerAddOrAppendEntry(pkg->header, RPMTAG_TRIGGERSCRIPTS, + (void) headerAddOrAppendEntry(pkg->header, RPMTAG_TRIGGERSCRIPTS, RPM_STRING_ARRAY_TYPE, &bull, 1); } } @@ -301,7 +306,7 @@ int readRPM(const char *fileName, Spec *specp, struct rpmlead *lead, Header *sig if (csa) csa->cpioFdIn = fdi; else - Fclose(fdi); + (void) Fclose(fdi); return 0; } @@ -322,7 +327,7 @@ int writeRPM(Header *hdrp, const char *fileName, int type, if (Fileno(csa->cpioFdIn) < 0) { csa->cpioArchiveSize = 0; /* Add a bogus archive size to the Header */ - headerAddEntry(h, RPMTAG_ARCHIVESIZE, RPM_INT32_TYPE, + (void) headerAddEntry(h, RPMTAG_ARCHIVESIZE, RPM_INT32_TYPE, &csa->cpioArchiveSize, 1); } @@ -357,26 +362,26 @@ int writeRPM(Header *hdrp, const char *fileName, int type, } s = strchr(rpmio_flags, '.'); if (s) { - headerAddEntry(h, RPMTAG_PAYLOADFORMAT, RPM_STRING_TYPE, "cpio", 1); + (void) headerAddEntry(h, RPMTAG_PAYLOADFORMAT, RPM_STRING_TYPE, "cpio", 1); if (s[1] == 'g' && s[2] == 'z') - headerAddEntry(h, RPMTAG_PAYLOADCOMPRESSOR, RPM_STRING_TYPE, + (void) headerAddEntry(h, RPMTAG_PAYLOADCOMPRESSOR, RPM_STRING_TYPE, "gzip", 1); if (s[1] == 'b' && s[2] == 'z') { - headerAddEntry(h, RPMTAG_PAYLOADCOMPRESSOR, RPM_STRING_TYPE, + (void) headerAddEntry(h, RPMTAG_PAYLOADCOMPRESSOR, RPM_STRING_TYPE, "bzip2", 1); /* Add prereq on rpm version that understands bzip2 payloads */ - rpmlibNeedsFeature(h, "PayloadIsBzip2", "3.0.5-1"); + (void) rpmlibNeedsFeature(h, "PayloadIsBzip2", "3.0.5-1"); } strcpy(buf, rpmio_flags); buf[s - rpmio_flags] = '\0'; - headerAddEntry(h, RPMTAG_PAYLOADFLAGS, RPM_STRING_TYPE, buf+1, 1); + (void) headerAddEntry(h, RPMTAG_PAYLOADFLAGS, RPM_STRING_TYPE, buf+1, 1); } /* Create and add the cookie */ if (cookie) { sprintf(buf, "%s %d", buildHost(), (int) time(NULL)); *cookie = xstrdup(buf); - headerAddEntry(h, RPMTAG_COOKIE, RPM_STRING_TYPE, *cookie, 1); + (void) headerAddEntry(h, RPMTAG_COOKIE, RPM_STRING_TYPE, *cookie, 1); } /* Reallocate the header into one contiguous region. */ @@ -428,21 +433,21 @@ int writeRPM(Header *hdrp, const char *fileName, int type, if (headerWrite(fd, h, HEADER_MAGIC_YES)) rc = RPMERR_NOSPACE; - Fclose(fd); + (void) Fclose(fd); fd = NULL; - Unlink(fileName); + (void) Unlink(fileName); if (rc) goto exit; /* Generate the signature */ - fflush(stdout); + (void) fflush(stdout); sig = rpmNewSignature(); - rpmAddSignature(sig, sigtarget, RPMSIGTAG_SIZE, passPhrase); - rpmAddSignature(sig, sigtarget, RPMSIGTAG_MD5, passPhrase); + (void) rpmAddSignature(sig, sigtarget, RPMSIGTAG_SIZE, passPhrase); + (void) rpmAddSignature(sig, sigtarget, RPMSIGTAG_MD5, passPhrase); if ((sigtype = rpmLookupSignatureType(RPMLOOKUPSIG_QUERY)) > 0) { rpmMessage(RPMMESS_NORMAL, _("Generating signature: %d\n"), sigtype); - rpmAddSignature(sig, sigtarget, sigtype, passPhrase); + (void) rpmAddSignature(sig, sigtarget, sigtype, passPhrase); } /* Reallocate the signature into one contiguous region. */ @@ -482,7 +487,7 @@ int writeRPM(Header *hdrp, const char *fileName, int type, lead.signature_type = RPMSIGTYPE_HEADERSIG; { const char *name, *version, *release; - headerNVR(h, &name, &version, &release); + (void) headerNVR(h, &name, &version, &release); sprintf(buf, "%s-%s-%s", name, version, release); strncpy(lead.name, buf, sizeof(lead.name)); } @@ -520,7 +525,7 @@ int writeRPM(Header *hdrp, const char *fileName, int type, } #ifdef NOTYET - headerMergeLegacySigs(nh, sig); + (void) headerMergeLegacySigs(nh, sig); #endif rc = headerWrite(fd, nh, HEADER_MAGIC_YES); @@ -557,22 +562,22 @@ exit: sig = NULL; } if (ifd) { - Fclose(ifd); + (void) Fclose(ifd); ifd = NULL; } if (fd) { - Fclose(fd); + (void) Fclose(fd); fd = NULL; } if (sigtarget) { - Unlink(sigtarget); + (void) Unlink(sigtarget); sigtarget = _free(sigtarget); } if (rc == 0) rpmMessage(RPMMESS_NORMAL, _("Wrote: %s\n"), fileName); else - Unlink(fileName); + (void) Unlink(fileName); return rc; } @@ -601,30 +606,30 @@ int packageBinaries(Spec spec) return rc; if (spec->cookie) { - headerAddEntry(pkg->header, RPMTAG_COOKIE, + (void) headerAddEntry(pkg->header, RPMTAG_COOKIE, RPM_STRING_TYPE, spec->cookie, 1); } /* Copy changelog from src rpm */ headerCopyTags(spec->packages->header, pkg->header, copyTags); - headerAddEntry(pkg->header, RPMTAG_RPMVERSION, + (void) headerAddEntry(pkg->header, RPMTAG_RPMVERSION, RPM_STRING_TYPE, VERSION, 1); - headerAddEntry(pkg->header, RPMTAG_BUILDHOST, + (void) headerAddEntry(pkg->header, RPMTAG_BUILDHOST, RPM_STRING_TYPE, buildHost(), 1); - headerAddEntry(pkg->header, RPMTAG_BUILDTIME, + (void) headerAddEntry(pkg->header, RPMTAG_BUILDTIME, RPM_INT32_TYPE, getBuildTime(), 1); providePackageNVR(pkg->header); { const char * optflags = rpmExpand("%{optflags}", NULL); - headerAddEntry(pkg->header, RPMTAG_OPTFLAGS, RPM_STRING_TYPE, + (void) headerAddEntry(pkg->header, RPMTAG_OPTFLAGS, RPM_STRING_TYPE, optflags, 1); optflags = _free(optflags); } - genSourceRpmName(spec); - headerAddEntry(pkg->header, RPMTAG_SOURCERPM, RPM_STRING_TYPE, + (void) genSourceRpmName(spec); + (void) headerAddEntry(pkg->header, RPMTAG_SOURCERPM, RPM_STRING_TYPE, spec->sourceRpmName, 1); { const char *binFormat = rpmGetPath("%{_rpmfilename}", NULL); @@ -634,7 +639,7 @@ int packageBinaries(Spec spec) binFormat = _free(binFormat); if (binRpm == NULL) { const char *name; - headerNVR(pkg->header, &name, NULL, NULL); + (void) headerNVR(pkg->header, &name, NULL, NULL); rpmError(RPMERR_BADFILENAME, _("Could not generate output " "filename for package %s: %s\n"), name, errorString); return RPMERR_BADFILENAME; @@ -684,14 +689,14 @@ int packageSources(Spec spec) int rc; /* Add some cruft */ - headerAddEntry(spec->sourceHeader, RPMTAG_RPMVERSION, + (void) headerAddEntry(spec->sourceHeader, RPMTAG_RPMVERSION, RPM_STRING_TYPE, VERSION, 1); - headerAddEntry(spec->sourceHeader, RPMTAG_BUILDHOST, + (void) headerAddEntry(spec->sourceHeader, RPMTAG_BUILDHOST, RPM_STRING_TYPE, buildHost(), 1); - headerAddEntry(spec->sourceHeader, RPMTAG_BUILDTIME, + (void) headerAddEntry(spec->sourceHeader, RPMTAG_BUILDTIME, RPM_INT32_TYPE, getBuildTime(), 1); - genSourceRpmName(spec); + (void) genSourceRpmName(spec); spec->cookie = _free(spec->cookie); diff --git a/build/parseChangelog.c b/build/parseChangelog.c index 19cb19e2c..00fe5d738 100644 --- a/build/parseChangelog.c +++ b/build/parseChangelog.c @@ -12,18 +12,18 @@ void addChangelogEntry(Header h, time_t time, const char *name, const char *text { int_32 mytime = time; /* XXX convert to header representation */ if (headerIsEntry(h, RPMTAG_CHANGELOGTIME)) { - headerAppendEntry(h, RPMTAG_CHANGELOGTIME, RPM_INT32_TYPE, + (void) headerAppendEntry(h, RPMTAG_CHANGELOGTIME, RPM_INT32_TYPE, &mytime, 1); - headerAppendEntry(h, RPMTAG_CHANGELOGNAME, RPM_STRING_ARRAY_TYPE, + (void) headerAppendEntry(h, RPMTAG_CHANGELOGNAME, RPM_STRING_ARRAY_TYPE, &name, 1); - headerAppendEntry(h, RPMTAG_CHANGELOGTEXT, RPM_STRING_ARRAY_TYPE, + (void) headerAppendEntry(h, RPMTAG_CHANGELOGTEXT, RPM_STRING_ARRAY_TYPE, &text, 1); } else { - headerAddEntry(h, RPMTAG_CHANGELOGTIME, RPM_INT32_TYPE, + (void) headerAddEntry(h, RPMTAG_CHANGELOGTIME, RPM_INT32_TYPE, &mytime, 1); - headerAddEntry(h, RPMTAG_CHANGELOGNAME, RPM_STRING_ARRAY_TYPE, + (void) headerAddEntry(h, RPMTAG_CHANGELOGNAME, RPM_STRING_ARRAY_TYPE, &name, 1); - headerAddEntry(h, RPMTAG_CHANGELOGTEXT, RPM_STRING_ARRAY_TYPE, + (void) headerAddEntry(h, RPMTAG_CHANGELOGTEXT, RPM_STRING_ARRAY_TYPE, &text, 1); } } @@ -52,7 +52,7 @@ static int dateToTimet(const char * datestr, /*@out@*/ time_t * secs) /* day of week */ p = pe; SKIPSPACE(p); if (*p == '\0') return -1; - pe = p; SKIPNONSPACE(pe); if (*pe) *pe++ = '\0'; + pe = p; SKIPNONSPACE(pe); if (*pe != '\0') *pe++ = '\0'; for (idx = days; *idx && strcmp(*idx, p); idx++) ; if (*idx == NULL) return -1; @@ -60,7 +60,7 @@ static int dateToTimet(const char * datestr, /*@out@*/ time_t * secs) /* month */ p = pe; SKIPSPACE(p); if (*p == '\0') return -1; - pe = p; SKIPNONSPACE(pe); if (*pe) *pe++ = '\0'; + pe = p; SKIPNONSPACE(pe); if (*pe != '\0') *pe++ = '\0'; for (idx = months; *idx && strcmp(*idx, p); idx++) ; if (*idx == NULL) return -1; @@ -69,7 +69,7 @@ static int dateToTimet(const char * datestr, /*@out@*/ time_t * secs) /* day */ p = pe; SKIPSPACE(p); if (*p == '\0') return -1; - pe = p; SKIPNONSPACE(pe); if (*pe) *pe++ = '\0'; + pe = p; SKIPNONSPACE(pe); if (*pe != '\0') *pe++ = '\0'; /* make this noon so the day is always right (as we make this UTC) */ time.tm_hour = 12; @@ -81,7 +81,7 @@ static int dateToTimet(const char * datestr, /*@out@*/ time_t * secs) /* year */ p = pe; SKIPSPACE(p); if (*p == '\0') return -1; - pe = p; SKIPNONSPACE(pe); if (*pe) *pe++ = '\0'; + pe = p; SKIPNONSPACE(pe); if (*pe != '\0') *pe++ = '\0'; time.tm_year = strtol(p, &q, 10); if (!(q && *q == '\0')) return -1; if (time.tm_year < 1997 || time.tm_year >= 3000) return -1; @@ -115,7 +115,7 @@ static int addChangelog(Header h, StringBuf sb) /* skip space */ SKIPSPACE(s); - while (*s) { + while (*s != '\0') { if (*s != '*') { rpmError(RPMERR_BADSPEC, _("%%changelog entries must start with *\n")); @@ -129,7 +129,9 @@ static int addChangelog(Header h, StringBuf sb) rpmError(RPMERR_BADSPEC, _("incomplete %%changelog entry\n")); return RPMERR_BADSPEC; } + /*@-modobserver@*/ *s = '\0'; + /*@=modobserver@*/ text = s + 1; /* 4 fields of date */ @@ -160,7 +162,7 @@ static int addChangelog(Header h, StringBuf sb) /* name */ name = s; - while (*s) s++; + while (*s != '\0') s++; while (s > name && xisspace(*s)) { *s-- = '\0'; } diff --git a/build/parseDescription.c b/build/parseDescription.c index f7052e2df..9dad041d7 100644 --- a/build/parseDescription.c +++ b/build/parseDescription.c @@ -118,7 +118,7 @@ int parseDescription(Spec spec) stripTrailingBlanksStringBuf(sb); if (!(noLang && strcmp(lang, RPMBUILD_DEFAULT_LANG))) { - headerAddI18NString(pkg->header, RPMTAG_DESCRIPTION, + (void) headerAddI18NString(pkg->header, RPMTAG_DESCRIPTION, getStringBuf(sb), lang); } diff --git a/build/parsePreamble.c b/build/parsePreamble.c index 73b5de67a..c97843be0 100644 --- a/build/parsePreamble.c +++ b/build/parsePreamble.c @@ -50,9 +50,9 @@ static void addOrAppendListEntry(Header h, int_32 tag, char *line) int argc; const char **argv; - poptParseArgvString(line, &argc, &argv); + (void) poptParseArgvString(line, &argc, &argv); if (argc) - headerAddOrAppendEntry(h, tag, RPM_STRING_ARRAY_TYPE, argv, argc); + (void) headerAddOrAppendEntry(h, tag, RPM_STRING_ARRAY_TYPE, argv, argc); argv = _free(argv); } @@ -139,7 +139,7 @@ static int parseBits(const char * s, const tokenBits tokbits, int c = 0; if (s) { - while (*s) { + while (*s != '\0') { while ((c = *s) && xisspace(c)) s++; se = s; while ((c = *se) && xisalpha(c)) se++; @@ -158,7 +158,7 @@ static int parseBits(const char * s, const tokenBits tokbits, s = ++se; } } - if (c == 0 && *bp) *bp = bits; + if (c == 0 && bp) *bp = bits; return (c ? RPMERR_BADSPEC : 0); } @@ -168,13 +168,15 @@ static inline char * findLastChar(char * s) { char *res = s; - while (*s) { + while (*s != '\0') { if (! xisspace(*s)) res = s; s++; } + /*@-temptrans@*/ return res; + /*@=temptrans@*/ } /** @@ -304,7 +306,7 @@ static void fillOutMainPackage(Header h) if (!headerIsEntry(h, ot->ot_tag)) { const char *val = rpmExpand(ot->ot_mac, NULL); if (val && *val != '%') - headerAddEntry(h, ot->ot_tag, RPM_STRING_TYPE, (void *)val, 1); + (void) headerAddEntry(h, ot->ot_tag, RPM_STRING_TYPE, (void *)val, 1); val = _free(val); } } @@ -334,7 +336,7 @@ static int readIcon(Header h, const char *file) size = fdSize(fd); iconsize = (size >= 0 ? size : (8 * BUFSIZ)); if (iconsize == 0) { - Fclose(fd); + (void) Fclose(fd); rc = 0; goto exit; } @@ -348,14 +350,14 @@ static int readIcon(Header h, const char *file) fn, Fstrerror(fd)); rc = RPMERR_BADSPEC; } - Fclose(fd); + (void) Fclose(fd); if (rc) goto exit; if (! strncmp(icon, "GIF", sizeof("GIF")-1)) { - headerAddEntry(h, RPMTAG_GIF, RPM_BIN_TYPE, icon, iconsize); + (void) headerAddEntry(h, RPMTAG_GIF, RPM_BIN_TYPE, icon, iconsize); } else if (! strncmp(icon, "/* XPM", sizeof("/* XPM")-1)) { - headerAddEntry(h, RPMTAG_XPM, RPM_BIN_TYPE, icon, iconsize); + (void) headerAddEntry(h, RPMTAG_XPM, RPM_BIN_TYPE, icon, iconsize); } else { rpmError(RPMERR_BADSPEC, _("Unknown icon type: %s\n"), file); rc = RPMERR_BADSPEC; @@ -395,7 +397,9 @@ stashSt(Spec spec, Header h, int tag, const char *lang) } } } + /*@-usereleased -compdef@*/ return t; + /*@=usereleased =compdef@*/ } #define SINGLE_TOKEN_ONLY \ @@ -446,7 +450,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, /* See if this is multi-token */ end = field; SKIPNONSPACE(end); - if (*end) + if (*end != '\0') multiToken = 1; switch (tag) { @@ -471,7 +475,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, } addMacro(spec->macros, "PACKAGE_RELEASE", NULL, field, RMIL_OLDSPEC-1); } - headerAddEntry(pkg->header, tag, RPM_STRING_TYPE, field, 1); + (void) headerAddEntry(pkg->header, tag, RPM_STRING_TYPE, field, 1); break; case RPMTAG_GROUP: case RPMTAG_SUMMARY: @@ -482,9 +486,9 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, case RPMTAG_LICENSE: case RPMTAG_PACKAGER: if (!*lang) - headerAddEntry(pkg->header, tag, RPM_STRING_TYPE, field, 1); + (void) headerAddEntry(pkg->header, tag, RPM_STRING_TYPE, field, 1); else if (!(noLang && strcmp(lang, RPMBUILD_DEFAULT_LANG))) - headerAddI18NString(pkg->header, tag, field, lang); + (void) headerAddI18NString(pkg->header, tag, field, lang); break; case RPMTAG_BUILDROOT: SINGLE_TOKEN_ONLY; @@ -530,7 +534,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, } break; case RPMTAG_PREFIXES: addOrAppendListEntry(pkg->header, tag, field); - hge(pkg->header, tag, &type, (void **)&array, &num); + (void) hge(pkg->header, tag, &type, (void **)&array, &num); while (num--) { len = strlen(array[num]); if (array[num][len - 1] == '/' && len > 1) { @@ -563,7 +567,7 @@ static int handlePreambleTag(Spec spec, Package pkg, int tag, const char *macro, spec->lineNum, spec->line); return RPMERR_BADSPEC; } - headerAddEntry(pkg->header, tag, RPM_INT32_TYPE, &num, 1); + (void) headerAddEntry(pkg->header, tag, RPM_INT32_TYPE, &num, 1); break; case RPMTAG_AUTOREQPROV: pkg->autoReq = parseYesNo(field); @@ -768,7 +772,9 @@ static int findPreambleTag(Spec spec, /*@out@*/int *tag, /*@out@*/char **macro, *tag = p->tag; if (macro) + /*@-onlytrans@*/ *macro = p->token; + /*@=onlytrans@*/ return 0; } @@ -803,11 +809,11 @@ int parsePreamble(Spec spec, int initialPackage) /* Construct the package */ if (flag == PART_SUBNAME) { const char * mainName; - headerNVR(spec->packages->header, &mainName, NULL, NULL); + (void) headerNVR(spec->packages->header, &mainName, NULL, NULL); sprintf(fullName, "%s-%s", mainName, name); } else strcpy(fullName, name); - headerAddEntry(pkg->header, RPMTAG_NAME, RPM_STRING_TYPE, fullName, 1); + (void) headerAddEntry(pkg->header, RPMTAG_NAME, RPM_STRING_TYPE, fullName, 1); } if ((rc = readLine(spec, STRIP_TRAILINGSPACE | STRIP_COMMENTS)) > 0) { @@ -819,7 +825,7 @@ int parsePreamble(Spec spec, int initialPackage) /* Skip blank lines */ linep = spec->line; SKIPSPACE(linep); - if (*linep) { + if (*linep != '\0') { if (findPreambleTag(spec, &tag, ¯o, lang)) { rpmError(RPMERR_BADSPEC, _("line %d: Unknown tag: %s\n"), spec->lineNum, spec->line); diff --git a/build/parsePrep.c b/build/parsePrep.c index cd61a2f0c..36ddf390b 100644 --- a/build/parsePrep.c +++ b/build/parsePrep.c @@ -295,8 +295,8 @@ static int doSetupMacro(Spec spec, char *line) /* We only parse -a and -b here */ if (parseNum(optArg, &num)) { - rpmError(RPMERR_BADSPEC, _("line %d: Bad arg to %%setup %c: %s\n"), - spec->lineNum, num, optArg); + rpmError(RPMERR_BADSPEC, _("line %d: Bad arg to %%setup: %s\n"), + spec->lineNum, optArg); freeStringBuf(before); freeStringBuf(after); poptFreeContext(optCon); @@ -328,7 +328,7 @@ static int doSetupMacro(Spec spec, char *line) spec->buildSubdir = xstrdup(dirName); } else { const char *name, *version; - headerNVR(spec->packages->header, &name, &version, NULL); + (void) headerNVR(spec->packages->header, &name, &version, NULL); sprintf(buf, "%s-%s", name, version); spec->buildSubdir = xstrdup(buf); } @@ -548,6 +548,7 @@ int parsePrep(Spec spec) } saveLines = splitString(getStringBuf(buf), strlen(getStringBuf(buf)), '\n'); + /*@-usereleased@*/ for (lines = saveLines; *lines; lines++) { res = 0; if (! strncmp(*lines, "%setup", sizeof("%setup")-1)) { @@ -563,6 +564,7 @@ int parsePrep(Spec spec) return res; } } + /*@=usereleased@*/ freeSplitString(saveLines); freeStringBuf(buf); diff --git a/build/parseReqs.c b/build/parseReqs.c index 5e2f1ab1c..d58b95892 100644 --- a/build/parseReqs.c +++ b/build/parseReqs.c @@ -87,7 +87,7 @@ int parseRCPOT(Spec spec, Package pkg, const char *field, int tag, break; } - for (r = field; *r; r = re) { + for (r = field; *r != '\0'; r = re) { SKIPWHITE(r); if (*r == '\0') break; @@ -152,7 +152,7 @@ int parseRCPOT(Spec spec, Package pkg, const char *field, int tag, case RPMTAG_OBSOLETEFLAGS: /* Add prereq on rpmlib that has versioned dependencies. */ if (!rpmExpandNumeric("%{_noVersionedDependencies}")) - rpmlibNeedsFeature(h, "VersionedDependencies", "3.0.3-1"); + (void) rpmlibNeedsFeature(h, "VersionedDependencies", "3.0.3-1"); break; default: break; @@ -181,7 +181,7 @@ int parseRCPOT(Spec spec, Package pkg, const char *field, int tag, } else version = NULL; - addReqProv(spec, h, flags, req, version, index); + (void) addReqProv(spec, h, flags, req, version, index); req = _free(req); version = _free(version); diff --git a/build/parseScript.c b/build/parseScript.c index 6476f997c..4e2717495 100644 --- a/build/parseScript.c +++ b/build/parseScript.c @@ -8,6 +8,8 @@ #include "rpmbuild.h" #include "debug.h" +/*@access StringBuf@*/ /* XXX compared with NULL */ + /** */ static int addTriggerIndex(Package pkg, const char *file, const char *script, const char *prog) @@ -29,7 +31,7 @@ static int addTriggerIndex(Package pkg, const char *file, const char *script, co new = xmalloc(sizeof(*new)); new->fileName = (file) ? xstrdup(file) : NULL; - new->script = (*script) ? xstrdup(script) : NULL; + new->script = (script && *script != '\0') ? xstrdup(script) : NULL; new->prog = xstrdup(prog); new->index = index; new->next = NULL; @@ -246,7 +248,7 @@ int parseScript(Spec spec, int parsePart) stripTrailingBlanksStringBuf(sb); p = getStringBuf(sb); - addReqProv(spec, pkg->header, (tagflags | RPMSENSE_INTERP), progArgv[0], NULL, 0); + (void) addReqProv(spec, pkg->header, (tagflags | RPMSENSE_INTERP), progArgv[0], NULL, 0); /* Trigger script insertion is always delayed in order to */ /* get the index right. */ @@ -259,14 +261,14 @@ int parseScript(Spec spec, int parsePart) goto exit; } else { if (progArgc == 1) - headerAddEntry(pkg->header, progtag, RPM_STRING_TYPE, + (void) headerAddEntry(pkg->header, progtag, RPM_STRING_TYPE, *progArgv, progArgc); else - headerAddEntry(pkg->header, progtag, RPM_STRING_ARRAY_TYPE, + (void) headerAddEntry(pkg->header, progtag, RPM_STRING_ARRAY_TYPE, progArgv, progArgc); - if (*p) - headerAddEntry(pkg->header, tag, RPM_STRING_TYPE, p, 1); + if (*p != '\0') + (void) headerAddEntry(pkg->header, tag, RPM_STRING_TYPE, p, 1); if (file) { switch (parsePart) { @@ -291,7 +293,7 @@ int parseScript(Spec spec, int parsePart) rc = nextPart; exit: - if (sb) + if (sb != NULL) freeStringBuf(sb); progArgv = _free(progArgv); argv = _free(argv); diff --git a/build/parseSpec.c b/build/parseSpec.c index d81d23222..40313873f 100644 --- a/build/parseSpec.c +++ b/build/parseSpec.c @@ -75,7 +75,7 @@ static int matchTok(const char *token, const char *line) size_t toklen = strlen(token); int rc = 0; - while ( *(b = be) ) { + while ( *(b = be) != '\0' ) { SKIPSPACE(b); be = b; SKIPNONSPACE(be); @@ -152,7 +152,7 @@ static int copyNextLine(Spec spec, OFI_t *ofi, int strip) } /* Save 1st char of next line in order to terminate current line. */ - if (*spec->nextline) { + if (*spec->nextline != '\0') { spec->nextpeekc = *spec->nextline; *spec->nextline = '\0'; } @@ -202,7 +202,7 @@ retry: /* remove this file from the stack */ spec->fileStack = ofi->next; - Fclose(ofi->fd); + (void) Fclose(ofi->fd); ofi->fileName = _free(ofi->fileName); ofi = _free(ofi); @@ -345,7 +345,7 @@ void closeSpec(Spec spec) while (spec->fileStack) { ofi = spec->fileStack; spec->fileStack = spec->fileStack->next; - if (ofi->fd) Fclose(ofi->fd); + if (ofi->fd) (void) Fclose(ofi->fd); ofi->fileName = _free(ofi->fileName); ofi = _free(ofi); } @@ -546,15 +546,15 @@ fprintf(stderr, "*** PS buildRootURL(%s) %p macro set to %s\n", spec->buildRootU for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { if (!headerIsEntry(pkg->header, RPMTAG_DESCRIPTION)) { const char * name; - headerNVR(pkg->header, &name, NULL, NULL); + (void) headerNVR(pkg->header, &name, NULL, NULL); rpmError(RPMERR_BADSPEC, _("Package has no %%description: %s\n"), name); freeSpec(spec); return RPMERR_BADSPEC; } - headerAddEntry(pkg->header, RPMTAG_OS, RPM_STRING_TYPE, os, 1); - headerAddEntry(pkg->header, RPMTAG_ARCH, RPM_STRING_TYPE, arch, 1); + (void) headerAddEntry(pkg->header, RPMTAG_OS, RPM_STRING_TYPE, os, 1); + (void) headerAddEntry(pkg->header, RPMTAG_ARCH, RPM_STRING_TYPE, arch, 1); } #ifdef DYING myos = _free(myos); diff --git a/build/reqprov.c b/build/reqprov.c index 6eeb80ec7..efba0b377 100644 --- a/build/reqprov.c +++ b/build/reqprov.c @@ -62,17 +62,17 @@ int addReqProv(/*@unused@*/ Spec spec, Header h, /* Check for duplicate dependencies. */ if (hge(h, nametag, &dnt, (void **) &names, &len)) { const char ** versions = NULL; - int dvt; + int dvt = RPM_STRING_ARRAY_TYPE; int *flags = NULL; int *indexes = NULL; int duplicate = 0; if (flagtag) { - hge(h, versiontag, &dvt, (void **) &versions, NULL); - hge(h, flagtag, NULL, (void **) &flags, NULL); + (void) hge(h, versiontag, &dvt, (void **) &versions, NULL); + (void) hge(h, flagtag, NULL, (void **) &flags, NULL); } if (indextag) - hge(h, indextag, NULL, (void **) &indexes, NULL); + (void) hge(h, indextag, NULL, (void **) &indexes, NULL); while (len > 0) { len--; @@ -101,15 +101,15 @@ int addReqProv(/*@unused@*/ Spec spec, Header h, } /* Add this dependency. */ - headerAddOrAppendEntry(h, nametag, RPM_STRING_ARRAY_TYPE, &depName, 1); + (void) headerAddOrAppendEntry(h, nametag, RPM_STRING_ARRAY_TYPE, &depName, 1); if (flagtag) { - headerAddOrAppendEntry(h, versiontag, + (void) headerAddOrAppendEntry(h, versiontag, RPM_STRING_ARRAY_TYPE, &depEVR, 1); - headerAddOrAppendEntry(h, flagtag, + (void) headerAddOrAppendEntry(h, flagtag, RPM_INT32_TYPE, &depFlags, 1); } if (indextag) - headerAddOrAppendEntry(h, indextag, RPM_INT32_TYPE, &index, 1); + (void) headerAddOrAppendEntry(h, indextag, RPM_INT32_TYPE, &index, 1); return 0; } diff --git a/build/spec.c b/build/spec.c index 153ad2e15..12b0c5b37 100644 --- a/build/spec.c +++ b/build/spec.c @@ -63,26 +63,30 @@ int lookupPackage(Spec spec, const char *name, int flag, /*@out@*/Package *pkg) /* Construct package name */ { char *n; if (flag == PART_SUBNAME) { - headerNVR(spec->packages->header, &pname, NULL, NULL); + (void) headerNVR(spec->packages->header, &pname, NULL, NULL); fullName = n = alloca(strlen(pname) + 1 + strlen(name) + 1); - while (*pname) *n++ = *pname++; + while (*pname != '\0') *n++ = *pname++; *n++ = '-'; } else { fullName = n = alloca(strlen(name)+1); } + /*@-mayaliasunique@*/ strcpy(n, name); + /*@=mayaliasunique@*/ } /* Locate package with fullName */ for (p = spec->packages; p != NULL; p = p->next) { - headerNVR(p->header, &pname, NULL, NULL); + (void) headerNVR(p->header, &pname, NULL, NULL); if (pname && (! strcmp(fullName, pname))) { break; } } if (pkg) + /*@-dependenttrans@*/ *pkg = p; + /*@=dependenttrans@*/ return ((p == NULL) ? 1 : 0); } @@ -168,7 +172,9 @@ void freePackages(Spec spec) Package p; while ((p = spec->packages) != NULL) { + /*@-dependenttrans@*/ spec->packages = p->next; + /*@=dependenttrans@*/ p->next = NULL; freePackage(p); } @@ -204,7 +210,7 @@ int parseNoSource(Spec spec, const char *field, int tag) } fe = field; - for (f = fe; *f; f = fe) { + for (f = fe; *f != '\0'; f = fe) { struct Source *p; SKIPWHITE(f); @@ -212,7 +218,7 @@ int parseNoSource(Spec spec, const char *field, int tag) break; fe = f; SKIPNONWHITE(fe); - if (*fe) fe++; + if (*fe != '\0') fe++; if (parseNum(f, &num)) { rpmError(RPMERR_BADSPEC, _("line %d: Bad number: %s\n"), @@ -345,7 +351,9 @@ static inline void freeSl(/*@only@*/struct speclines *sl) if (sl == NULL) return; for (i = 0; i < sl->sl_nlines; i++) + /*@-unqualifiedtrans@*/ sl->sl_lines[i] = _free(sl->sl_lines[i]); + /*@=unqualifiedtrans@*/ sl->sl_lines = _free(sl->sl_lines); sl = _free(sl); } @@ -466,7 +474,9 @@ void freeSpec(/*@only@*/ Spec spec) while (spec->readStack) { rl = spec->readStack; + /*@-dependenttrans@*/ spec->readStack = rl->next; + /*@=dependenttrans@*/ rl->next = NULL; rl = _free(rl); } @@ -488,10 +498,14 @@ void freeSpec(/*@only@*/ Spec spec) if (!spec->inBuildArchitectures) { while (spec->buildArchitectureCount--) { + /*@-unqualifiedtrans@*/ freeSpec( spec->buildArchitectureSpecs[spec->buildArchitectureCount]); + /*@=unqualifiedtrans@*/ } + /*@-compdef@*/ spec->buildArchitectureSpecs = _free(spec->buildArchitectureSpecs); + /*@=compdef@*/ } spec->buildArchitectures = _free(spec->buildArchitectures); diff --git a/lib/.lclintrc b/lib/.lclintrc index 98a171fe1..7aa8dd046 100644 --- a/lib/.lclintrc +++ b/lib/.lclintrc @@ -11,22 +11,16 @@ -unrecogcomments # don't-bother-me-yet parameters --branchstate # ~142 occurences, painful -#-immediatetrans --mustfree # ~529 alloca is painful -#-observertrans -#-statictrans +-branchstate # ~140 painful +-mustfree # ~588 alloca is painful # not-yet normal parameters --boolops # w->n -#-fixedformalarray # md5 whines --null --predboolint # w->n -#-predboolothers # w->n --retvalint # w->n --type +-boolops # ~831 w->n +#-null # ~267 +-predboolint # ~576 w->n +-type # ~872 -# not-yet -weak paramaters +# -weak paramaters #+boolint #-boolops #+ignorequals diff --git a/lib/Makefile.am b/lib/Makefile.am index e3ea50581..f68c13693 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -57,9 +57,9 @@ getdate.c: getdate.y @echo expect 10 shift/reduce conflicts $(YACC) $(srcdir)/getdate.y -@if test -f y.tab.c; then \ - { echo "/*@-unqualifiedtrans -usedef -varuse -globstate@*/";\ + { echo "/*@-globstate -retvalint -unqualifiedtrans -usedef -varuse@*/";\ cat y.tab.c ;\ - echo "/*@=unqualifiedtrans =usedef =varuse =globstate@*/";\ + echo "/*@=globstate =retvalint =unqualifiedtrans =usedef =varuse@*/";\ } > getdate.c ;\ rm -f y.tab.c; \ else \ @@ -16,8 +16,8 @@ static int _debug = 1; /* XXX if < 0 debugging, > 0 unusual error returns */ #endif #endif -#define DB_VERSION_MAJOR 0 -#define DB_VERSION_MINOR 0 +#define DB_VERSION_MAJOR 1 +#define DB_VERSION_MINOR 85 #define DB_VERSION_PATCH 0 #define _mymemset(_a, _b, _c) @@ -145,6 +145,16 @@ static void * doGetRecord(FD_t pkgs, unsigned int offset) h = headerRead(pkgs, HEADER_MAGIC_NO); + /* let's sanity check this record a bit, otherwise just skip it */ + if (!(headerIsEntry(h, RPMTAG_NAME) && + headerIsEntry(h, RPMTAG_VERSION) && + headerIsEntry(h, RPMTAG_RELEASE) && + headerIsEntry(h, RPMTAG_BUILDTIME))) + { + headerFree(h); + h = NULL; + } + if (h == NULL) goto exit; @@ -184,7 +194,7 @@ static void * doGetRecord(FD_t pkgs, unsigned int offset) free(fileNames); - headerModifyEntry(h, RPMTAG_OLDFILENAMES, RPM_STRING_ARRAY_TYPE, + (void) headerModifyEntry(h, RPMTAG_OLDFILENAMES, RPM_STRING_ARRAY_TYPE, newFileNames, fileCount); } @@ -269,8 +279,11 @@ static int db1cget(dbiIndex dbi, /*@unused@*/ DBC * dbcursor, void ** keyp, } else { /* XXX simulated retrieval */ data.data = doGetRecord(pkgs, offset); data.size = 0; /* XXX WRONG */ - if (data.data == NULL) + if (data.data == NULL) { +if (keyp) *keyp = key.data; +if (keylen) *keylen = key.size; rc = EFAULT; + } } } else { DB * db; @@ -484,7 +497,7 @@ exit: dbi->dbi_vec = &db1vec; *dbip = dbi; } else - db1close(dbi, 0); + (void) db1close(dbi, 0); base = _free(base); urlfn = _free(urlfn); @@ -565,7 +565,7 @@ static int db3close(/*@only@*/ dbiIndex dbi, /*@unused@*/ unsigned int flags) #if defined(__USE_DB2) || defined(__USE_DB3) if (dbi->dbi_rmw) - db3cclose(dbi, NULL, 0); + rc = db3cclose(dbi, NULL, 0); if (db) { rc = db->close(db, 0); @@ -834,7 +834,7 @@ static int db3open(/*@keep@*/ rpmdb rpmdb, int rpmtag, dbiIndex * dbip) dbi->dbi_vec = &db3vec; *dbip = dbi; } else - db3close(dbi, 0); + (void) db3close(dbi, 0); urlfn = _free(urlfn); diff --git a/lib/depends.c b/lib/depends.c index f52e9d984..e9a26f1e8 100644 --- a/lib/depends.c +++ b/lib/depends.c @@ -259,7 +259,7 @@ static /*@exposed@*/ struct availablePackage * alAddPackage(struct availableList memset(&p->tsi, 0, sizeof(p->tsi)); p->multiLib = 0; /* MULTILIB */ - headerNVR(p->h, &p->name, &p->version, &p->release); + (void) headerNVR(p->h, &p->name, &p->version, &p->release); /* XXX This should be added always so that packages look alike. * XXX However, there is logic in files.c/depends.c that checks for @@ -275,7 +275,7 @@ static /*@exposed@*/ struct availablePackage * alAddPackage(struct availableList (void **) &pp, NULL) && !rpmVersionCompare(p->h, al->list[i].h) && *pp && !(*pp & multiLibMask)) - p->multiLib = multiLibMask; + p->multiLib = multiLibMask; } } @@ -312,14 +312,14 @@ static /*@exposed@*/ struct availablePackage * alAddPackage(struct availableList p->requireFlags = NULL; } - if (!hge(h, RPMTAG_BASENAMES, &bnt, (void **) &p->baseNames, &p->filesCount)) + if (!hge(h, RPMTAG_BASENAMES, &bnt, (void **)&p->baseNames, &p->filesCount)) { p->filesCount = 0; p->baseNames = NULL; } else { - hge(h, RPMTAG_DIRNAMES, &dnt, (void **) &dirNames, &numDirs); - hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); - hge(h, RPMTAG_FILEFLAGS, NULL, (void **) &fileFlags, NULL); + (void) hge(h, RPMTAG_DIRNAMES, &dnt, (void **) &dirNames, &numDirs); + (void) hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); + (void) hge(h, RPMTAG_FILEFLAGS, NULL, (void **) &fileFlags, NULL); /* XXX FIXME: We ought to relocate the directory list here */ @@ -608,7 +608,6 @@ static int rangeMatchesDepFlags (Header h, const char *reqName, const char * req int_32 * provideFlags; int providesCount; int result; - int type; int i; if (!(reqFlags & RPMSENSE_SENSEMASK) || !reqEVR || !strlen(reqEVR)) @@ -623,7 +622,7 @@ static int rangeMatchesDepFlags (Header h, const char *reqName, const char * req (void **) &providesEVR, &providesCount)) return 1; - hge(h, RPMTAG_PROVIDEFLAGS, &type, (void **) &provideFlags, &providesCount); + (void) hge(h, RPMTAG_PROVIDEFLAGS, NULL, (void **) &provideFlags, NULL); if (!hge(h, RPMTAG_PROVIDENAME, &pnt, (void **) &provides, &providesCount)) { @@ -666,7 +665,7 @@ int headerMatchesDepFlags(Header h, return 1; /* Get package information from header */ - headerNVR(h, &name, &version, &release); + (void) headerNVR(h, &name, &version, &release); pkgEVR = p = alloca(21 + strlen(version) + 1 + strlen(release) + 1); *p = '\0'; @@ -789,7 +788,7 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h, FD_t fd, if (headerIsEntry(h, RPMTAG_SOURCEPACKAGE)) return 0; - headerNVR(h, &name, NULL, NULL); + (void) headerNVR(h, &name, NULL, NULL); { rpmdbMatchIterator mi; Header h2; @@ -815,12 +814,14 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h, FD_t fd, } if (hge(h, RPMTAG_OBSOLETENAME, &ont, (void **) &obsoletes, &count)) { - const char **obsoletesEVR; - int_32 *obsoletesFlags; + const char ** obsoletesEVR; + int_32 * obsoletesFlags; int j; - hge(h, RPMTAG_OBSOLETEVERSION, &ovt, (void **) &obsoletesEVR, NULL); - hge(h, RPMTAG_OBSOLETEFLAGS, NULL, (void **) &obsoletesFlags, NULL); + (void) hge(h, RPMTAG_OBSOLETEVERSION, &ovt, (void **) &obsoletesEVR, + NULL); + (void) hge(h, RPMTAG_OBSOLETEFLAGS, NULL, (void **) &obsoletesFlags, + NULL); for (j = 0; j < count; j++) { @@ -833,7 +834,7 @@ int rpmtransAddPackage(rpmTransactionSet ts, Header h, FD_t fd, mi = rpmdbInitIterator(ts->rpmdb, RPMTAG_NAME, obsoletes[j], 0); - rpmdbPruneIterator(mi, + (void) rpmdbPruneIterator(mi, ts->removedPackages, ts->numRemovedPackages, 1); while((h2 = rpmdbNextIterator(mi)) != NULL) { @@ -1114,7 +1115,7 @@ static int unsatisfiedDepend(rpmTransactionSet ts, mi = rpmdbInitIterator(ts->rpmdb, RPMTAG_BASENAMES, keyName, 0); - rpmdbPruneIterator(mi, + (void) rpmdbPruneIterator(mi, ts->removedPackages, ts->numRemovedPackages, 1); while ((h = rpmdbNextIterator(mi)) != NULL) { @@ -1127,7 +1128,7 @@ static int unsatisfiedDepend(rpmTransactionSet ts, } mi = rpmdbInitIterator(ts->rpmdb, RPMTAG_PROVIDENAME, keyName, 0); - rpmdbPruneIterator(mi, + (void) rpmdbPruneIterator(mi, ts->removedPackages, ts->numRemovedPackages, 1); while ((h = rpmdbNextIterator(mi)) != NULL) { if (rangeMatchesDepFlags(h, keyName, keyEVR, keyFlags)) { @@ -1141,7 +1142,7 @@ static int unsatisfiedDepend(rpmTransactionSet ts, #ifndef DYING mi = rpmdbInitIterator(ts->rpmdb, RPMTAG_NAME, keyName, 0); - rpmdbPruneIterator(mi, + (void) rpmdbPruneIterator(mi, ts->removedPackages, ts->numRemovedPackages, 1); while ((h = rpmdbNextIterator(mi)) != NULL) { if (rangeMatchesDepFlags(h, keyName, keyEVR, keyFlags)) { @@ -1213,17 +1214,15 @@ static int checkPackageDeps(rpmTransactionSet ts, struct problemsSet * psp, int ourrc = 0; struct availablePackage * suggestion; - headerNVR(h, &name, &version, &release); + (void) headerNVR(h, &name, &version, &release); if (!hge(h, RPMTAG_REQUIRENAME, &rnt, (void **) &requires, &requiresCount)) { requiresCount = 0; rvt = RPM_STRING_ARRAY_TYPE; } else { - hge(h, RPMTAG_REQUIREFLAGS, &type, (void **) &requireFlags, - &requiresCount); - hge(h, RPMTAG_REQUIREVERSION, &rvt, - (void **) &requiresEVR, &requiresCount); + (void)hge(h, RPMTAG_REQUIREFLAGS, NULL, (void **) &requireFlags, NULL); + (void)hge(h, RPMTAG_REQUIREVERSION, &rvt, (void **) &requiresEVR, NULL); } for (i = 0; i < requiresCount && !ourrc; i++) { @@ -1289,9 +1288,9 @@ static int checkPackageDeps(rpmTransactionSet ts, struct problemsSet * psp, conflictsCount = 0; cvt = RPM_STRING_ARRAY_TYPE; } else { - hge(h, RPMTAG_CONFLICTFLAGS, &type, + (void) hge(h, RPMTAG_CONFLICTFLAGS, &type, (void **) &conflictFlags, &conflictsCount); - hge(h, RPMTAG_CONFLICTVERSION, &cvt, + (void) hge(h, RPMTAG_CONFLICTVERSION, &cvt, (void **) &conflictsEVR, &conflictsCount); } @@ -1363,7 +1362,8 @@ static int checkPackageSet(rpmTransactionSet ts, struct problemsSet * psp, Header h; int rc = 0; - rpmdbPruneIterator(mi, ts->removedPackages, ts->numRemovedPackages, 1); + (void) rpmdbPruneIterator(mi, + ts->removedPackages, ts->numRemovedPackages, 1); while ((h = rpmdbNextIterator(mi)) != NULL) { if (checkPackageDeps(ts, psp, h, key, 0)) { rc = 1; @@ -1972,11 +1972,12 @@ int rpmdepCheck(rpmTransactionSet ts, */ if (ts->numRemovedPackages > 0) { mi = rpmdbInitIterator(ts->rpmdb, RPMDBI_PACKAGES, NULL, 0); - rpmdbAppendIterator(mi, ts->removedPackages, ts->numRemovedPackages); + (void) rpmdbAppendIterator(mi, + ts->removedPackages, ts->numRemovedPackages); while ((h = rpmdbNextIterator(mi)) != NULL) { { const char * name, * version, * release; - headerNVR(h, &name, &version, &release); + (void) headerNVR(h, &name, &version, &release); rpmMessage(RPMMESS_DEBUG, ("========== --- %s-%s-%s\n"), name, version, release); @@ -2016,8 +2017,9 @@ int rpmdepCheck(rpmTransactionSet ts, if (hge(h, RPMTAG_BASENAMES, &bnt, (void **) &baseNames, &fileCount)) { - hge(h, RPMTAG_DIRNAMES, &dnt, (void **) &dirNames, NULL); - hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); + (void) hge(h, RPMTAG_DIRNAMES, &dnt, (void **) &dirNames, NULL); + (void) hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, + NULL); rc = 0; for (j = 0; j < fileCount; j++) { len = strlen(baseNames[j]) + 1 + diff --git a/lib/falloc.c b/lib/falloc.c index 55387c623..c882079ea 100644 --- a/lib/falloc.c +++ b/lib/falloc.c @@ -76,7 +76,7 @@ FD_t fadOpen(const char * path, int flags, mode_t perms) newHdr.magic = FA_MAGIC; newHdr.firstFree = 0; if (Fwrite(&newHdr, sizeof(char), sizeof(newHdr), fd) != sizeof(newHdr)) { - Fclose(fd); + (void) Fclose(fd); return NULL; } fadSetFirstFree(fd, 0); @@ -84,18 +84,18 @@ FD_t fadOpen(const char * path, int flags, mode_t perms) } else { memset(&newHdr, 0, sizeof(newHdr)); if (Pread(fd, &newHdr, sizeof(newHdr), 0) != sizeof(newHdr)) { - Fclose(fd); + (void) Fclose(fd); return NULL; } if (newHdr.magic != FA_MAGIC) { - Fclose(fd); + (void) Fclose(fd); return NULL; } fadSetFirstFree(fd, newHdr.firstFree); fadSetFileSize(fd, Fseek(fd, 0, SEEK_END)); if (fadGetFileSize(fd) < 0) { - Fclose(fd); + (void) Fclose(fd); return NULL; } } diff --git a/lib/formats.c b/lib/formats.c index 43c35804d..97a58d4f2 100644 --- a/lib/formats.c +++ b/lib/formats.c @@ -280,10 +280,10 @@ static int triggercondsTag(Header h, /*@out@*/ int_32 * type, return 0; } - hge(h, RPMTAG_TRIGGERINDEX, NULL, (void **) &indices, NULL); - hge(h, RPMTAG_TRIGGERFLAGS, NULL, (void **) &flags, NULL); - hge(h, RPMTAG_TRIGGERVERSION, &tvt, (void **) &versions, NULL); - hge(h, RPMTAG_TRIGGERSCRIPTS, &tst, (void **) &s, &numScripts); + (void) hge(h, RPMTAG_TRIGGERINDEX, NULL, (void **) &indices, NULL); + (void) hge(h, RPMTAG_TRIGGERFLAGS, NULL, (void **) &flags, NULL); + (void) hge(h, RPMTAG_TRIGGERVERSION, &tvt, (void **) &versions, NULL); + (void) hge(h, RPMTAG_TRIGGERSCRIPTS, &tst, (void **) &s, &numScripts); s = hfd(s, tst); *freeData = 1; @@ -348,8 +348,8 @@ static int triggertypeTag(Header h, /*@out@*/ int_32 * type, return 1; } - hge(h, RPMTAG_TRIGGERFLAGS, NULL, (void **) &flags, NULL); - hge(h, RPMTAG_TRIGGERSCRIPTS, &tst, (void **) &s, &numScripts); + (void) hge(h, RPMTAG_TRIGGERFLAGS, NULL, (void **) &flags, NULL); + (void) hge(h, RPMTAG_TRIGGERSCRIPTS, &tst, (void **) &s, &numScripts); s = hfd(s, tst); *freeData = 1; @@ -435,7 +435,7 @@ static int i18nTag(Header h, int_32 tag, /*@out@*/ int_32 * type, { const char * tn = tagName(tag); const char * n; char * mk; - headerNVR(h, &n, NULL, NULL); + (void) headerNVR(h, &n, NULL, NULL); mk = alloca(strlen(n) + strlen(tn) + sizeof("()")); sprintf(mk, "%s(%s)", n, tn); msgkey = mk; @@ -443,7 +443,7 @@ static int i18nTag(Header h, int_32 tag, /*@out@*/ int_32 * type, /* change to en_US for msgkey -> msgid resolution */ langval = getenv(language); - setenv(language, "en_US", 1); + (void) setenv(language, "en_US", 1); ++_nl_msg_cat_cntr; msgid = NULL; @@ -456,7 +456,7 @@ static int i18nTag(Header h, int_32 tag, /*@out@*/ int_32 * type, /* restore previous environment for msgid -> msgstr resolution */ if (langval) - setenv(language, langval, 1); + (void) setenv(language, langval, 1); else unsetenv(language); ++_nl_msg_cat_cntr; diff --git a/lib/fprint.c b/lib/fprint.c index 930af90b3..a5f5a1cb9 100644 --- a/lib/fprint.c +++ b/lib/fprint.c @@ -228,18 +228,19 @@ void fpLookupList(fingerPrintCache cache, const char ** dirNames, void fpLookupHeader(fingerPrintCache cache, Header h, fingerPrint * fpList) { - int fileCount; + HGE_t hge = (HGE_t)headerGetEntryMinMemory; + HFD_t hfd = headerFreeData; const char ** baseNames, ** dirNames; + int bnt, dnt; int_32 * dirIndexes; + int fileCount; - if (!headerGetEntryMinMemory(h, RPMTAG_BASENAMES, NULL, - (const void **) &baseNames, &fileCount)) return; + if (!hge(h, RPMTAG_BASENAMES, &bnt, (void **) &baseNames, &fileCount)) + return; - headerGetEntryMinMemory(h, RPMTAG_DIRNAMES, NULL, - (const void **) &dirNames, NULL); - headerGetEntryMinMemory(h, RPMTAG_DIRINDEXES, NULL, - (const void **) &dirIndexes, NULL); + (void) hge(h, RPMTAG_DIRNAMES, &dnt, (void **) &dirNames, NULL); + (void) hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); fpLookupList(cache, dirNames, baseNames, dirIndexes, fileCount, fpList); - free(dirNames); - free(baseNames); + dirNames = hfd(dirNames, dnt); + baseNames = hfd(baseNames, bnt); } @@ -204,9 +204,9 @@ static int getFilesystemList(void) } # if GETMNTENT_ONE || GETMNTENT_TWO - fclose(mtab); + (void) fclose(mtab); # elif HAVE_GETMNTINFO_R - free(mounts); + mounts = _free(mounts); # endif filesystems[numFilesystems].dev = 0; @@ -648,7 +648,7 @@ static int expandRegular(FSM_t fsm) if (st->st_size > 0 && fmd5sum) { const char * md5sum = NULL; - Fflush(fsm->wfd); + (void) Fflush(fsm->wfd); fdFiniMD5(fsm->wfd, (void **)&md5sum, NULL, 1); if (md5sum == NULL) { @@ -761,7 +761,7 @@ static int writeFile(FSM_t fsm, int writeData) #if HAVE_MMAP if (mapped != (void *)-1) { - /*@-noeffect@*/ munmap(mapped, nmapped) /*@=noeffect@*/; + /*@-noeffect@*/ (void) munmap(mapped, nmapped) /*@=noeffect@*/; fsm->rdbuf = rdbuf; } #endif diff --git a/lib/getdate.c b/lib/getdate.c index 296788eef..d1dbf8f75 100644 --- a/lib/getdate.c +++ b/lib/getdate.c @@ -1,3 +1,4 @@ +/*@-globstate -retvalint -unqualifiedtrans -usedef -varuse@*/ #ifndef lint static char const yyrcsid[] = "$FreeBSD: src/usr.bin/yacc/skeleton.c,v 1.28 2000/01/17 02:04:06 bde Exp $"; @@ -123,15 +124,20 @@ struct timeb { unportable getdate.c's), but that seems to cause as many problems as it solves. */ +#if 0 extern struct tm *gmtime(); extern struct tm *localtime(); +#endif + +extern time_t get_date(char * p, struct timeb * now); #define yyparse getdate_yyparse #define yylex getdate_yylex #define yyerror getdate_yyerror -static int yylex (); -static int yyerror (); +static int yyparse (void); +static int yylex (void); +static int yyerror(const char * s); #define EPOCH 1970 #define HOUR(x) ((time_t)(x) * 60) @@ -189,12 +195,12 @@ static MERIDIAN yyMeridian; static time_t yyRelMonth; static time_t yyRelSeconds; -#line 179 "./getdate.y" +#line 184 "./getdate.y" typedef union { time_t Number; enum _MERIDIAN Meridian; } YYSTYPE; -#line 198 "y.tab.c" +#line 203 "y.tab.c" #define YYERRCODE 256 #define tAGO 257 #define tDAY 258 @@ -412,7 +418,7 @@ short *yyss; short *yysslim; YYSTYPE *yyvs; int yystacksize; -#line 398 "./getdate.y" +#line 403 "./getdate.y" /* Month and day table. */ static TABLE const MonthDayTable[] = { @@ -440,7 +446,7 @@ static TABLE const MonthDayTable[] = { { "thurs", tDAY, 4 }, { "friday", tDAY, 5 }, { "saturday", tDAY, 6 }, - { NULL } + { NULL, 0, 0 } }; /* Time units table. */ @@ -455,7 +461,7 @@ static TABLE const UnitsTable[] = { { "min", tMINUTE_UNIT, 1 }, { "second", tSEC_UNIT, 1 }, { "sec", tSEC_UNIT, 1 }, - { NULL } + { NULL, 0, 0 } }; /* Assorted relative-time words. */ @@ -480,7 +486,7 @@ static TABLE const OtherTable[] = { { "eleventh", tUNUMBER, 11 }, { "twelfth", tUNUMBER, 12 }, { "ago", tAGO, 1 }, - { NULL } + { NULL, 0, 0 } }; /* The timezone table. */ @@ -565,7 +571,7 @@ static TABLE const TimezoneTable[] = { { "nzst", tZONE, -HOUR(12) }, /* New Zealand Standard */ { "nzdt", tDAYZONE, -HOUR(12) }, /* New Zealand Daylight */ { "idle", tZONE, -HOUR(12) }, /* International Date Line East */ - { NULL } + { NULL, 0, 0 } }; /* Military timezone table. */ @@ -595,7 +601,7 @@ static TABLE const MilitaryTable[] = { { "x", tZONE, HOUR(-11) }, { "y", tZONE, HOUR(-12) }, { "z", tZONE, HOUR( 0) }, - { NULL } + { NULL, 0, 0 } }; @@ -603,19 +609,14 @@ static TABLE const MilitaryTable[] = { /* ARGSUSED */ static int -yyerror(s) - char *s; +yyerror(const char * s) { return 0; } static time_t -ToSeconds(Hours, Minutes, Seconds, Meridian) - time_t Hours; - time_t Minutes; - time_t Seconds; - MERIDIAN Meridian; +ToSeconds(time_t Hours, time_t Minutes, time_t Seconds, MERIDIAN Meridian) { if (Minutes < 0 || Minutes > 59 || Seconds < 0 || Seconds > 59) return -1; @@ -648,15 +649,9 @@ ToSeconds(Hours, Minutes, Seconds, Meridian) * A number from 0 to 99, which means a year from 1900 to 1999, or * The actual year (>=100). */ static time_t -Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, DSTmode) - time_t Month; - time_t Day; - time_t Year; - time_t Hours; - time_t Minutes; - time_t Seconds; - MERIDIAN Meridian; - DSTMODE DSTmode; +Convert(time_t Month, time_t Day, time_t Year, + time_t Hours, time_t Minutes, time_t Seconds, + MERIDIAN Meridian, DSTMODE DSTmode) { static int DaysInMonth[12] = { 31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 @@ -698,9 +693,7 @@ Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, DSTmode) static time_t -DSTcorrect(Start, Future) - time_t Start; - time_t Future; +DSTcorrect(time_t Start, time_t Future) { time_t StartDay; time_t FutureDay; @@ -712,10 +705,7 @@ DSTcorrect(Start, Future) static time_t -RelativeDate(Start, DayOrdinal, DayNumber) - time_t Start; - time_t DayOrdinal; - time_t DayNumber; +RelativeDate(time_t Start, time_t DayOrdinal, time_t DayNumber) { struct tm *tm; time_t now; @@ -729,9 +719,7 @@ RelativeDate(Start, DayOrdinal, DayNumber) static time_t -RelativeMonth(Start, RelMonth) - time_t Start; - time_t RelMonth; +RelativeMonth(time_t Start, time_t RelMonth) { struct tm *tm; time_t Month; @@ -751,8 +739,7 @@ RelativeMonth(Start, RelMonth) static int -LookupWord(buff) - char *buff; +LookupWord(char * buff) { register char *p; register char *q; @@ -761,7 +748,7 @@ LookupWord(buff) int abbrev; /* Make it lowercase. */ - for (p = buff; *p; p++) + for (p = buff; *p != '\0'; p++) if (isupper(*p)) *p = tolower(*p); @@ -840,7 +827,7 @@ LookupWord(buff) } /* Drop out any periods and try the timezone table again. */ - for (i = 0, p = q = buff; *q; q++) + for (i = 0, p = q = buff; *q != '\0'; q++) if (*q != '.') *p++ = *q; else @@ -858,7 +845,7 @@ LookupWord(buff) static int -yylex() +yylex(void) { register char c; register char *p; @@ -907,17 +894,18 @@ yylex() Count--; } while (Count > 0); } + /*@notreached@*/ + return 0; } #define TM_YEAR_ORIGIN 1900 /* Yield A - B, measured in seconds. */ static long -difftm (a, b) - struct tm *a, *b; +difftm (const struct tm * a, const struct tm * b) { - int ay = a->tm_year + (TM_YEAR_ORIGIN - 1); - int by = b->tm_year + (TM_YEAR_ORIGIN - 1); + unsigned ay = a->tm_year + (TM_YEAR_ORIGIN - 1); + unsigned by = b->tm_year + (TM_YEAR_ORIGIN - 1); int days = ( /* difference in day of year */ a->tm_yday - b->tm_yday @@ -934,9 +922,7 @@ difftm (a, b) } time_t -get_date(p, now) - char *p; - struct timeb *now; +get_date(char * p, struct timeb * now) { struct tm *tm, gmt; struct timeb ftz; @@ -945,6 +931,7 @@ get_date(p, now) time_t nowtime; yyInput = p; + memset(&gmt, 0, sizeof(gmt)); if (now == NULL) { struct tm *gmt_ptr; @@ -965,7 +952,9 @@ get_date(p, now) return -1; if (gmt_ptr != NULL) + /*@-observertrans -dependenttrans@*/ ftz.timezone = difftm (&gmt, tm) / 60; + /*@=observertrans =dependenttrans@*/ else /* We are on a system like VMS, where the system clock is in local time and the system has no concept of timezones. @@ -1000,9 +989,11 @@ get_date(p, now) yyHaveTime = 0; yyHaveZone = 0; + /*@-unrecog@*/ if (yyparse() || yyHaveTime > 1 || yyHaveZone > 1 || yyHaveDate > 1 || yyHaveDay > 1) return -1; + /*@=unrecog@*/ if (yyHaveDate || yyHaveTime || yyHaveDay) { Start = Convert(yyMonth, yyDay, yyYear, yyHour, yyMinutes, yySeconds, @@ -1056,7 +1047,7 @@ main(ac, av) /* NOTREACHED */ } #endif /* defined(TEST) */ -#line 1060 "y.tab.c" +#line 1050 "y.tab.c" /* allocate initial stack or double stack size, up to YYMAXDEPTH */ static int yygrowstack() { @@ -1252,37 +1243,37 @@ yyreduce: switch (yyn) { case 3: -#line 197 "./getdate.y" +#line 202 "./getdate.y" { yyHaveTime++; } break; case 4: -#line 200 "./getdate.y" +#line 205 "./getdate.y" { yyHaveZone++; } break; case 5: -#line 203 "./getdate.y" +#line 208 "./getdate.y" { yyHaveDate++; } break; case 6: -#line 206 "./getdate.y" +#line 211 "./getdate.y" { yyHaveDay++; } break; case 7: -#line 209 "./getdate.y" +#line 214 "./getdate.y" { yyHaveRel++; } break; case 9: -#line 215 "./getdate.y" +#line 220 "./getdate.y" { yyHour = yyvsp[-1].Number; yyMinutes = 0; @@ -1291,7 +1282,7 @@ case 9: } break; case 10: -#line 221 "./getdate.y" +#line 226 "./getdate.y" { yyHour = yyvsp[-3].Number; yyMinutes = yyvsp[-1].Number; @@ -1300,7 +1291,7 @@ case 10: } break; case 11: -#line 227 "./getdate.y" +#line 232 "./getdate.y" { yyHour = yyvsp[-3].Number; yyMinutes = yyvsp[-1].Number; @@ -1310,7 +1301,7 @@ case 11: } break; case 12: -#line 234 "./getdate.y" +#line 239 "./getdate.y" { yyHour = yyvsp[-5].Number; yyMinutes = yyvsp[-3].Number; @@ -1319,7 +1310,7 @@ case 12: } break; case 13: -#line 240 "./getdate.y" +#line 245 "./getdate.y" { yyHour = yyvsp[-5].Number; yyMinutes = yyvsp[-3].Number; @@ -1330,56 +1321,56 @@ case 13: } break; case 14: -#line 250 "./getdate.y" +#line 255 "./getdate.y" { yyTimezone = yyvsp[0].Number; yyDSTmode = DSToff; } break; case 15: -#line 254 "./getdate.y" +#line 259 "./getdate.y" { yyTimezone = yyvsp[0].Number; yyDSTmode = DSTon; } break; case 16: -#line 259 "./getdate.y" +#line 264 "./getdate.y" { yyTimezone = yyvsp[-1].Number; yyDSTmode = DSTon; } break; case 17: -#line 265 "./getdate.y" +#line 270 "./getdate.y" { yyDayOrdinal = 1; yyDayNumber = yyvsp[0].Number; } break; case 18: -#line 269 "./getdate.y" +#line 274 "./getdate.y" { yyDayOrdinal = 1; yyDayNumber = yyvsp[-1].Number; } break; case 19: -#line 273 "./getdate.y" +#line 278 "./getdate.y" { yyDayOrdinal = yyvsp[-1].Number; yyDayNumber = yyvsp[0].Number; } break; case 20: -#line 279 "./getdate.y" +#line 284 "./getdate.y" { yyMonth = yyvsp[-2].Number; yyDay = yyvsp[0].Number; } break; case 21: -#line 283 "./getdate.y" +#line 288 "./getdate.y" { if (yyvsp[-4].Number >= 100) { yyYear = yyvsp[-4].Number; @@ -1393,7 +1384,7 @@ case 21: } break; case 22: -#line 294 "./getdate.y" +#line 299 "./getdate.y" { /* ISO 8601 format. yyyy-mm-dd. */ yyYear = yyvsp[-2].Number; @@ -1402,7 +1393,7 @@ case 22: } break; case 23: -#line 300 "./getdate.y" +#line 305 "./getdate.y" { /* e.g. 17-JUN-1992. */ yyDay = yyvsp[-2].Number; @@ -1411,14 +1402,14 @@ case 23: } break; case 24: -#line 306 "./getdate.y" +#line 311 "./getdate.y" { yyMonth = yyvsp[-1].Number; yyDay = yyvsp[0].Number; } break; case 25: -#line 310 "./getdate.y" +#line 315 "./getdate.y" { yyMonth = yyvsp[-3].Number; yyDay = yyvsp[-2].Number; @@ -1426,14 +1417,14 @@ case 25: } break; case 26: -#line 315 "./getdate.y" +#line 320 "./getdate.y" { yyMonth = yyvsp[0].Number; yyDay = yyvsp[-1].Number; } break; case 27: -#line 319 "./getdate.y" +#line 324 "./getdate.y" { yyMonth = yyvsp[-1].Number; yyDay = yyvsp[-2].Number; @@ -1441,68 +1432,68 @@ case 27: } break; case 28: -#line 326 "./getdate.y" +#line 331 "./getdate.y" { yyRelSeconds = -yyRelSeconds; yyRelMonth = -yyRelMonth; } break; case 30: -#line 333 "./getdate.y" +#line 338 "./getdate.y" { yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number * 60L; } break; case 31: -#line 336 "./getdate.y" +#line 341 "./getdate.y" { yyRelSeconds += yyvsp[-1].Number * yyvsp[0].Number * 60L; } break; case 32: -#line 339 "./getdate.y" +#line 344 "./getdate.y" { yyRelSeconds += yyvsp[0].Number * 60L; } break; case 33: -#line 342 "./getdate.y" +#line 347 "./getdate.y" { yyRelSeconds += yyvsp[-1].Number; } break; case 34: -#line 345 "./getdate.y" +#line 350 "./getdate.y" { yyRelSeconds += yyvsp[-1].Number; } break; case 35: -#line 348 "./getdate.y" +#line 353 "./getdate.y" { yyRelSeconds++; } break; case 36: -#line 351 "./getdate.y" +#line 356 "./getdate.y" { yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number; } break; case 37: -#line 354 "./getdate.y" +#line 359 "./getdate.y" { yyRelMonth += yyvsp[-1].Number * yyvsp[0].Number; } break; case 38: -#line 357 "./getdate.y" +#line 362 "./getdate.y" { yyRelMonth += yyvsp[0].Number; } break; case 39: -#line 362 "./getdate.y" +#line 367 "./getdate.y" { if (yyHaveTime && yyHaveDate && !yyHaveRel) yyYear = yyvsp[0].Number; @@ -1530,18 +1521,18 @@ case 39: } break; case 40: -#line 389 "./getdate.y" +#line 394 "./getdate.y" { yyval.Meridian = MER24; } break; case 41: -#line 392 "./getdate.y" +#line 397 "./getdate.y" { yyval.Meridian = yyvsp[0].Meridian; } break; -#line 1545 "y.tab.c" +#line 1535 "y.tab.c" } yyssp -= yym; yystate = *yyssp; @@ -1598,3 +1589,4 @@ yyabort: yyaccept: return (0); } +/*@=globstate =retvalint =unqualifiedtrans =usedef =varuse@*/ diff --git a/lib/header.c b/lib/header.c index 6f2450540..3019e7c61 100644 --- a/lib/header.c +++ b/lib/header.c @@ -481,7 +481,7 @@ Header headerCopy(Header h) headerNextIterator(hi, &tag, &type, &ptr, &count); ptr = headerFreeData((void *)ptr, type)) { - headerAddEntry(nh, tag, type, ptr, count); + (void) headerAddEntry(nh, tag, type, ptr, count); } headerFreeIterator(hi); @@ -595,9 +595,9 @@ assert(rdlen == dl); /* Dribble entries replace duplicate region entries. */ h->indexUsed -= ne; for (j = 0; j < ne; j++, newEntry++) { - headerRemoveEntry(h, newEntry->info.tag); + (void) headerRemoveEntry(h, newEntry->info.tag); if (newEntry->info.tag == HEADER_BASENAMES) - headerRemoveEntry(h, HEADER_OLDFILENAMES); + (void) headerRemoveEntry(h, HEADER_OLDFILENAMES); } /* If any duplicate entries were replaced, move new entries down. */ @@ -2214,7 +2214,8 @@ static int parseExpression(struct sprintfToken * token, char * str, } if (*chptr == '|') { - parseFormat(xstrdup(""), tags, extensions, &token->u.cond.elseFormat, + (void) parseFormat(xstrdup(""), tags, extensions, + &token->u.cond.elseFormat, &token->u.cond.numElseTokens, &end, PARSER_IN_EXPR, errmsg); } else { @@ -2768,7 +2769,7 @@ void headerCopyTags(Header headerFrom, Header headerTo, int *tagstocopy) if (!headerGetEntryMinMemory(headerFrom, *p, &type, (const void **) &s, &count)) continue; - headerAddEntry(headerTo, *p, type, s, count); + (void) headerAddEntry(headerTo, *p, type, s, count); s = headerFreeData(s, type); } } diff --git a/lib/md5sum.c b/lib/md5sum.c index 5aead8f36..962c0eacd 100644 --- a/lib/md5sum.c +++ b/lib/md5sum.c @@ -46,7 +46,7 @@ static int domd5(const char * fn, unsigned char * digest, int asAscii, rpmMD5Update(&ctx, buf, rc); rpmMD5Final(bindigest, &ctx); if (ferror(fp)) { - fclose(fp); + (void) fclose(fp); return 1; } @@ -73,7 +73,7 @@ static int domd5(const char * fn, unsigned char * digest, int asAscii, (unsigned)bindigest[15]); } - fclose(fp); + (void) fclose(fp); rc = 0; #else FD_t fd = Fopen(fn, "r.ufdio"); diff --git a/lib/misc.c b/lib/misc.c index 0b0c4acf1..3ab73fb06 100644 --- a/lib/misc.c +++ b/lib/misc.c @@ -358,7 +358,7 @@ int makeTempFile(const char * prefix, const char ** fnptr, FD_t * fdptr) errxit: tempfn = _free(tempfn); /*@-usereleased@*/ - if (fd) Fclose(fd); + if (fd) (void) Fclose(fd); /*@=usereleased@*/ return 1; } @@ -389,6 +389,7 @@ static int dncmp(const void * a, const void * b) void compressFilelist(Header h) { + HGE_t hge = (HGE_t)headerGetEntryMinMemory; char ** fileNames; const char ** dirNames; const char ** baseNames; @@ -405,12 +406,11 @@ void compressFilelist(Header h) */ if (headerIsEntry(h, RPMTAG_DIRNAMES)) { - headerRemoveEntry(h, RPMTAG_OLDFILENAMES); + (void) headerRemoveEntry(h, RPMTAG_OLDFILENAMES); return; /* Already converted. */ } - if (!headerGetEntry(h, RPMTAG_OLDFILENAMES, &fnt, - (void **) &fileNames, &count)) + if (!hge(h, RPMTAG_OLDFILENAMES, &fnt, (void **) &fileNames, &count)) return; /* no file list */ dirNames = alloca(sizeof(*dirNames) * count); /* worst case */ @@ -452,16 +452,16 @@ void compressFilelist(Header h) } exit: - headerAddEntry(h, RPMTAG_DIRINDEXES, RPM_INT32_TYPE, + (void) headerAddEntry(h, RPMTAG_DIRINDEXES, RPM_INT32_TYPE, dirIndexes, count); - headerAddEntry(h, RPMTAG_BASENAMES, RPM_STRING_ARRAY_TYPE, + (void) headerAddEntry(h, RPMTAG_BASENAMES, RPM_STRING_ARRAY_TYPE, baseNames, count); - headerAddEntry(h, RPMTAG_DIRNAMES, RPM_STRING_ARRAY_TYPE, + (void) headerAddEntry(h, RPMTAG_DIRNAMES, RPM_STRING_ARRAY_TYPE, dirNames, dirIndex + 1); fileNames = headerFreeData(fileNames, fnt); - headerRemoveEntry(h, RPMTAG_OLDFILENAMES); + (void) headerRemoveEntry(h, RPMTAG_OLDFILENAMES); } /* @@ -472,6 +472,8 @@ static void doBuildFileList(Header h, /*@out@*/ const char *** fileListPtr, /*@out@*/ int * fileCountPtr, int baseNameTag, int dirNameTag, int dirIndexesTag) { + HGE_t hge = (HGE_t)headerGetEntryMinMemory; + HFD_t hfd = headerFreeData; const char ** baseNames; const char ** dirNames; int * dirIndexes; @@ -482,14 +484,14 @@ static void doBuildFileList(Header h, /*@out@*/ const char *** fileListPtr, char * data; int i; - if (!headerGetEntry(h, baseNameTag, &bnt, (void **) &baseNames, &count)) { + if (!hge(h, baseNameTag, &bnt, (void **) &baseNames, &count)) { if (fileListPtr) *fileListPtr = NULL; if (fileCountPtr) *fileCountPtr = 0; return; /* no file list */ } - headerGetEntry(h, dirNameTag, &dnt, (void **) &dirNames, NULL); - headerGetEntry(h, dirIndexesTag, NULL, (void **) &dirIndexes, &count); + (void) hge(h, dirNameTag, &dnt, (void **) &dirNames, NULL); + (void) hge(h, dirIndexesTag, NULL, (void **) &dirIndexes, &count); size = sizeof(*fileNames) * count; for (i = 0; i < count; i++) @@ -502,8 +504,8 @@ static void doBuildFileList(Header h, /*@out@*/ const char *** fileListPtr, data = stpcpy( stpcpy(data, dirNames[dirIndexes[i]]), baseNames[i]); *data++ = '\0'; } - baseNames = headerFreeData(baseNames, bnt); - dirNames = headerFreeData(dirNames, dnt); + baseNames = hfd(baseNames, bnt); + dirNames = hfd(dirNames, dnt); if (fileListPtr) *fileListPtr = fileNames; @@ -522,14 +524,14 @@ void expandFilelist(Header h) RPMTAG_DIRNAMES, RPMTAG_DIRINDEXES); if (fileNames == NULL || count <= 0) return; - headerAddEntry(h, RPMTAG_OLDFILENAMES, RPM_STRING_ARRAY_TYPE, + (void) headerAddEntry(h, RPMTAG_OLDFILENAMES, RPM_STRING_ARRAY_TYPE, fileNames, count); fileNames = _free(fileNames); } - headerRemoveEntry(h, RPMTAG_DIRNAMES); - headerRemoveEntry(h, RPMTAG_BASENAMES); - headerRemoveEntry(h, RPMTAG_DIRINDEXES); + (void) headerRemoveEntry(h, RPMTAG_DIRNAMES); + (void) headerRemoveEntry(h, RPMTAG_BASENAMES); + (void) headerRemoveEntry(h, RPMTAG_DIRINDEXES); } @@ -779,6 +781,8 @@ int rpmPackageGetEntry( /*@unused@*/ void *leadp, Header sigs, Header h, */ void providePackageNVR(Header h) { + HGE_t hge = (HGE_t)headerGetEntryMinMemory; + HFD_t hfd = headerFreeData; const char *name, *version, *release; int_32 * epoch; const char *pEVR; @@ -786,18 +790,19 @@ void providePackageNVR(Header h) int_32 pFlags = RPMSENSE_EQUAL; const char ** provides = NULL; const char ** providesEVR = NULL; + int pnt, pvt; int_32 * provideFlags = NULL; int providesCount; int i; int bingo = 1; /* Generate provides for this package name-version-release. */ - headerNVR(h, &name, &version, &release); + (void) headerNVR(h, &name, &version, &release); if (!(name && version && release)) return; pEVR = p = alloca(21 + strlen(version) + 1 + strlen(release) + 1); *p = '\0'; - if (headerGetEntry(h, RPMTAG_EPOCH, NULL, (void **) &epoch, NULL)) { + if (hge(h, RPMTAG_EPOCH, NULL, (void **) &epoch, NULL)) { sprintf(p, "%d:", *epoch); while (*p != '\0') p++; @@ -808,29 +813,25 @@ void providePackageNVR(Header h) * Rpm prior to 3.0.3 does not have versioned provides. * If no provides at all are available, we can just add. */ - if (!headerGetEntry(h, RPMTAG_PROVIDENAME, NULL, - (void **) &provides, &providesCount)) { + if (!hge(h, RPMTAG_PROVIDENAME, &pnt, (void **) &provides, &providesCount)) goto exit; - } /* * Otherwise, fill in entries on legacy packages. */ - if (!headerGetEntry(h, RPMTAG_PROVIDEVERSION, NULL, - (void **) &providesEVR, NULL)) { + if (!hge(h, RPMTAG_PROVIDEVERSION, &pvt, (void **) &providesEVR, NULL)) { for (i = 0; i < providesCount; i++) { char * vdummy = ""; int_32 fdummy = RPMSENSE_ANY; - headerAddOrAppendEntry(h, RPMTAG_PROVIDEVERSION, RPM_STRING_ARRAY_TYPE, + (void) headerAddOrAppendEntry(h, RPMTAG_PROVIDEVERSION, RPM_STRING_ARRAY_TYPE, &vdummy, 1); - headerAddOrAppendEntry(h, RPMTAG_PROVIDEFLAGS, RPM_INT32_TYPE, + (void) headerAddOrAppendEntry(h, RPMTAG_PROVIDEFLAGS, RPM_INT32_TYPE, &fdummy, 1); } goto exit; } - headerGetEntry(h, RPMTAG_PROVIDEFLAGS, NULL, - (void **) &provideFlags, NULL); + (void) hge(h, RPMTAG_PROVIDEFLAGS, NULL, (void **) &provideFlags, NULL); for (i = 0; i < providesCount; i++) { if (!(provideFlags[i] == RPMSENSE_EQUAL && @@ -841,15 +842,15 @@ void providePackageNVR(Header h) } exit: - provides = headerFreeData(provides, -1); - providesEVR = headerFreeData(providesEVR, -1); + provides = hfd(provides, pnt); + providesEVR = hfd(providesEVR, pvt); if (bingo) { - headerAddOrAppendEntry(h, RPMTAG_PROVIDENAME, RPM_STRING_ARRAY_TYPE, + (void) headerAddOrAppendEntry(h, RPMTAG_PROVIDENAME, RPM_STRING_ARRAY_TYPE, &name, 1); - headerAddOrAppendEntry(h, RPMTAG_PROVIDEFLAGS, RPM_INT32_TYPE, + (void) headerAddOrAppendEntry(h, RPMTAG_PROVIDEFLAGS, RPM_INT32_TYPE, &pFlags, 1); - headerAddOrAppendEntry(h, RPMTAG_PROVIDEVERSION, RPM_STRING_ARRAY_TYPE, + (void) headerAddOrAppendEntry(h, RPMTAG_PROVIDEVERSION, RPM_STRING_ARRAY_TYPE, &pEVR, 1); } } diff --git a/lib/package.c b/lib/package.c index b3d256462..06d739bd6 100644 --- a/lib/package.c +++ b/lib/package.c @@ -43,7 +43,7 @@ void headerMergeLegacySigs(Header h, const Header sig) /*@notreached@*/ break; } if (!headerIsEntry(h, tag)) - headerAddEntry(h, tag, type, ptr, count); + (void) headerAddEntry(h, tag, type, ptr, count); } headerFreeIterator(hi); } @@ -72,7 +72,7 @@ Header headerRegenSigHeader(const Header h) /*@notreached@*/ break; } if (!headerIsEntry(sig, stag)) - headerAddEntry(sig, stag, type, ptr, count); + (void) headerAddEntry(sig, stag, type, ptr, count); } headerFreeIterator(hi); return sig; @@ -103,7 +103,8 @@ static rpmRC readPackageHeaders(FD_t fd, /*@out@*/ struct rpmlead * leadPtr, hdr = hdrPtr ? hdrPtr : &hdrBlock; lead = leadPtr ? leadPtr : &leadBlock; - fstat(Fileno(fd), &sb); + memset(&sb, 0, sizeof(sb)); + (void) fstat(Fileno(fd), &sb); /* if fd points to a socket, pipe, etc, sb.st_size is *always* zero */ if (S_ISREG(sb.st_mode) && sb.st_size < sizeof(*lead)) return 1; @@ -141,9 +142,9 @@ static rpmRC readPackageHeaders(FD_t fd, /*@out@*/ struct rpmlead * leadPtr, * anyone. */ if (headerIsEntry(*hdr, RPMTAG_FILEUSERNAME)) - headerRemoveEntry(*hdr, RPMTAG_FILEUIDS); + (void) headerRemoveEntry(*hdr, RPMTAG_FILEUIDS); if (headerIsEntry(*hdr, RPMTAG_FILEGROUPNAME)) - headerRemoveEntry(*hdr, RPMTAG_FILEGIDS); + (void) headerRemoveEntry(*hdr, RPMTAG_FILEGIDS); /* * We switched the way we do relocateable packages. We fix some of @@ -155,7 +156,7 @@ static rpmRC readPackageHeaders(FD_t fd, /*@out@*/ struct rpmlead * leadPtr, (void **) &defaultPrefix, NULL)) { defaultPrefix = stripTrailingChar(alloca_strdup(defaultPrefix), '/'); - headerAddEntry(*hdr, RPMTAG_PREFIXES, RPM_STRING_ARRAY_TYPE, + (void) headerAddEntry(*hdr, RPMTAG_PREFIXES, RPM_STRING_ARRAY_TYPE, &defaultPrefix, 1); } @@ -171,7 +172,7 @@ static rpmRC readPackageHeaders(FD_t fd, /*@out@*/ struct rpmlead * leadPtr, /* XXX binary rpms always have RPMTAG_SOURCERPM, source rpms do not */ if (lead->type == RPMLEAD_SOURCE) { if (!headerIsEntry(*hdr, RPMTAG_SOURCEPACKAGE)) - headerAddEntry(*hdr, RPMTAG_SOURCEPACKAGE, RPM_INT32_TYPE, + (void)headerAddEntry(*hdr, RPMTAG_SOURCEPACKAGE, RPM_INT32_TYPE, &true, 1); } else if (lead->major < 4) { /* Retrofit "Provide: name = EVR" for binary packages. */ diff --git a/lib/problems.c b/lib/problems.c index 12e032964..1ff730906 100644 --- a/lib/problems.c +++ b/lib/problems.c @@ -115,38 +115,42 @@ const char * rpmProblemString(rpmProblem prob) /*@*/ switch (prob->type) { case RPMPROB_BADARCH: - snprintf(buf, nb, _("package %s is for a different architecture"), + (void) snprintf(buf, nb, + _("package %s is for a different architecture"), prob->pkgNEVR); break; case RPMPROB_BADOS: - snprintf(buf, nb, _("package %s is for a different operating system"), + (void) snprintf(buf, nb, + _("package %s is for a different operating system"), prob->pkgNEVR); break; case RPMPROB_PKG_INSTALLED: - snprintf(buf, nb, _("package %s is already installed"), + (void) snprintf(buf, nb, + _("package %s is already installed"), prob->pkgNEVR); break; case RPMPROB_BADRELOCATE: - snprintf(buf, nb, _("path %s in package %s is not relocateable"), + (void) snprintf(buf, nb, + _("path %s in package %s is not relocateable"), prob->str1, prob->pkgNEVR); break; case RPMPROB_NEW_FILE_CONFLICT: - snprintf(buf, nb, + (void) snprintf(buf, nb, _("file %s conflicts between attempted installs of %s and %s"), prob->str1, prob->pkgNEVR, prob->altNEVR); break; case RPMPROB_FILE_CONFLICT: - snprintf(buf, nb, + (void) snprintf(buf, nb, _("file %s from install of %s conflicts with file from package %s"), prob->str1, prob->pkgNEVR, prob->altNEVR); break; case RPMPROB_OLDPACKAGE: - snprintf(buf, nb, + (void) snprintf(buf, nb, _("package %s (which is newer than %s) is already installed"), prob->altNEVR, prob->pkgNEVR); break; case RPMPROB_DISKSPACE: - snprintf(buf, nb, + (void) snprintf(buf, nb, _("installing package %s needs %ld%cb on the %s filesystem"), prob->pkgNEVR, prob->ulong1 > (1024*1024) @@ -156,19 +160,19 @@ const char * rpmProblemString(rpmProblem prob) /*@*/ prob->str1); break; case RPMPROB_DISKNODES: - snprintf(buf, nb, + (void) snprintf(buf, nb, _("installing package %s needs %ld inodes on the %s filesystem"), prob->pkgNEVR, (long)prob->ulong1, prob->str1); break; case RPMPROB_BADPRETRANS: - snprintf(buf, nb, + (void) snprintf(buf, nb, _("package %s pre-transaction syscall(s): %s failed: %s"), prob->pkgNEVR, prob->str1, strerror(prob->ulong1)); break; case RPMPROB_REQUIRES: case RPMPROB_CONFLICT: default: - snprintf(buf, nb, + (void) snprintf(buf, nb, _("unknown error %d encountered while manipulating package %s"), prob->type, prob->pkgNEVR); break; @@ -48,15 +48,15 @@ int rpmVersionCompare(Header first, Header second) return 1; } - headerGetEntry(first, RPMTAG_VERSION, NULL, (void **) &one, NULL); - headerGetEntry(second, RPMTAG_VERSION, NULL, (void **) &two, NULL); + (void) headerGetEntry(first, RPMTAG_VERSION, NULL, (void **) &one, NULL); + (void) headerGetEntry(second, RPMTAG_VERSION, NULL, (void **) &two, NULL); rc = rpmvercmp(one, two); if (rc) return rc; - headerGetEntry(first, RPMTAG_RELEASE, NULL, (void **) &one, NULL); - headerGetEntry(second, RPMTAG_RELEASE, NULL, (void **) &two, NULL); + (void) headerGetEntry(first, RPMTAG_RELEASE, NULL, (void **) &one, NULL); + (void) headerGetEntry(second, RPMTAG_RELEASE, NULL, (void **) &two, NULL); return rpmvercmp(one, two); } @@ -83,11 +83,11 @@ void loadFi(Header h, TFI_t fi) if (h && fi->h == NULL) fi->h = headerLink(h); /* Duplicate name-version-release so that headers can be free'd. */ - hge(fi->h, RPMTAG_NAME, NULL, (void **) &fi->name, NULL); + rc = hge(fi->h, RPMTAG_NAME, NULL, (void **) &fi->name, NULL); fi->name = xstrdup(fi->name); - hge(fi->h, RPMTAG_VERSION, NULL, (void **) &fi->version, NULL); + rc = hge(fi->h, RPMTAG_VERSION, NULL, (void **) &fi->version, NULL); fi->version = xstrdup(fi->version); - hge(fi->h, RPMTAG_RELEASE, NULL, (void **) &fi->release, NULL); + rc = hge(fi->h, RPMTAG_RELEASE, NULL, (void **) &fi->release, NULL); fi->release = xstrdup(fi->release); /* -1 means not found */ @@ -103,12 +103,12 @@ void loadFi(Header h, TFI_t fi) return; } - hge(fi->h, RPMTAG_DIRINDEXES, NULL, (void **) &fi->dil, NULL); - hge(fi->h, RPMTAG_DIRNAMES, NULL, (void **) &fi->dnl, &fi->dc); - hge(fi->h, RPMTAG_FILEMODES, NULL, (void **) &fi->fmodes, NULL); - hge(fi->h, RPMTAG_FILEFLAGS, NULL, (void **) &fi->fflags, NULL); - hge(fi->h, RPMTAG_FILESIZES, NULL, (void **) &fi->fsizes, NULL); - hge(fi->h, RPMTAG_FILESTATES, NULL, (void **) &fi->fstates, NULL); + rc = hge(fi->h, RPMTAG_DIRINDEXES, NULL, (void **) &fi->dil, NULL); + rc = hge(fi->h, RPMTAG_DIRNAMES, NULL, (void **) &fi->dnl, &fi->dc); + rc = hge(fi->h, RPMTAG_FILEMODES, NULL, (void **) &fi->fmodes, NULL); + rc = hge(fi->h, RPMTAG_FILEFLAGS, NULL, (void **) &fi->fflags, NULL); + rc = hge(fi->h, RPMTAG_FILESIZES, NULL, (void **) &fi->fsizes, NULL); + rc = hge(fi->h, RPMTAG_FILESTATES, NULL, (void **) &fi->fstates, NULL); fi->action = FA_UNKNOWN; fi->flags = 0; @@ -120,10 +120,10 @@ void loadFi(Header h, TFI_t fi) switch (fi->type) { case TR_ADDED: fi->mapflags = CPIO_MAP_PATH | CPIO_MAP_MODE | CPIO_MAP_UID | CPIO_MAP_GID; - hge(fi->h, RPMTAG_FILEMD5S, NULL, (void **) &fi->fmd5s, NULL); - hge(fi->h, RPMTAG_FILELINKTOS, NULL, (void **) &fi->flinks, NULL); - hge(fi->h, RPMTAG_FILELANGS, NULL, (void **) &fi->flangs, NULL); - hge(fi->h, RPMTAG_FILEMTIMES, NULL, (void **) &fi->fmtimes, NULL); + rc = hge(fi->h, RPMTAG_FILEMD5S, NULL, (void **) &fi->fmd5s, NULL); + rc = hge(fi->h, RPMTAG_FILELINKTOS, NULL, (void **) &fi->flinks, NULL); + rc = hge(fi->h, RPMTAG_FILELANGS, NULL, (void **) &fi->flangs, NULL); + rc = hge(fi->h, RPMTAG_FILEMTIMES, NULL, (void **) &fi->fmtimes, NULL); /* 0 makes for noops */ fi->replacedSizes = xcalloc(fi->fc, sizeof(*fi->replacedSizes)); @@ -131,8 +131,8 @@ void loadFi(Header h, TFI_t fi) break; case TR_REMOVED: fi->mapflags = CPIO_MAP_ABSOLUTE | CPIO_MAP_ADDDOT | CPIO_MAP_PATH | CPIO_MAP_MODE; - hge(fi->h, RPMTAG_FILEMD5S, NULL, (void **) &fi->fmd5s, NULL); - hge(fi->h, RPMTAG_FILELINKTOS, NULL, (void **) &fi->flinks, NULL); + rc = hge(fi->h, RPMTAG_FILEMD5S, NULL, (void **) &fi->fmd5s, NULL); + rc = hge(fi->h, RPMTAG_FILELINKTOS, NULL, (void **) &fi->flinks, NULL); fi->fsizes = memcpy(xmalloc(fi->fc * sizeof(*fi->fsizes)), fi->fsizes, fi->fc * sizeof(*fi->fsizes)); fi->fflags = memcpy(xmalloc(fi->fc * sizeof(*fi->fflags)), @@ -317,15 +317,15 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) RPMTAG_CONFLICTNAME, RPMTAG_CONFLICTVERSION, RPMTAG_CONFLICTFLAGS }; - hge(h, RPMTAG_SIZE, NULL, (void **) &fileSizes, NULL); + (void) hge(h, RPMTAG_SIZE, NULL, (void **) &fileSizes, NULL); fileSize = *fileSizes; - hge(newH, RPMTAG_FILESIZES, NULL, (void **) &fileSizes, &count); + (void) hge(newH, RPMTAG_FILESIZES, NULL, (void **) &fileSizes, &count); for (i = 0, fc = 0; i < count; i++) if (actions[i] != FA_SKIPMULTILIB) { fc++; fileSize += fileSizes[i]; } - headerModifyEntry(h, RPMTAG_SIZE, RPM_INT32_TYPE, &fileSize, 1); + (void) headerModifyEntry(h, RPMTAG_SIZE, RPM_INT32_TYPE, &fileSize, 1); for (i = 0; mergeTags[i]; i++) { if (!hge(newH, mergeTags[i], &type, (void **) &data, &count)) @@ -337,7 +337,7 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) for (j = 0, k = 0; j < count; j++) if (actions[j] != FA_SKIPMULTILIB) ((int_8 *) newdata)[k++] = ((int_8 *) data)[j]; - headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); + (void) headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); free (newdata); break; case RPM_INT16_TYPE: @@ -345,7 +345,7 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) for (j = 0, k = 0; j < count; j++) if (actions[j] != FA_SKIPMULTILIB) ((int_16 *) newdata)[k++] = ((int_16 *) data)[j]; - headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); + (void) headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); free (newdata); break; case RPM_INT32_TYPE: @@ -353,7 +353,7 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) for (j = 0, k = 0; j < count; j++) if (actions[j] != FA_SKIPMULTILIB) ((int_32 *) newdata)[k++] = ((int_32 *) data)[j]; - headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); + (void) headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); free (newdata); break; case RPM_STRING_ARRAY_TYPE: @@ -361,7 +361,7 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) for (j = 0, k = 0; j < count; j++) if (actions[j] != FA_SKIPMULTILIB) ((char **) newdata)[k++] = ((char **) data)[j]; - headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); + (void) headerAddOrAppendEntry(h, mergeTags[i], type, newdata, fc); free (newdata); break; default: @@ -372,10 +372,10 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) } data = hfd(data, type); } - hge(newH, RPMTAG_DIRINDEXES, NULL, (void **) &newDirIndexes, &count); - hge(newH, RPMTAG_DIRNAMES, NULL, (void **) &newDirNames, NULL); - hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); - hge(h, RPMTAG_DIRNAMES, NULL, (void **) &data, &dirNamesCount); + (void) hge(newH, RPMTAG_DIRINDEXES, NULL, (void **) &newDirIndexes, &count); + (void) hge(newH, RPMTAG_DIRNAMES, NULL, (void **) &newDirNames, NULL); + (void) hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); + (void) hge(h, RPMTAG_DIRNAMES, NULL, (void **) &data, &dirNamesCount); dirNames = xcalloc(dirNamesCount + fc, sizeof(char *)); for (i = 0; i < dirNamesCount; i++) @@ -392,9 +392,9 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) dirNames[dirCount++] = newDirNames[newDirIndexes[i]]; ((int_32 *) newdata)[k++] = j; } - headerAddOrAppendEntry(h, RPMTAG_DIRINDEXES, RPM_INT32_TYPE, newdata, fc); + (void) headerAddOrAppendEntry(h, RPMTAG_DIRINDEXES, RPM_INT32_TYPE, newdata, fc); if (dirCount > dirNamesCount) - headerAddOrAppendEntry(h, RPMTAG_DIRNAMES, RPM_STRING_ARRAY_TYPE, + (void) headerAddOrAppendEntry(h, RPMTAG_DIRNAMES, RPM_STRING_ARRAY_TYPE, dirNames + dirNamesCount, dirCount - dirNamesCount); data = hfd(data, -1); @@ -411,12 +411,12 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) if (!hge(newH, requireTags[i], &nnt, (void **) &newNames, &newCount)) continue; - hge(newH, requireTags[i+1], &nvt, (void **) &newEVR, NULL); - hge(newH, requireTags[i+2], NULL, (void **) &newFlags, NULL); + (void) hge(newH, requireTags[i+1], &nvt, (void **) &newEVR, NULL); + (void) hge(newH, requireTags[i+2], NULL, (void **) &newFlags, NULL); if (hge(h, requireTags[i], &rnt, (void **) &Names, &Count)) { - hge(h, requireTags[i+1], NULL, (void **) &EVR, NULL); - hge(h, requireTags[i+2], NULL, (void **) &Flags, NULL); + (void) hge(h, requireTags[i+1], NULL, (void **) &EVR, NULL); + (void) hge(h, requireTags[i+2], NULL, (void **) &Flags, NULL); for (j = 0; j < newCount; j++) for (k = 0; k < Count; k++) if (!strcmp (newNames[j], Names[k]) @@ -439,11 +439,11 @@ static int mergeFiles(TFI_t fi, Header h, Header newH) k++; } if (k) { - headerAddOrAppendEntry(h, requireTags[i], + (void) headerAddOrAppendEntry(h, requireTags[i], RPM_STRING_ARRAY_TYPE, newNames, k); - headerAddOrAppendEntry(h, requireTags[i+1], + (void) headerAddOrAppendEntry(h, requireTags[i+1], RPM_STRING_ARRAY_TYPE, newEVR, k); - headerAddOrAppendEntry(h, requireTags[i+2], RPM_INT32_TYPE, + (void) headerAddOrAppendEntry(h, requireTags[i+2], RPM_INT32_TYPE, newFlags, k); } newNames = hfd(newNames, nnt); @@ -494,7 +494,7 @@ static int markReplacedFiles(PSM_t psm) } mi = rpmdbInitIterator(ts->rpmdb, RPMDBI_PACKAGES, NULL, 0); - rpmdbAppendIterator(mi, offsets, num); + (void) rpmdbAppendIterator(mi, offsets, num); sfi = replaced; while ((h = rpmdbNextIterator(mi)) != NULL) { @@ -516,7 +516,7 @@ static int markReplacedFiles(PSM_t psm) if (modified == 0) { /* Modified header will be rewritten. */ modified = 1; - rpmdbSetIteratorModified(mi, modified); + (void) rpmdbSetIteratorModified(mi, modified); } num++; } @@ -610,7 +610,7 @@ rpmRC rpmInstallSourcePackage(const char * rootDir, FD_t fd, headerFree(h); /* XXX reference held by transaction set */ h = NULL; - rpmInstallLoadMacros(fi, fi->h); + (void) rpmInstallLoadMacros(fi, fi->h); memset(psm, 0, sizeof(*psm)); psm->ts = ts; @@ -812,7 +812,7 @@ static int runScript(PSM_t psm, Header h, argc = progArgc; } - headerNVR(h, &n, &v, &r); + (void) headerNVR(h, &n, &v, &r); if (hge(h, RPMTAG_INSTPREFIXES, &ipt, (void **) &prefixes, &numPrefixes)) { freePrefixes = 1; } else if (hge(h, RPMTAG_INSTALLPREFIX, NULL, (void **) &oldPrefix, NULL)) { @@ -838,10 +838,10 @@ static int runScript(PSM_t psm, Header h, if (rpmIsDebug() && (!strcmp(argv[0], "/bin/sh") || !strcmp(argv[0], "/bin/bash"))) - (void)Fwrite("set -x\n", sizeof(char), 7, fd); + (void) Fwrite("set -x\n", sizeof(char), 7, fd); - (void)Fwrite(script, sizeof(script[0]), strlen(script), fd); - Fclose(fd); + (void) Fwrite(script, sizeof(script[0]), strlen(script), fd); + (void) Fclose(fd); { const char * sn = fn; if (!ts->chrootDone && @@ -886,22 +886,22 @@ static int runScript(PSM_t psm, Header h, pipes[0] = pipes[1] = 0; /* make stdin inaccessible */ - pipe(pipes); - close(pipes[1]); - dup2(pipes[0], STDIN_FILENO); - close(pipes[0]); + (void) pipe(pipes); + (void) close(pipes[1]); + (void) dup2(pipes[0], STDIN_FILENO); + (void) close(pipes[0]); if (ts->scriptFd != NULL) { if (Fileno(ts->scriptFd) != STDERR_FILENO) - dup2(Fileno(ts->scriptFd), STDERR_FILENO); + (void) dup2(Fileno(ts->scriptFd), STDERR_FILENO); if (Fileno(out) != STDOUT_FILENO) - dup2(Fileno(out), STDOUT_FILENO); + (void) dup2(Fileno(out), STDOUT_FILENO); /* make sure we don't close stdin/stderr/stdout by mistake! */ if (Fileno(out) > STDERR_FILENO && Fileno(out) != Fileno(ts->scriptFd)) { - Fclose (out); + (void) Fclose (out); } if (Fileno(ts->scriptFd) > STDERR_FILENO) { - Fclose (ts->scriptFd); + (void) Fclose (ts->scriptFd); } } @@ -910,18 +910,18 @@ static int runScript(PSM_t psm, Header h, if (ipath && ipath[5] != '%') path = ipath; - doputenv(path); + (void) doputenv(path); ipath = _free(ipath); } for (i = 0; i < numPrefixes; i++) { sprintf(prefixBuf, "RPM_INSTALL_PREFIX%d=%s", i, prefixes[i]); - doputenv(prefixBuf); + (void) doputenv(prefixBuf); /* backwards compatibility */ if (i == 0) { sprintf(prefixBuf, "RPM_INSTALL_PREFIX=%s", prefixes[i]); - doputenv(prefixBuf); + (void) doputenv(prefixBuf); } } @@ -935,8 +935,8 @@ static int runScript(PSM_t psm, Header h, if (!ts->chrootDone && !(rootDir[0] == '/' && rootDir[1] == '\0')) { /*@-unrecog@*/ chroot(rootDir); /*@=unrecog@*/ } - chdir("/"); - execv(argv[0], (char *const *)argv); + (void) chdir("/"); + (void) execv(argv[0], (char *const *)argv); break; default: break; @@ -963,10 +963,11 @@ static int runScript(PSM_t psm, Header h, if (freePrefixes) prefixes = hfd(prefixes, ipt); - Fclose(out); /* XXX dup'd STDOUT_FILENO */ + (void) Fclose(out); /* XXX dup'd STDOUT_FILENO */ if (script) { - if (!rpmIsDebug()) unlink(fn); + if (!rpmIsDebug()) + (void) unlink(fn); fn = _free(fn); } @@ -994,8 +995,8 @@ static rpmRC runInstScript(PSM_t psm) * headerGetEntry() sets the data pointer to NULL if the entry does * not exist. */ - hge(fi->h, psm->progTag, &ptt, (void **) &programArgv, &programArgc); - hge(fi->h, psm->scriptTag, &stt, (void **) &script, NULL); + (void) hge(fi->h, psm->progTag, &ptt, (void **) &programArgv, &programArgc); + (void) hge(fi->h, psm->scriptTag, &stt, (void **) &script, NULL); if (programArgv && ptt == RPM_STRING_TYPE) { argv = alloca(sizeof(char *)); @@ -1045,10 +1046,10 @@ static int handleOneTrigger(PSM_t psm, Header sourceH, Header triggeredH, (void **) &triggerNames, &numTriggers)) return 0; - headerNVR(sourceH, &sourceName, NULL, NULL); + (void) headerNVR(sourceH, &sourceName, NULL, NULL); - hge(triggeredH, RPMTAG_TRIGGERFLAGS, &tft, (void **) &triggerFlags, NULL); - hge(triggeredH, RPMTAG_TRIGGERVERSION, &tvt, (void **) &triggerEVR, NULL); + (void) hge(triggeredH, RPMTAG_TRIGGERFLAGS, &tft, (void **) &triggerFlags, NULL); + (void) hge(triggeredH, RPMTAG_TRIGGERVERSION, &tvt, (void **) &triggerEVR, NULL); for (i = 0; i < numTriggers; i++) { int_32 tit, tst, tpt; @@ -1073,14 +1074,14 @@ static int handleOneTrigger(PSM_t psm, Header sourceH, Header triggeredH, triggerEVR[i] + skip, triggerFlags[i])) continue; - hge(triggeredH, RPMTAG_TRIGGERINDEX, &tit, + (void) hge(triggeredH, RPMTAG_TRIGGERINDEX, &tit, (void **) &triggerIndices, NULL); - hge(triggeredH, RPMTAG_TRIGGERSCRIPTS, &tst, + (void) hge(triggeredH, RPMTAG_TRIGGERSCRIPTS, &tst, (void **) &triggerScripts, NULL); - hge(triggeredH, RPMTAG_TRIGGERSCRIPTPROG, &tpt, + (void) hge(triggeredH, RPMTAG_TRIGGERSCRIPTPROG, &tpt, (void **) &triggerProgs, NULL); - headerNVR(triggeredH, &triggerPackageName, NULL, NULL); + (void) headerNVR(triggeredH, &triggerPackageName, NULL, NULL); { int arg1; int index; @@ -1178,7 +1179,7 @@ static int runImmedTriggers(PSM_t psm) (void **) &triggerNames, &numTriggers)) return 0; - hge(fi->h, RPMTAG_TRIGGERINDEX, &tit, (void **) &triggerIndices, + (void) hge(fi->h, RPMTAG_TRIGGERINDEX, &tit, (void **) &triggerIndices, &numTriggerIndices); triggersRun = alloca(sizeof(*triggersRun) * numTriggerIndices); memset(triggersRun, 0, sizeof(*triggersRun) * numTriggerIndices); @@ -1321,10 +1322,10 @@ assert(psm->mi == NULL); rpmBuildFileList(fi->h, &fi->apath, NULL); if (fi->fuser == NULL) - hge(fi->h, RPMTAG_FILEUSERNAME, NULL, + (void) hge(fi->h, RPMTAG_FILEUSERNAME, NULL, (void **) &fi->fuser, NULL); if (fi->fgroup == NULL) - hge(fi->h, RPMTAG_FILEGROUPNAME, NULL, + (void) hge(fi->h, RPMTAG_FILEGROUPNAME, NULL, (void **) &fi->fgroup, NULL); if (fi->fuids == NULL) fi->fuids = xcalloc(sizeof(*fi->fuids), fi->fc); @@ -1511,7 +1512,7 @@ assert(psm->mi == NULL); (void) fsmTeardown(fi->fsm); saveerrno = errno; /* XXX FIXME: Fclose with libio destroys errno */ - Fclose(psm->cfd); + (void) Fclose(psm->cfd); psm->cfd = NULL; errno = saveerrno; /* XXX FIXME: Fclose with libio destroys errno */ @@ -1560,7 +1561,7 @@ assert(psm->mi == NULL); fi->action = FA_COPYOUT; fi->actions = NULL; - Fflush(psm->fd); + (void) Fflush(psm->fd); psm->cfd = Fdopen(fdDup(Fileno(psm->fd)), psm->rpmio_flags); /* XXX failedFile? */ @@ -1568,7 +1569,7 @@ assert(psm->mi == NULL); (void) fsmTeardown(fi->fsm); saveerrno = errno; /* XXX FIXME: Fclose with libio destroys errno */ - Fclose(psm->cfd); + (void) Fclose(psm->cfd); psm->cfd = NULL; errno = saveerrno; @@ -1583,20 +1584,21 @@ assert(psm->mi == NULL); int_32 installTime = time(NULL); if (fi->fc > 0 && fi->fstates) - headerAddEntry(fi->h, RPMTAG_FILESTATES, RPM_CHAR_TYPE, + (void) headerAddEntry(fi->h, RPMTAG_FILESTATES, RPM_CHAR_TYPE, fi->fstates, fi->fc); - headerAddEntry(fi->h, RPMTAG_INSTALLTIME, RPM_INT32_TYPE, + (void) headerAddEntry(fi->h, RPMTAG_INSTALLTIME, RPM_INT32_TYPE, &installTime, 1); if (ts->transFlags & RPMTRANS_FLAG_MULTILIB) { uint_32 multiLib, * newMultiLib, * p; if (hge(fi->h, RPMTAG_MULTILIBS, NULL, (void **) &newMultiLib, NULL) && - hge(psm->oh, RPMTAG_MULTILIBS, NULL, (void **) &p, NULL)) { + hge(psm->oh, RPMTAG_MULTILIBS, NULL, (void **) &p, NULL)) + { multiLib = *p; multiLib |= *newMultiLib; - headerModifyEntry(psm->oh, RPMTAG_MULTILIBS, RPM_INT32_TYPE, + (void) headerModifyEntry(psm->oh, RPMTAG_MULTILIBS, RPM_INT32_TYPE, &multiLib, 1); } rc = mergeFiles(fi, psm->oh, fi->h); @@ -1674,7 +1676,7 @@ assert(psm->mi == NULL); if (psm->fd) { saveerrno = errno; /* XXX FIXME: Fclose with libio destroys errno */ - Fclose(psm->fd); + (void) Fclose(psm->fd); psm->fd = NULL; errno = saveerrno; } @@ -1754,7 +1756,7 @@ assert(psm->mi == NULL); _loaded++; } - chdir("/"); + (void) chdir("/"); /*@-unrecog@*/ rc = chroot(ts->rootDir); /*@=unrecog@*/ @@ -1768,7 +1770,7 @@ assert(psm->mi == NULL); rc = chroot("."); /*@=unrecog@*/ psm->chrootDone = ts->chrootDone = 0; - chdir(ts->currDir); + (void) chdir(ts->currDir); } break; case PSM_SCRIPT: diff --git a/lib/query.c b/lib/query.c index 6edae3a8e..3adc0e126 100644 --- a/lib/query.c +++ b/lib/query.c @@ -136,6 +136,8 @@ static int countLinks(int_16 * fileRdevList, int_32 * fileInodeList, int nfiles, int showQueryPackage(QVA_t *qva, /*@unused@*/rpmdb rpmdb, Header h) { + HGE_t hge = (HGE_t)headerGetEntryMinMemory; + HFD_t hfd = headerFreeData; char * t, * te; int queryFlags = qva->qva_flags; @@ -145,6 +147,7 @@ int showQueryPackage(QVA_t *qva, /*@unused@*/rpmdb rpmdb, Header h) char * prefix = NULL; const char ** dirNames = NULL; const char ** baseNames = NULL; + int bnt, dnt; const char ** fileMD5List = NULL; const char ** fileOwnerList = NULL; const char ** fileGroupList = NULL; @@ -166,7 +169,7 @@ int showQueryPackage(QVA_t *qva, /*@unused@*/rpmdb rpmdb, Header h) if (!queryFormat && !queryFlags) { const char * name, * version, * release; - headerNVR(h, &name, &version, &release); + (void) headerNVR(h, &name, &version, &release); te = stpcpy(te, name); te = stpcpy( stpcpy(te, "-"), version); te = stpcpy( stpcpy(te, "-"), release); @@ -194,39 +197,35 @@ int showQueryPackage(QVA_t *qva, /*@unused@*/rpmdb rpmdb, Header h) if (!(queryFlags & QUERY_FOR_LIST)) goto exit; - if (!headerGetEntry(h, RPMTAG_BASENAMES, &type, - (void **) &baseNames, &count)) { + if (!hge(h, RPMTAG_BASENAMES, &bnt, (void **) &baseNames, &count)) { te = stpcpy(te, _("(contains no files)")); goto exit; } - if (!headerGetEntry(h, RPMTAG_FILESTATES, &type, - (void **) &fileStatesList, &count)) { + if (!hge(h, RPMTAG_FILESTATES, &type, (void **) &fileStatesList, &count)) { fileStatesList = NULL; } - headerGetEntry(h, RPMTAG_DIRNAMES, NULL, (void **) &dirNames, NULL); - headerGetEntry(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); - headerGetEntry(h, RPMTAG_FILEFLAGS, &type, (void **)&fileFlagsList, &count); - headerGetEntry(h, RPMTAG_FILESIZES, &type, (void **) &fileSizeList, &count); - headerGetEntry(h, RPMTAG_FILEMODES, &type, (void **) &fileModeList, &count); - headerGetEntry(h, RPMTAG_FILEMTIMES, &type, (void **)&fileMTimeList,&count); - headerGetEntry(h, RPMTAG_FILERDEVS, &type, (void **) &fileRdevList, &count); - headerGetEntry(h, RPMTAG_FILEINODES, &type, (void **)&fileInodeList,&count); - headerGetEntry(h, RPMTAG_FILELINKTOS,&type,(void **)&fileLinktoList,&count); - headerGetEntry(h, RPMTAG_FILEMD5S, &type, (void **) &fileMD5List, &count); - - if (!headerGetEntry(h, RPMTAG_FILEUIDS, &type, - (void **) &fileUIDList, &count)) { + (void) hge(h, RPMTAG_DIRNAMES, &dnt, (void **) &dirNames, NULL); + (void) hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); + (void) hge(h, RPMTAG_FILEFLAGS, &type, (void **)&fileFlagsList, &count); + (void) hge(h, RPMTAG_FILESIZES, &type, (void **) &fileSizeList, &count); + (void) hge(h, RPMTAG_FILEMODES, &type, (void **) &fileModeList, &count); + (void) hge(h, RPMTAG_FILEMTIMES, &type, (void **)&fileMTimeList,&count); + (void) hge(h, RPMTAG_FILERDEVS, &type, (void **) &fileRdevList, &count); + (void) hge(h, RPMTAG_FILEINODES, &type, (void **)&fileInodeList,&count); + (void) hge(h, RPMTAG_FILELINKTOS,&type,(void **)&fileLinktoList,&count); + (void) hge(h, RPMTAG_FILEMD5S, &type, (void **) &fileMD5List, &count); + + if (!hge(h, RPMTAG_FILEUIDS, &type, (void **) &fileUIDList, &count)) { fileUIDList = NULL; - } else if (!headerGetEntry(h, RPMTAG_FILEGIDS, &type, + } else if (!hge(h, RPMTAG_FILEGIDS, &type, (void **) &fileGIDList, &count)) { fileGIDList = NULL; } - if (!headerGetEntry(h, RPMTAG_FILEUSERNAME, &type, - (void **) &fileOwnerList, &count)) { + if (!hge(h, RPMTAG_FILEUSERNAME, &type, (void **) &fileOwnerList, &count)) { fileOwnerList = NULL; - } else if (!headerGetEntry(h, RPMTAG_FILEGROUPNAME, &type, - (void **) &fileGroupList, &count)) { + } else + if (!hge(h, RPMTAG_FILEGROUPNAME, &type, (void **) &fileGroupList, &count)) { fileGroupList = NULL; } @@ -349,12 +348,12 @@ exit: rpmMessage(RPMMESS_NORMAL, "%s", t); } t = _free(t); - dirNames = headerFreeData(dirNames, -1); - baseNames = headerFreeData(baseNames, -1); - fileLinktoList = headerFreeData(fileLinktoList, -1); - fileMD5List = headerFreeData(fileMD5List, -1); - fileOwnerList = headerFreeData(fileOwnerList, -1); - fileGroupList = headerFreeData(fileGroupList, -1); + dirNames = hfd(dirNames, dnt); + baseNames = hfd(baseNames, bnt); + fileLinktoList = hfd(fileLinktoList, -1); + fileMD5List = hfd(fileMD5List, -1); + fileOwnerList = hfd(fileOwnerList, -1); + fileGroupList = hfd(fileGroupList, -1); return rc; } @@ -511,13 +510,13 @@ restart: if (fd == NULL || Ferror(fd)) { rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), fileURL, Fstrerror(fd)); - if (fd) Fclose(fd); + if (fd) (void) Fclose(fd); retcode = 1; break; } rpmrc = rpmReadPackageHeader(fd, &h, &isSource, NULL, NULL); - Fclose(fd); + (void) Fclose(fd); if (!(rpmrc == RPMRC_OK || rpmrc == RPMRC_BADMAGIC)) { rpmError(RPMERR_QUERY, _("query of %s failed\n"), fileURL); @@ -543,7 +542,7 @@ restart: if (fd == NULL || Ferror(fd)) { rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), fileURL, Fstrerror(fd)); - if (fd) Fclose(fd); + if (fd) (void) Fclose(fd); retcode = 1; break; } @@ -555,7 +554,7 @@ restart: fileURL, Fstrerror(fd)); retcode = 1; } - Fclose(fd); + (void) Fclose(fd); /* If successful, restart the query loop. */ if (retcode == 0) @@ -608,7 +607,7 @@ restart: } for (pkg = spec->packages; pkg != NULL; pkg = pkg->next) { - showPackage(qva, NULL, pkg->header); + (void) showPackage(qva, NULL, pkg->header); } freeSpecVec(spec); } break; @@ -768,7 +767,7 @@ int rpmQuery(QVA_t *qva, rpmQVSources source, const char * arg) rc = rpmQueryVerify(qva, source, arg, rpmdb, showQueryPackage); if (rpmdb != NULL) - rpmdbClose(rpmdb); + (void) rpmdbClose(rpmdb); return rc; } diff --git a/lib/rpmchecksig.c b/lib/rpmchecksig.c index d4f8025b6..82f9e0b6e 100644 --- a/lib/rpmchecksig.c +++ b/lib/rpmchecksig.c @@ -27,7 +27,7 @@ static int manageFile(FD_t *fdp, const char **fnp, int flags, /* close and reset *fdp to NULL */ if (*fdp && (fnp == NULL || *fnp == NULL)) { - Fclose(*fdp); + (void) Fclose(*fdp); *fdp = NULL; return 0; } @@ -94,8 +94,8 @@ static int copyFile(FD_t *sfdp, const char **sfnp, rc = 0; exit: - if (*sfdp) manageFile(sfdp, NULL, 0, rc); - if (*tfdp) manageFile(tfdp, NULL, 0, rc); + if (*sfdp) (void) manageFile(sfdp, NULL, 0, rc); + if (*tfdp) (void) manageFile(tfdp, NULL, 0, rc); return rc; } @@ -159,12 +159,12 @@ int rpmReSign(rpmResignFlags add, char *passPhrase, const char **argv) if (add != RESIGN_ADD_SIGNATURE) { rpmFreeSignature(sig); sig = rpmNewSignature(); - rpmAddSignature(sig, sigtarget, RPMSIGTAG_SIZE, passPhrase); - rpmAddSignature(sig, sigtarget, RPMSIGTAG_MD5, passPhrase); + (void) rpmAddSignature(sig, sigtarget, RPMSIGTAG_SIZE, passPhrase); + (void) rpmAddSignature(sig, sigtarget, RPMSIGTAG_MD5, passPhrase); } if ((sigtype = rpmLookupSignatureType(RPMLOOKUPSIG_QUERY)) > 0) - rpmAddSignature(sig, sigtarget, sigtype, passPhrase); + (void) rpmAddSignature(sig, sigtarget, sigtype, passPhrase); /* Write the lead/signature of the output rpm */ strcpy(tmprpm, rpm); @@ -196,30 +196,31 @@ int rpmReSign(rpmResignFlags add, char *passPhrase, const char **argv) /* ASSERT: fd == NULL && ofd == NULL */ /* Clean up intermediate target */ - unlink(sigtarget); + (void) unlink(sigtarget); sigtarget = _free(sigtarget); /* Move final target into place. */ - unlink(rpm); - rename(trpm, rpm); tmprpm[0] = '\0'; + (void) unlink(rpm); + (void) rename(trpm, rpm); + tmprpm[0] = '\0'; } res = 0; exit: - if (fd) manageFile(&fd, NULL, 0, res); - if (ofd) manageFile(&ofd, NULL, 0, res); + if (fd) (void) manageFile(&fd, NULL, 0, res); + if (ofd) (void) manageFile(&ofd, NULL, 0, res); if (sig) { rpmFreeSignature(sig); sig = NULL; } if (sigtarget) { - unlink(sigtarget); + (void) unlink(sigtarget); sigtarget = _free(sigtarget); } if (tmprpm[0] != '\0') { - unlink(tmprpm); + (void) unlink(tmprpm); tmprpm[0] = '\0'; } @@ -422,7 +423,7 @@ int rpmCheckSig(rpmCheckSigFlags flags, const char **argv) } headerFreeIterator(hi); res += res2; - unlink(sigtarget); + (void) unlink(sigtarget); sigtarget = _free(sigtarget); if (res2) { @@ -455,10 +456,10 @@ int rpmCheckSig(rpmCheckSigFlags flags, const char **argv) } bottom: - if (fd) manageFile(&fd, NULL, 0, 0); - if (ofd) manageFile(&ofd, NULL, 0, 0); + if (fd) (void) manageFile(&fd, NULL, 0, 0); + if (ofd) (void) manageFile(&ofd, NULL, 0, 0); if (sigtarget) { - unlink(sigtarget); + (void) unlink(sigtarget); sigtarget = _free(sigtarget); } } diff --git a/lib/rpmdb.c b/lib/rpmdb.c index 7acc3a6c0..c5fb6edc5 100644 --- a/lib/rpmdb.c +++ b/lib/rpmdb.c @@ -630,8 +630,8 @@ static void blockSignals(rpmdb rpmdb, /*@out@*/ sigset_t * oldMask) /* XXX HACK (disabled) permit ^C aborts for now ... */ if (!(rpmdb && rpmdb->db_api == 4)) { - sigfillset(&newMask); /* block all signals */ - sigprocmask(SIG_BLOCK, &newMask, oldMask); + (void) sigfillset(&newMask); /* block all signals */ + (void) sigprocmask(SIG_BLOCK, &newMask, oldMask); } } @@ -642,7 +642,7 @@ static void unblockSignals(rpmdb rpmdb, sigset_t * oldMask) { /* XXX HACK (disabled) permit ^C aborts for now ... */ if (!(rpmdb && rpmdb->db_api == 4)) { - sigprocmask(SIG_SETMASK, oldMask, NULL); + (void) sigprocmask(SIG_SETMASK, oldMask, NULL); } } @@ -685,7 +685,7 @@ int rpmdbClose (rpmdb rpmdb) if (rpmdb->_dbi[dbix] == NULL) continue; /*@-unqualifiedtrans@*/ - dbiClose(rpmdb->_dbi[dbix], 0); + (void) dbiClose(rpmdb->_dbi[dbix], 0); rpmdb->_dbi[dbix] = NULL; /*@=unqualifiedtrans@*/ } @@ -735,7 +735,7 @@ static /*@only@*/ rpmdb newRpmdb(/*@kept@*/ const char * root, rpmdb->db_home = rpmGetPath( (home && *home ? home : _DB_HOME), NULL); if (!(rpmdb->db_home && rpmdb->db_home[0] != '%')) { rpmError(RPMERR_DBOPEN, _("no dbpath has been set\n")); - rpmdbClose(rpmdb); + (void) rpmdbClose(rpmdb); /*@-globstate@*/ return NULL; /*@=globstate@*/ } rpmdb->db_errpfx = rpmExpand( (epfx && *epfx ? epfx : _DB_ERRPFX), NULL); @@ -844,7 +844,7 @@ static int openDatabase(const char * prefix, const char * dbpath, int _dbapi, exit: if (rc || justCheck || dbp == NULL) - rpmdbClose(rpmdb); + (void) rpmdbClose(rpmdb); else *dbp = rpmdb; @@ -867,8 +867,8 @@ int rpmdbInit (const char * prefix, int perms) rc = openDatabase(prefix, NULL, _dbapi, &rpmdb, (O_CREAT | O_RDWR), perms, RPMDB_FLAG_JUSTCHECK); if (rpmdb) { - rpmdbOpenAll(rpmdb); - rpmdbClose(rpmdb); + (void) rpmdbOpenAll(rpmdb); + (void) rpmdbClose(rpmdb); rpmdb = NULL; } return rc; @@ -946,9 +946,9 @@ static int rpmdbFindByFile(rpmdb rpmdb, const char * filespec, continue; } - hge(h, RPMTAG_BASENAMES, &bnt, (void **) &baseNames, NULL); - hge(h, RPMTAG_DIRNAMES, &dnt, (void **) &dirNames, NULL); - hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); + (void) hge(h, RPMTAG_BASENAMES, &bnt, (void **) &baseNames, NULL); + (void) hge(h, RPMTAG_DIRNAMES, &dnt, (void **) &dirNames, NULL); + (void) hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); do { fingerPrint fp2; @@ -958,7 +958,7 @@ static int rpmdbFindByFile(rpmdb rpmdb, const char * filespec, if (FP_EQUAL(fp1, fp2)) { rec->hdrNum = dbiIndexRecordOffset(allMatches, i); rec->tagNum = dbiIndexRecordFileNumber(allMatches, i); - dbiAppendSet(*matches, rec, 1, sizeof(*rec), 0); + (void) dbiAppendSet(*matches, rec, 1, sizeof(*rec), 0); } prevoff = offset; @@ -1071,7 +1071,7 @@ static int dbiFindMatches(dbiIndex dbi, DBC * dbcursor, goto exit; } - headerNVR(h, NULL, &pkgVersion, &pkgRelease); + (void) headerNVR(h, NULL, &pkgVersion, &pkgRelease); goodRelease = goodVersion = 1; @@ -1200,8 +1200,8 @@ struct _rpmdbMatchIterator { unsigned int mi_filenum; unsigned int mi_fpnum; unsigned int mi_dbnum; -/*@only@*/ const char *mi_version; -/*@only@*/ const char *mi_release; +/*@only@*/ const char * mi_version; +/*@only@*/ const char * mi_release; }; rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi) @@ -1217,7 +1217,7 @@ rpmdbMatchIterator rpmdbFreeIterator(rpmdbMatchIterator mi) if (mi->mi_modified && mi->mi_prevoffset) { DBC * dbcursor = NULL; xx = dbiCopen(dbi, &dbcursor, 0); - dbiUpdateRecord(dbi, dbcursor, mi->mi_prevoffset, mi->mi_h); + (void) dbiUpdateRecord(dbi, dbcursor, mi->mi_prevoffset, mi->mi_h); xx = dbiCclose(dbi, dbcursor, 0); dbcursor = NULL; } @@ -1328,6 +1328,13 @@ top: keylen = mi->mi_keylen; rc = dbiGet(dbi, mi->mi_dbc, &keyp, &keylen, &uh, &uhlen, 0); +if (dbi->dbi_api == 1 && dbi->dbi_rpmtag == RPMDBI_PACKAGES && rc == EFAULT) { + rpmError(RPMERR_INTERNAL, + _("record number %u in database is bad -- skipping.\n"), dbi->dbi_lastoffset); + if (keyp && dbi->dbi_lastoffset) + memcpy(&mi->mi_offset, keyp, sizeof(mi->mi_offset)); + continue; +} /* * If we got the next key, save the header instance number. @@ -1359,23 +1366,25 @@ top: /* Free current header */ if (mi->mi_h) { if (mi->mi_modified && mi->mi_prevoffset) - dbiUpdateRecord(dbi, mi->mi_dbc, mi->mi_prevoffset, mi->mi_h); + (void) dbiUpdateRecord(dbi, mi->mi_dbc, mi->mi_prevoffset, mi->mi_h); headerFree(mi->mi_h); mi->mi_h = NULL; } mi->mi_h = headerCopyLoad(uh); + /* XXX db1 with hybrid, simulated db interface on falloc.c needs free. */ + if (dbi->dbi_api <= 1) free(uh); if (mi->mi_release) { const char *release; - headerNVR(mi->mi_h, NULL, NULL, &release); + (void) headerNVR(mi->mi_h, NULL, NULL, &release); if (strcmp(mi->mi_release, release)) goto top; } if (mi->mi_version) { const char *version; - headerNVR(mi->mi_h, NULL, &version, NULL); + (void) headerNVR(mi->mi_h, NULL, &version, NULL); if (strcmp(mi->mi_version, version)) goto top; } @@ -1456,7 +1465,7 @@ int rpmdbPruneIterator(rpmdbMatchIterator mi, int * hdrNums, return 1; if (mi->mi_set) - dbiPruneSet(mi->mi_set, hdrNums, nHdrNums, sizeof(*hdrNums), sorted); + (void) dbiPruneSet(mi->mi_set, hdrNums, nHdrNums, sizeof(*hdrNums), sorted); return 0; } @@ -1467,7 +1476,7 @@ int rpmdbAppendIterator(rpmdbMatchIterator mi, const int * hdrNums, int nHdrNums if (mi->mi_set == NULL) mi->mi_set = xcalloc(1, sizeof(*mi->mi_set)); - dbiAppendSet(mi->mi_set, hdrNums, nHdrNums, sizeof(*hdrNums), 0); + (void) dbiAppendSet(mi->mi_set, hdrNums, nHdrNums, sizeof(*hdrNums), 0); return 0; } @@ -1622,11 +1631,11 @@ int rpmdbRemove(rpmdb rpmdb, int rid, unsigned int hdrNum) /* Add remove transaction id to header. */ if (rid > 0) { int_32 tid = rid; - headerAddEntry(h, RPMTAG_REMOVETID, RPM_INT32_TYPE, &tid, 1); + (void) headerAddEntry(h, RPMTAG_REMOVETID, RPM_INT32_TYPE, &tid, 1); } { const char *n, *v, *r; - headerNVR(h, &n, &v, &r); + (void) headerNVR(h, &n, &v, &r); rpmMessage(RPMMESS_DEBUG, " --- %10u %s-%s-%s\n", hdrNum, n, v, r); } @@ -1783,7 +1792,7 @@ static INLINE int addIndexEntry(dbiIndex dbi, DBC * dbcursor, rc = 0; set = xcalloc(1, sizeof(*set)); } - dbiAppendSet(set, rec, 1, sizeof(*rec), 0); + (void) dbiAppendSet(set, rec, 1, sizeof(*rec), 0); if (dbiUpdateIndex(dbi, dbcursor, keyp, keylen, set)) rc = 1; } @@ -1813,8 +1822,8 @@ int rpmdbAdd(rpmdb rpmdb, int iid, Header h) if (iid > 0) { int_32 tid = iid; - headerRemoveEntry(h, RPMTAG_REMOVETID); - headerAddEntry(h, RPMTAG_INSTALLTID, RPM_INT32_TYPE, &tid, 1); + (void) headerRemoveEntry(h, RPMTAG_REMOVETID); + (void) headerAddEntry(h, RPMTAG_INSTALLTID, RPM_INT32_TYPE, &tid, 1); } /* @@ -1823,7 +1832,7 @@ int rpmdbAdd(rpmdb rpmdb, int iid, Header h) * being written to the package header database. */ - hge(h, RPMTAG_BASENAMES, &bnt, (void **) &baseNames, &count); + (void) hge(h, RPMTAG_BASENAMES, &bnt, (void **) &baseNames, &count); if (_noDirTokens) expandFilelist(h); @@ -1912,7 +1921,7 @@ int rpmdbAdd(rpmdb rpmdb, int iid, Header h) if (!dbi->dbi_no_dbsync) xx = dbiSync(dbi, 0); { const char *n, *v, *r; - headerNVR(h, &n, &v, &r); + (void) headerNVR(h, &n, &v, &r); rpmMessage(RPMMESS_DEBUG, " +++ %10u %s-%s-%s\n", hdrNum, n, v, r); } continue; @@ -1924,11 +1933,11 @@ int rpmdbAdd(rpmdb rpmdb, int iid, Header h) rpmcnt = count; break; case RPMTAG_REQUIRENAME: - hge(h, rpmtag, &rpmtype, (void **)&rpmvals, &rpmcnt); - hge(h, RPMTAG_REQUIREFLAGS, NULL, (void **)&requireFlags, NULL); + (void) hge(h, rpmtag, &rpmtype, (void **)&rpmvals, &rpmcnt); + (void) hge(h, RPMTAG_REQUIREFLAGS, NULL, (void **)&requireFlags, NULL); break; default: - hge(h, rpmtag, &rpmtype, (void **)&rpmvals, &rpmcnt); + (void) hge(h, rpmtag, &rpmtype, (void **)&rpmvals, &rpmcnt); break; } @@ -2066,7 +2075,7 @@ int rpmdbFindFpList(rpmdb rpmdb, fingerPrint * fpList, dbiIndexSet * matchList, /* Gather all matches from the database */ for (i = 0; i < numItems; i++) { - rpmdbGrowIterator(mi, fpList[i].baseName, 0, i); + (void) rpmdbGrowIterator(mi, fpList[i].baseName, 0, i); matchList[i] = xcalloc(1, sizeof(*(matchList[i]))); } @@ -2104,9 +2113,9 @@ int rpmdbFindFpList(rpmdb rpmdb, fingerPrint * fpList, dbiIndexSet * matchList, num = end - start; /* Compute fingerprints for this header's matches */ - hge(h, RPMTAG_BASENAMES, &bnt, (void **) &fullBaseNames, NULL); - hge(h, RPMTAG_DIRNAMES, &dnt, (void **) &dirNames, NULL); - hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &fullDirIndexes, NULL); + (void) hge(h, RPMTAG_BASENAMES, &bnt, (void **) &fullBaseNames, NULL); + (void) hge(h, RPMTAG_DIRNAMES, &dnt, (void **) &dirNames, NULL); + (void) hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &fullDirIndexes, NULL); baseNames = xcalloc(num, sizeof(*baseNames)); dirIndexes = xcalloc(num, sizeof(*dirIndexes)); @@ -2122,7 +2131,7 @@ int rpmdbFindFpList(rpmdb rpmdb, fingerPrint * fpList, dbiIndexSet * matchList, for (i = 0; i < num; i++, im++) { if (FP_EQUAL(fps[i], fpList[im->fpNum])) /*@-usedef@*/ - dbiAppendSet(matchList[im->fpNum], im, 1, sizeof(*im), 0); + (void) dbiAppendSet(matchList[im->fpNum], im, 1, sizeof(*im), 0); /*@=usedef@*/ } @@ -2442,7 +2451,7 @@ int rpmdbRebuild(const char * rootdir) const char * name, * version, * release; int skip = 0; - headerNVR(h, &name, &version, &release); + (void) headerNVR(h, &name, &version, &release); /*@-shadow@*/ { rpmdbMatchIterator mi; @@ -2485,14 +2494,14 @@ int rpmdbRebuild(const char * rootdir) olddb->db_remove_env = 1; newdb->db_remove_env = 1; } - rpmdbClose(olddb); - rpmdbClose(newdb); + (void) rpmdbClose(olddb); + (void) rpmdbClose(newdb); if (failed) { rpmMessage(RPMMESS_NORMAL, _("failed to rebuild database: original database " "remains in place\n")); - rpmdbRemoveDatabase(rootdir, newdbpath, _dbapi_rebuild); + (void) rpmdbRemoveDatabase(rootdir, newdbpath, _dbapi_rebuild); rc = 1; goto exit; } else if (!nocleanup) { diff --git a/lib/rpminstall.c b/lib/rpminstall.c index f2834f27b..0debbbd0f 100644 --- a/lib/rpminstall.c +++ b/lib/rpminstall.c @@ -48,32 +48,32 @@ static void printHash(const unsigned long amount, const unsigned long total) #ifdef FANCY_HASH if (isatty (STDOUT_FILENO)) { int i; - for (i = 0; i < hashesPrinted; i++) putchar ('#'); - for (; i < hashesTotal; i++) putchar (' '); + for (i = 0; i < hashesPrinted; i++) (void) putchar ('#'); + for (; i < hashesTotal; i++) (void) putchar (' '); printf ("(%3d%%)", (int)(100 * (total ? (((float) amount) / total) : 1))); - for (i = 0; i < (hashesTotal + 6); i++) putchar ('\b'); + for (i = 0; i < (hashesTotal + 6); i++) (void) putchar ('\b'); } else #endif fprintf(stdout, "#"); hashesPrinted++; } - fflush(stdout); + (void) fflush(stdout); hashesPrinted = hashesNeeded; if (hashesPrinted == hashesTotal) { #ifdef FANCY_HASH int i; progressCurrent++; - for (i = 1; i < hashesPrinted; i++) putchar ('#'); + for (i = 1; i < hashesPrinted; i++) (void) putchar ('#'); printf (" [%3d%%]\n", (int)(100 * (progressTotal ? (((float) progressCurrent) / progressTotal) : 1))); #else fprintf (stdout, "\n"); #endif } - fflush(stdout); + (void) fflush(stdout); } } @@ -102,7 +102,7 @@ static void * showProgress(const void * arg, const rpmCallbackType what, case RPMCALLBACK_INST_CLOSE_FILE: fd = fdFree(fd, "persist (showProgress)"); if (fd) { - Fclose(fd); + (void) Fclose(fd); fd = NULL; } break; @@ -120,12 +120,12 @@ static void * showProgress(const void * arg, const rpmCallbackType what, #else fprintf(stdout, "%-28s", s); #endif - fflush(stdout); + (void) fflush(stdout); } else { s = headerSprintf(h, "%{NAME}-%{VERSION}-%{RELEASE}", rpmTagTable, rpmHeaderFormats, NULL); fprintf(stdout, "%s\n", s); - fflush(stdout); + (void) fflush(stdout); } s = _free(s); break; @@ -138,7 +138,7 @@ static void * showProgress(const void * arg, const rpmCallbackType what, : 100.0)); else if (flags & INSTALL_HASH) printHash(amount, total); - fflush(stdout); + (void) fflush(stdout); break; case RPMCALLBACK_TRANS_START: @@ -153,7 +153,7 @@ static void * showProgress(const void * arg, const rpmCallbackType what, fprintf(stdout, "%-28s", _("Preparing...")); else printf("%s\n", _("Preparing packages for installation...")); - fflush(stdout); + (void) fflush(stdout); break; case RPMCALLBACK_TRANS_STOP: @@ -312,13 +312,13 @@ restart: if (fd == NULL || Ferror(fd)) { rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), *fnp, Fstrerror(fd)); - if (fd) Fclose(fd); + if (fd) (void) Fclose(fd); numFailed++; *fnp = NULL; continue; } rpmrc = rpmReadPackageHeader(fd, &h, &isSource, NULL, NULL); - Fclose(fd); + (void) Fclose(fd); if (rpmrc == RPMRC_FAIL || rpmrc == RPMRC_SHORTREAD) { numFailed++; *fnp = NULL; @@ -367,7 +367,7 @@ restart: paths = headerFreeData(paths, pft); } else { const char * name; - headerNVR(h, &name, NULL, NULL); + (void) headerNVR(h, &name, NULL, NULL); rpmMessage(RPMMESS_ERROR, _("package %s is not relocateable\n"), name); numFailed++; @@ -383,7 +383,7 @@ restart: Header oldH; int count; - headerNVR(h, &name, NULL, NULL); + (void) headerNVR(h, &name, NULL, NULL); mi = rpmdbInitIterator(db, RPMTAG_NAME, name, 0); count = rpmdbGetIteratorCount(mi); while ((oldH = rpmdbNextIterator(mi)) != NULL) { @@ -443,7 +443,7 @@ restart: if (fd == NULL || Ferror(fd)) { rpmError(RPMERR_OPEN, _("open of %s failed: %s\n"), *fnp, Fstrerror(fd)); - if (fd) Fclose(fd); + if (fd) (void) Fclose(fd); numFailed++; *fnp = NULL; break; } @@ -453,7 +453,7 @@ restart: if (rc) rpmError(RPMERR_MANIFEST, _("%s: read manifest failed: %s\n"), fileURL, Fstrerror(fd)); - Fclose(fd); + (void) Fclose(fd); /* If successful, restart the query loop. */ if (rc == 0) { @@ -521,7 +521,7 @@ restart: if (fd == NULL || Ferror(fd)) { rpmMessage(RPMMESS_ERROR, _("cannot open file %s: %s\n"), sourceURL[i], Fstrerror(fd)); - if (fd) Fclose(fd); + if (fd) (void) Fclose(fd); continue; } @@ -531,7 +531,7 @@ restart: if (rpmrc != RPMRC_OK) numFailed++; } - Fclose(fd); + (void) Fclose(fd); } } @@ -539,13 +539,13 @@ exit: if (ts) rpmtransFree(ts); for (i = 0; i < numPkgs; i++) { if (pkgState[i] == 1) - Unlink(pkgURL[i]); + (void) Unlink(pkgURL[i]); pkgURL[i] = _free(pkgURL[i]); } pkgState = _free(pkgState); pkgURL = _free(pkgURL); argv = _free(argv); - if (dbIsOpen) rpmdbClose(db); + if (dbIsOpen) (void) rpmdbClose(db); return numFailed; } @@ -628,7 +628,7 @@ int rpmErase(const char * rootdir, const char ** argv, } rpmtransFree(ts); - rpmdbClose(db); + (void) rpmdbClose(db); return numFailed; } @@ -642,7 +642,7 @@ int rpmInstallSource(const char * rootdir, const char * arg, fd = Fopen(arg, "r.ufdio"); if (fd == NULL || Ferror(fd)) { rpmMessage(RPMMESS_ERROR, _("cannot open %s: %s\n"), arg, Fstrerror(fd)); - if (fd) Fclose(fd); + if (fd) (void) Fclose(fd); return 1; } @@ -663,7 +663,7 @@ int rpmInstallSource(const char * rootdir, const char * arg, /*@=unqualifiedtrans@*/ } - Fclose(fd); + (void) Fclose(fd); return rc; } diff --git a/lib/rpmrc.c b/lib/rpmrc.c index 98eda9838..5b3dead25 100644 --- a/lib/rpmrc.c +++ b/lib/rpmrc.c @@ -612,7 +612,7 @@ static int doReadRC( /*@killref@*/ FD_t fd, const char * urlfn) { off_t size = fdSize(fd); size_t nb = (size >= 0 ? size : (8*BUFSIZ - 2)); if (nb == 0) { - Fclose(fd); + (void) Fclose(fd); return 0; } next = alloca(nb + 2); @@ -624,7 +624,7 @@ static int doReadRC( /*@killref@*/ FD_t fd, const char * urlfn) rc = 1; } else rc = 0; - Fclose(fd); + (void) Fclose(fd); if (rc) return rc; next[nb] = '\n'; next[nb + 1] = '\0'; @@ -962,7 +962,7 @@ static void defaultMachine(/*@out@*/ const char ** arch, /*@out@*/ const char ** const struct canonEntry * canon; if (!gotDefaults) { - uname(&un); + (void) uname(&un); #if !defined(__linux__) #ifdef SNI @@ -1017,7 +1017,7 @@ static void defaultMachine(/*@out@*/ const char ** arch, /*@out@*/ const char ** if (!Ferror(fd)) { chptr = xcalloc(1, 256); { int irelid = Fread(chptr, sizeof(*chptr), 256, fd); - Fclose(fd); + (void) Fclose(fd); /* example: "112393 RELEASE 020200 Version 01 OS" */ if (irelid > 0) { if ((prelid = strstr(chptr, "RELEASE "))){ diff --git a/lib/signature.c b/lib/signature.c index 908319a7f..99eab6539 100644 --- a/lib/signature.c +++ b/lib/signature.c @@ -162,7 +162,7 @@ rpmRC rpmReadSignature(FD_t fd, Header * headerp, sigType sig_type) if (timedRead(fd, buf, 256) != 256) break; h = headerNew(); - headerAddEntry(h, RPMSIGTAG_PGP, RPM_BIN_TYPE, buf, 152); + (void) headerAddEntry(h, RPMSIGTAG_PGP, RPM_BIN_TYPE, buf, 152); rc = RPMRC_OK; break; case RPMSIGTYPE_MD5: @@ -248,7 +248,7 @@ static int makePGPSignature(const char * file, /*@out@*/ void ** sig, (void) stpcpy( stpcpy(sigfile, file), ".sig"); inpipe[0] = inpipe[1] = 0; - pipe(inpipe); + (void) pipe(inpipe); if (!(pid = fork())) { const char *pgp_path = rpmExpand("%{_pgp_path}", NULL); @@ -256,24 +256,24 @@ static int makePGPSignature(const char * file, /*@out@*/ void ** sig, const char *path; pgpVersion pgpVer; - close(STDIN_FILENO); - dup2(inpipe[0], 3); - close(inpipe[1]); + (void) close(STDIN_FILENO); + (void) dup2(inpipe[0], 3); + (void) close(inpipe[1]); - dosetenv("PGPPASSFD", "3", 1); + (void) dosetenv("PGPPASSFD", "3", 1); if (pgp_path && *pgp_path != '%') - dosetenv("PGPPATH", pgp_path, 1); + (void) dosetenv("PGPPATH", pgp_path, 1); /* dosetenv("PGPPASS", passPhrase, 1); */ if ((path = rpmDetectPGPVersion(&pgpVer)) != NULL) { switch(pgpVer) { case PGP_2: - execlp(path, "pgp", "+batchmode=on", "+verbose=0", "+armor=off", + (void) execlp(path, "pgp", "+batchmode=on", "+verbose=0", "+armor=off", name, "-sb", file, sigfile, NULL); break; case PGP_5: - execlp(path,"pgps", "+batchmode=on", "+verbose=0", "+armor=off", + (void) execlp(path,"pgps", "+batchmode=on", "+verbose=0", "+armor=off", name, "-b", file, "-o", sigfile, NULL); break; case PGP_UNKNOWN: @@ -285,10 +285,10 @@ static int makePGPSignature(const char * file, /*@out@*/ void ** sig, _exit(RPMERR_EXEC); } - close(inpipe[0]); - (void)write(inpipe[1], passPhrase, strlen(passPhrase)); - (void)write(inpipe[1], "\n", 1); - close(inpipe[1]); + (void) close(inpipe[0]); + (void) write(inpipe[1], passPhrase, strlen(passPhrase)); + (void) write(inpipe[1], "\n", 1); + (void) close(inpipe[1]); (void)waitpid(pid, &status, 0); if (!WIFEXITED(status) || WEXITSTATUS(status)) { @@ -298,7 +298,7 @@ static int makePGPSignature(const char * file, /*@out@*/ void ** sig, if (stat(sigfile, &st)) { /* PGP failed to write signature */ - unlink(sigfile); /* Just in case */ + (void) unlink(sigfile); /* Just in case */ rpmError(RPMERR_SIGGEN, _("pgp failed to write signature\n")); return 1; } @@ -311,10 +311,10 @@ static int makePGPSignature(const char * file, /*@out@*/ void ** sig, int rc; fd = Fopen(sigfile, "r.fdio"); rc = timedRead(fd, *sig, *size); - unlink(sigfile); - Fclose(fd); + (void) unlink(sigfile); + (void) Fclose(fd); if (rc != *size) { - free(*sig); + *sig = _free(*sig); rpmError(RPMERR_SIGGEN, _("unable to read the signature\n")); return 1; } @@ -342,19 +342,19 @@ static int makeGPGSignature(const char * file, /*@out@*/ void ** sig, (void) stpcpy( stpcpy(sigfile, file), ".sig"); inpipe[0] = inpipe[1] = 0; - pipe(inpipe); + (void) pipe(inpipe); if (!(pid = fork())) { const char *gpg_path = rpmExpand("%{_gpg_path}", NULL); const char *name = rpmExpand("%{_gpg_name}", NULL); - close(STDIN_FILENO); - dup2(inpipe[0], 3); - close(inpipe[1]); + (void) close(STDIN_FILENO); + (void) dup2(inpipe[0], 3); + (void) close(inpipe[1]); if (gpg_path && *gpg_path != '%') - dosetenv("GNUPGHOME", gpg_path, 1); - execlp("gpg", "gpg", + (void) dosetenv("GNUPGHOME", gpg_path, 1); + (void) execlp("gpg", "gpg", "--batch", "--no-verbose", "--no-armor", "--passphrase-fd", "3", "-u", name, "-sbo", sigfile, file, NULL); @@ -363,9 +363,9 @@ static int makeGPGSignature(const char * file, /*@out@*/ void ** sig, } fpipe = fdopen(inpipe[1], "w"); - close(inpipe[0]); + (void) close(inpipe[0]); fprintf(fpipe, "%s\n", passPhrase); - fclose(fpipe); + (void) fclose(fpipe); (void)waitpid(pid, &status, 0); if (!WIFEXITED(status) || WEXITSTATUS(status)) { @@ -375,7 +375,7 @@ static int makeGPGSignature(const char * file, /*@out@*/ void ** sig, if (stat(sigfile, &st)) { /* GPG failed to write signature */ - unlink(sigfile); /* Just in case */ + (void) unlink(sigfile); /* Just in case */ rpmError(RPMERR_SIGGEN, _("gpg failed to write signature\n")); return 1; } @@ -388,10 +388,10 @@ static int makeGPGSignature(const char * file, /*@out@*/ void ** sig, int rc; fd = Fopen(sigfile, "r.fdio"); rc = timedRead(fd, *sig, *size); - unlink(sigfile); - Fclose(fd); + (void) unlink(sigfile); + (void) Fclose(fd); if (rc != *size) { - free(*sig); + *sig = _free(*sig); rpmError(RPMERR_SIGGEN, _("unable to read the signature\n")); return 1; } @@ -413,28 +413,28 @@ int rpmAddSignature(Header header, const char * file, int_32 sigTag, switch (sigTag) { case RPMSIGTAG_SIZE: - stat(file, &st); + (void) stat(file, &st); size = st.st_size; ret = 0; - headerAddEntry(header, RPMSIGTAG_SIZE, RPM_INT32_TYPE, &size, 1); + (void) headerAddEntry(header, RPMSIGTAG_SIZE, RPM_INT32_TYPE, &size, 1); break; case RPMSIGTAG_MD5: ret = mdbinfile(file, buf); if (ret == 0) - headerAddEntry(header, sigTag, RPM_BIN_TYPE, buf, 16); + (void) headerAddEntry(header, sigTag, RPM_BIN_TYPE, buf, 16); break; case RPMSIGTAG_PGP5: /* XXX legacy */ case RPMSIGTAG_PGP: rpmMessage(RPMMESS_VERBOSE, _("Generating signature using PGP.\n")); ret = makePGPSignature(file, &sig, &size, passPhrase); if (ret == 0) - headerAddEntry(header, sigTag, RPM_BIN_TYPE, sig, size); + (void) headerAddEntry(header, sigTag, RPM_BIN_TYPE, sig, size); break; case RPMSIGTAG_GPG: rpmMessage(RPMMESS_VERBOSE, _("Generating signature using GPG.\n")); ret = makeGPGSignature(file, &sig, &size, passPhrase); if (ret == 0) - headerAddEntry(header, sigTag, RPM_BIN_TYPE, sig, size); + (void) headerAddEntry(header, sigTag, RPM_BIN_TYPE, sig, size); break; } @@ -446,7 +446,7 @@ verifySizeSignature(const char * datafile, int_32 size, char * result) { struct stat st; - stat(datafile, &st); + (void) stat(datafile, &st); if (size != st.st_size) { sprintf(result, "Header+Archive size mismatch.\n" "Expected %d, saw %d.\n", @@ -466,7 +466,7 @@ verifyMD5Signature(const char * datafile, const byte * sig, { byte md5sum[16]; - fn(datafile, md5sum); + (void) fn(datafile, md5sum); if (memcmp(md5sum, sig, 16)) { sprintf(result, "MD5 sum mismatch\n" "Expected: %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x" @@ -529,21 +529,21 @@ verifyPGPSignature(const char * datafile, const void * sig, int count, } sfd = Fopen(sigfile, "w.fdio"); (void)Fwrite(sig, sizeof(char), count, sfd); - Fclose(sfd); + (void) Fclose(sfd); /* Now run PGP */ outpipe[0] = outpipe[1] = 0; - pipe(outpipe); + (void) pipe(outpipe); if (!(pid = fork())) { const char *pgp_path = rpmExpand("%{_pgp_path}", NULL); - close(outpipe[0]); - close(STDOUT_FILENO); /* XXX unnecessary */ - dup2(outpipe[1], STDOUT_FILENO); + (void) close(outpipe[0]); + (void) close(STDOUT_FILENO); /* XXX unnecessary */ + (void) dup2(outpipe[1], STDOUT_FILENO); if (pgp_path && *pgp_path != '%') - dosetenv("PGPPATH", pgp_path, 1); + (void) dosetenv("PGPPATH", pgp_path, 1); switch (pgpVer) { case PGP_5: @@ -551,19 +551,19 @@ verifyPGPSignature(const char * datafile, const void * sig, int count, /* another message") is _always_ written to stderr; we */ /* want to catch that output, so dup stdout to stderr: */ { int save_stderr = dup(2); - dup2(1, 2); - execlp(path, "pgpv", "+batchmode=on", "+verbose=0", + (void) dup2(1, 2); + (void) execlp(path, "pgpv", "+batchmode=on", "+verbose=0", /* Write "Good signature..." to stdout: */ "+OutputInformationFD=1", /* Write "WARNING: ... is not trusted to... to stdout: */ "+OutputWarningFD=1", sigfile, "-o", datafile, NULL); /* Restore stderr so we can print the error message below. */ - dup2(save_stderr, 2); - close(save_stderr); + (void) dup2(save_stderr, 2); + (void) close(save_stderr); } break; case PGP_2: - execlp(path, "pgp", "+batchmode=on", "+verbose=0", + (void) execlp(path, "pgp", "+batchmode=on", "+verbose=0", sigfile, datafile, NULL); break; case PGP_UNKNOWN: @@ -576,7 +576,7 @@ verifyPGPSignature(const char * datafile, const void * sig, int count, _exit(RPMERR_EXEC); } - close(outpipe[1]); + (void) close(outpipe[1]); file = fdopen(outpipe[0], "r"); result[0] = '\0'; while (fgets(buf, 1024, file)) { @@ -595,10 +595,10 @@ verifyPGPSignature(const char * datafile, const void * sig, int count, else if (!strncmp("Good signature", buf, 14)) res = RPMSIG_OK; } - fclose(file); + (void) fclose(file); - (void)waitpid(pid, &status, 0); - unlink(sigfile); + (void) waitpid(pid, &status, 0); + (void) unlink(sigfile); if (!res && (!WIFEXITED(status) || WEXITSTATUS(status))) { res = RPMSIG_BAD; } @@ -623,24 +623,24 @@ verifyGPGSignature(const char * datafile, const void * sig, int count, tmppath = _free(tmppath); } sfd = Fopen(sigfile, "w.fdio"); - (void)Fwrite(sig, sizeof(char), count, sfd); - Fclose(sfd); + (void) Fwrite(sig, sizeof(char), count, sfd); + (void) Fclose(sfd); /* Now run GPG */ outpipe[0] = outpipe[1] = 0; - pipe(outpipe); + (void) pipe(outpipe); if (!(pid = fork())) { const char *gpg_path = rpmExpand("%{_gpg_path}", NULL); - close(outpipe[0]); + (void) close(outpipe[0]); /* gpg version 0.9 sends its output to stderr. */ - dup2(outpipe[1], STDERR_FILENO); + (void) dup2(outpipe[1], STDERR_FILENO); if (gpg_path && *gpg_path != '%') - dosetenv("GNUPGHOME", gpg_path, 1); + (void) dosetenv("GNUPGHOME", gpg_path, 1); - execlp("gpg", "gpg", + (void) execlp("gpg", "gpg", "--batch", "--no-verbose", "--verify", sigfile, datafile, NULL); @@ -649,7 +649,7 @@ verifyGPGSignature(const char * datafile, const void * sig, int count, _exit(RPMERR_EXEC); } - close(outpipe[1]); + (void) close(outpipe[1]); file = fdopen(outpipe[0], "r"); result[0] = '\0'; while (fgets(buf, 1024, file)) { @@ -658,10 +658,10 @@ verifyGPGSignature(const char * datafile, const void * sig, int count, res = RPMSIG_NOKEY; } } - fclose(file); + (void) fclose(file); - (void)waitpid(pid, &status, 0); - unlink(sigfile); + (void) waitpid(pid, &status, 0); + (void) unlink(sigfile); if (!res && (!WIFEXITED(status) || WEXITSTATUS(status))) { res = RPMSIG_BAD; } @@ -676,31 +676,31 @@ static int checkPassPhrase(const char * passPhrase, const int sigTag) int fd; passPhrasePipe[0] = passPhrasePipe[1] = 0; - pipe(passPhrasePipe); + (void) pipe(passPhrasePipe); if (!(pid = fork())) { - close(STDIN_FILENO); - close(STDOUT_FILENO); - close(passPhrasePipe[1]); + (void) close(STDIN_FILENO); + (void) close(STDOUT_FILENO); + (void) close(passPhrasePipe[1]); if (! rpmIsVerbose()) { - close(STDERR_FILENO); + (void) close(STDERR_FILENO); } if ((fd = open("/dev/null", O_RDONLY)) != STDIN_FILENO) { - dup2(fd, STDIN_FILENO); - close(fd); + (void) dup2(fd, STDIN_FILENO); + (void) close(fd); } if ((fd = open("/dev/null", O_WRONLY)) != STDOUT_FILENO) { - dup2(fd, STDOUT_FILENO); - close(fd); + (void) dup2(fd, STDOUT_FILENO); + (void) close(fd); } - dup2(passPhrasePipe[0], 3); + (void) dup2(passPhrasePipe[0], 3); switch (sigTag) { case RPMSIGTAG_GPG: { const char *gpg_path = rpmExpand("%{_gpg_path}", NULL); const char *name = rpmExpand("%{_gpg_name}", NULL); if (gpg_path && *gpg_path != '%') - dosetenv("GNUPGHOME", gpg_path, 1); - execlp("gpg", "gpg", + (void) dosetenv("GNUPGHOME", gpg_path, 1); + (void) execlp("gpg", "gpg", "--batch", "--no-verbose", "--passphrase-fd", "3", "-u", name, "-so", "-", NULL); @@ -714,18 +714,18 @@ static int checkPassPhrase(const char * passPhrase, const int sigTag) const char *path; pgpVersion pgpVer; - dosetenv("PGPPASSFD", "3", 1); + (void) dosetenv("PGPPASSFD", "3", 1); if (pgp_path && *pgp_path != '%') - dosetenv("PGPPATH", pgp_path, 1); + (void) dosetenv("PGPPATH", pgp_path, 1); if ((path = rpmDetectPGPVersion(&pgpVer)) != NULL) { switch(pgpVer) { case PGP_2: - execlp(path, "pgp", "+batchmode=on", "+verbose=0", + (void) execlp(path, "pgp", "+batchmode=on", "+verbose=0", name, "-sf", NULL); break; case PGP_5: /* XXX legacy */ - execlp(path,"pgps", "+batchmode=on", "+verbose=0", + (void) execlp(path,"pgps", "+batchmode=on", "+verbose=0", name, "-f", NULL); break; case PGP_UNKNOWN: @@ -743,10 +743,10 @@ static int checkPassPhrase(const char * passPhrase, const int sigTag) } } - close(passPhrasePipe[0]); - (void)write(passPhrasePipe[1], passPhrase, strlen(passPhrase)); - (void)write(passPhrasePipe[1], "\n", 1); - close(passPhrasePipe[1]); + (void) close(passPhrasePipe[0]); + (void) write(passPhrasePipe[1], passPhrase, strlen(passPhrase)); + (void) write(passPhrasePipe[1], "\n", 1); + (void) close(passPhrasePipe[1]); (void)waitpid(pid, &status, 0); if (!WIFEXITED(status) || WEXITSTATUS(status)) { diff --git a/lib/transaction.c b/lib/transaction.c index cdc115182..3312f22d5 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -168,7 +168,7 @@ static void psAppend(rpmProblemSet probs, rpmProblemType type, if (altH) { const char * n, * v, * r; - headerNVR(altH, &n, &v, &r); + (void) headerNVR(altH, &n, &v, &r); p->altNEVR = t = xmalloc(strlen(n) + strlen(v) + strlen(r) + sizeof("--")); t = stpcpy(t, n); @@ -186,7 +186,7 @@ static int archOkay(Header h) int type, count; /* make sure we're trying to install this on the proper architecture */ - headerGetEntry(h, RPMTAG_ARCH, &type, (void **) &pkgArch, &count); + (void) headerGetEntry(h, RPMTAG_ARCH, &type, (void **) &pkgArch, &count); #ifndef DYING if (type == RPM_INT8_TYPE) { int_8 * pkgArchNum; @@ -216,7 +216,7 @@ static int osOkay(Header h) int type, count; /* make sure we're trying to install this on the proper os */ - headerGetEntry(h, RPMTAG_OS, &type, (void **) &pkgOs, &count); + (void) headerGetEntry(h, RPMTAG_OS, &type, (void **) &pkgOs, &count); #ifndef DYING if (type == RPM_INT8_TYPE) { /* v1 packages and v2 packages both used improper OS numbers, so just @@ -338,7 +338,7 @@ static Header relocateFileList(const rpmTransactionSet ts, TFI_t fi, if (numRelocations == 0) { if (numValid) { if (!headerIsEntry(origH, RPMTAG_INSTPREFIXES)) - headerAddEntry(origH, RPMTAG_INSTPREFIXES, + (void) headerAddEntry(origH, RPMTAG_INSTPREFIXES, validType, validRelocations, numValid); validRelocations = hfd(validRelocations, validType); } @@ -447,18 +447,18 @@ static Header relocateFileList(const rpmTransactionSet ts, TFI_t fi, } if (numActual) - headerAddEntry(h, RPMTAG_INSTPREFIXES, RPM_STRING_ARRAY_TYPE, + (void) headerAddEntry(h, RPMTAG_INSTPREFIXES, RPM_STRING_ARRAY_TYPE, (void **) actualRelocations, numActual); actualRelocations = _free(actualRelocations); validRelocations = hfd(validRelocations, validType); } - hge(h, RPMTAG_BASENAMES, NULL, (void **) &baseNames, &fileCount); - hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); - hge(h, RPMTAG_DIRNAMES, NULL, (void **) &dirNames, &dirCount); - hge(h, RPMTAG_FILEFLAGS, NULL, (void **) &fFlags, NULL); - hge(h, RPMTAG_FILEMODES, NULL, (void **) &fModes, NULL); + (void) hge(h, RPMTAG_BASENAMES, NULL, (void **) &baseNames, &fileCount); + (void) hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); + (void) hge(h, RPMTAG_DIRNAMES, NULL, (void **) &dirNames, &dirCount); + (void) hge(h, RPMTAG_FILEFLAGS, NULL, (void **) &fFlags, NULL); + (void) hge(h, RPMTAG_FILEMODES, NULL, (void **) &fModes, NULL); skipDirList = alloca(dirCount * sizeof(*skipDirList)); memset(skipDirList, 0, dirCount * sizeof(*skipDirList)); @@ -647,33 +647,33 @@ static Header relocateFileList(const rpmTransactionSet ts, TFI_t fi, int t; p = NULL; - hge(h, RPMTAG_BASENAMES, &t, &p, &c); - headerAddEntry(h, RPMTAG_ORIGBASENAMES, t, p, c); + (void) hge(h, RPMTAG_BASENAMES, &t, &p, &c); + (void) headerAddEntry(h, RPMTAG_ORIGBASENAMES, t, p, c); p = hfd(p, t); p = NULL; - hge(h, RPMTAG_DIRNAMES, &t, &p, &c); - headerAddEntry(h, RPMTAG_ORIGDIRNAMES, t, p, c); + (void) hge(h, RPMTAG_DIRNAMES, &t, &p, &c); + (void) headerAddEntry(h, RPMTAG_ORIGDIRNAMES, t, p, c); p = hfd(p, t); p = NULL; - hge(h, RPMTAG_DIRINDEXES, &t, &p, &c); - headerAddEntry(h, RPMTAG_ORIGDIRINDEXES, t, p, c); + (void) hge(h, RPMTAG_DIRINDEXES, &t, &p, &c); + (void) headerAddEntry(h, RPMTAG_ORIGDIRINDEXES, t, p, c); p = hfd(p, t); - headerModifyEntry(h, RPMTAG_BASENAMES, RPM_STRING_ARRAY_TYPE, + (void) headerModifyEntry(h, RPMTAG_BASENAMES, RPM_STRING_ARRAY_TYPE, baseNames, fileCount); fi->bnl = hfd(fi->bnl, RPM_STRING_ARRAY_TYPE); - hge(h, RPMTAG_BASENAMES, NULL, (void **) &fi->bnl, &fi->fc); + (void) hge(h, RPMTAG_BASENAMES, NULL, (void **) &fi->bnl, &fi->fc); - headerModifyEntry(h, RPMTAG_DIRNAMES, RPM_STRING_ARRAY_TYPE, + (void) headerModifyEntry(h, RPMTAG_DIRNAMES, RPM_STRING_ARRAY_TYPE, dirNames, dirCount); fi->dnl = hfd(fi->dnl, RPM_STRING_ARRAY_TYPE); - hge(h, RPMTAG_DIRNAMES, NULL, (void **) &fi->dnl, &fi->dc); + (void) hge(h, RPMTAG_DIRNAMES, NULL, (void **) &fi->dnl, &fi->dc); - headerModifyEntry(h, RPMTAG_DIRINDEXES, RPM_INT32_TYPE, + (void) headerModifyEntry(h, RPMTAG_DIRINDEXES, RPM_INT32_TYPE, dirIndexes, fileCount); - hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &fi->dil, NULL); + (void) hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &fi->dil, NULL); } baseNames = hfd(baseNames, RPM_STRING_ARRAY_TYPE); @@ -879,12 +879,12 @@ static int handleInstInstalledFiles(TFI_t fi, rpmdb db, return 1; } - hge(h, RPMTAG_FILEMD5S, &omtype, (void **) &otherMd5s, NULL); - hge(h, RPMTAG_FILELINKTOS, &oltype, (void **) &otherLinks, NULL); - hge(h, RPMTAG_FILESTATES, NULL, (void **) &otherStates, NULL); - hge(h, RPMTAG_FILEMODES, NULL, (void **) &otherModes, NULL); - hge(h, RPMTAG_FILEFLAGS, NULL, (void **) &otherFlags, NULL); - hge(h, RPMTAG_FILESIZES, NULL, (void **) &otherSizes, NULL); + (void) hge(h, RPMTAG_FILEMD5S, &omtype, (void **) &otherMd5s, NULL); + (void) hge(h, RPMTAG_FILELINKTOS, &oltype, (void **) &otherLinks, NULL); + (void) hge(h, RPMTAG_FILESTATES, NULL, (void **) &otherStates, NULL); + (void) hge(h, RPMTAG_FILEMODES, NULL, (void **) &otherModes, NULL); + (void) hge(h, RPMTAG_FILEFLAGS, NULL, (void **) &otherFlags, NULL); + (void) hge(h, RPMTAG_FILESIZES, NULL, (void **) &otherSizes, NULL); fi->replaced = xmalloc(sharedCount * sizeof(*fi->replaced)); @@ -964,7 +964,7 @@ static int handleRmvdInstalledFiles(TFI_t fi, rpmdb db, return 1; } - hge(h, RPMTAG_FILESTATES, NULL, (void **) &otherStates, NULL); + (void) hge(h, RPMTAG_FILESTATES, NULL, (void **) &otherStates, NULL); for (i = 0; i < sharedCount; i++, shared++) { int otherFileNum, fileNum; @@ -1023,7 +1023,7 @@ static void handleOverlappedFiles(TFI_t fi, hashTable ht, * will be installed and removed so the records for an overlapped * files will be sorted in exactly the same order. */ - htGetEntry(ht, &fi->fps[i], (const void ***) &recs, &numRecs, NULL); + (void) htGetEntry(ht, &fi->fps[i], (const void ***) &recs, &numRecs, NULL); /* * If this package is being added, look only at other packages @@ -1540,7 +1540,7 @@ int rpmRunTransactions( rpmTransactionSet ts, ts->di[i].iavail = !(sfb.f_ffree == 0 && sfb.f_files == 0) ? sfb.f_ffree : -1; - stat(ts->filesystems[i], &sb); + (void) stat(ts->filesystems[i], &sb); ts->di[i].dev = sb.st_dev; } } @@ -1574,7 +1574,7 @@ int rpmRunTransactions( rpmTransactionSet ts, Header oldH; mi = rpmdbInitIterator(ts->rpmdb, RPMTAG_NAME, alp->name, 0); while ((oldH = rpmdbNextIterator(mi)) != NULL) - ensureOlder(alp, oldH, ts->probs); + (void) ensureOlder(alp, oldH, ts->probs); mi = rpmdbFreeIterator(mi); } @@ -1604,7 +1604,7 @@ int rpmRunTransactions( rpmTransactionSet ts, int fileCount; mi = rpmdbInitIterator(ts->rpmdb, RPMDBI_PACKAGES, NULL, 0); - rpmdbAppendIterator(mi, ts->removedPackages, ts->numRemovedPackages); + (void) rpmdbAppendIterator(mi, ts->removedPackages, ts->numRemovedPackages); while ((h = rpmdbNextIterator(mi)) != NULL) { if (headerGetEntry(h, RPMTAG_BASENAMES, NULL, NULL, &fileCount)) totalFileCount += fileCount; @@ -1675,10 +1675,10 @@ int rpmRunTransactions( rpmTransactionSet ts, tsi = tsFreeIterator(tsi); /* Open all database indices before installing. */ - rpmdbOpenAll(ts->rpmdb); + (void) rpmdbOpenAll(ts->rpmdb); if (!ts->chrootDone) { - chdir("/"); + (void) chdir("/"); /*@-unrecog@*/ chroot(ts->rootDir); /*@=unrecog@*/ ts->chrootDone = 1; } @@ -1791,13 +1791,13 @@ int rpmRunTransactions( rpmTransactionSet ts, /* Determine the fate of each file. */ switch (fi->type) { case TR_ADDED: - handleInstInstalledFiles(fi, ts->rpmdb, shared, nexti - i, + (void) handleInstInstalledFiles(fi, ts->rpmdb, shared, nexti - i, !(beingRemoved || (ts->ignoreSet & RPMPROB_FILTER_REPLACEOLDFILES)), ts->probs, ts->transFlags); break; case TR_REMOVED: if (!beingRemoved) - handleRmvdInstalledFiles(fi, ts->rpmdb, shared, nexti - i); + (void) handleRmvdInstalledFiles(fi, ts->rpmdb, shared, nexti - i); break; } } @@ -1842,7 +1842,7 @@ int rpmRunTransactions( rpmTransactionSet ts, if (ts->chrootDone) { /*@-unrecog@*/ chroot("."); /*@-unrecog@*/ ts->chrootDone = 0; - chdir(ts->currDir); + (void) chdir(ts->currDir); } NOTIFY(ts, (NULL, RPMCALLBACK_TRANS_STOP, 6, ts->flEntries, @@ -1953,7 +1953,7 @@ assert(alp == fi->ap); if (alp->multiLib) ts->transFlags |= RPMTRANS_FLAG_MULTILIB; -if (fi->ap == NULL) fi->ap = alp; /* XXX WTFO? */ +assert(alp == fi->ap); if (psmStage(psm, PSM_PKGINSTALL)) { ourrc++; lastFailed = i; diff --git a/lib/verify.c b/lib/verify.c index eb4acef2e..2dd413772 100644 --- a/lib/verify.c +++ b/lib/verify.c @@ -75,37 +75,31 @@ struct poptOption rpmVerifyPoptTable[] = { int rpmVerifyFile(const char * prefix, Header h, int filenum, int * result, int omitMask) { - char ** baseNames, ** md5List, ** linktoList, ** dirNames; + HGE_t hge = (HGE_t)headerGetEntryMinMemory; + HFD_t hfd = headerFreeData; int_32 * verifyFlags; rpmVerifyAttrs flags; - int_32 * sizeList, * mtimeList, * dirIndexes; - unsigned short * modeList, * rdevList; - char * fileStatesList; + unsigned short * modeList; + const char * fileStatesList; char * filespec; - char * name; - gid_t gid; - int type, count, rc; + int count; + int rc; struct stat sb; - unsigned char md5sum[40]; - int_32 * uidList, * gidList; - char linkto[1024]; - int size; - char ** unameList, ** gnameList; int_32 useBrokenMd5; if (IS_BIG_ENDIAN()) { /* XXX was ifdef WORDS_BIGENDIAN */ int_32 * brokenPtr; - if (!headerGetEntry(h, RPMTAG_BROKENMD5, NULL, (void **) &brokenPtr, NULL)) { - char * rpmVersion; + if (!hge(h, RPMTAG_BROKENMD5, NULL, (void **) &brokenPtr, NULL)) { + const char * rpmVersion; - if (headerGetEntry(h, RPMTAG_RPMVERSION, NULL, (void **) &rpmVersion, - NULL)) { + if (hge(h, RPMTAG_RPMVERSION, NULL, (void **) &rpmVersion, NULL)) { useBrokenMd5 = ((rpmvercmp(rpmVersion, "2.3.3") >= 0) && (rpmvercmp(rpmVersion, "2.3.8") <= 0)); } else { useBrokenMd5 = 1; } - headerAddEntry(h, RPMTAG_BROKENMD5, RPM_INT32_TYPE, &useBrokenMd5, 1); + (void) headerAddEntry(h, RPMTAG_BROKENMD5, RPM_INT32_TYPE, + &useBrokenMd5, 1); } else { useBrokenMd5 = *brokenPtr; } @@ -113,33 +107,38 @@ int rpmVerifyFile(const char * prefix, Header h, int filenum, useBrokenMd5 = 0; } - headerGetEntry(h, RPMTAG_FILEMODES, &type, (void **) &modeList, &count); + (void) hge(h, RPMTAG_FILEMODES, NULL, (void **) &modeList, &count); - if (headerGetEntry(h, RPMTAG_FILEVERIFYFLAGS, &type, (void **) &verifyFlags, - &count)) { + if (hge(h, RPMTAG_FILEVERIFYFLAGS, NULL, (void **) &verifyFlags, NULL)) { flags = verifyFlags[filenum]; } else { flags = RPMVERIFY_ALL; } - headerGetEntry(h, RPMTAG_BASENAMES, &type, (void **) &baseNames, - &count); - headerGetEntry(h, RPMTAG_DIRINDEXES, &type, (void **) &dirIndexes, - NULL); - headerGetEntry(h, RPMTAG_DIRNAMES, &type, (void **) &dirNames, NULL); + { + const char ** baseNames; + const char ** dirNames; + int_32 * dirIndexes; + int bnt, dnt; + + (void) hge(h, RPMTAG_BASENAMES, &bnt, (void **) &baseNames, NULL); + (void) hge(h, RPMTAG_DIRINDEXES, NULL, (void **) &dirIndexes, NULL); + (void) hge(h, RPMTAG_DIRNAMES, &dnt, (void **) &dirNames, NULL); - filespec = alloca(strlen(dirNames[dirIndexes[filenum]]) + + filespec = alloca(strlen(dirNames[dirIndexes[filenum]]) + strlen(baseNames[filenum]) + strlen(prefix) + 5); - sprintf(filespec, "%s/%s%s", prefix, dirNames[dirIndexes[filenum]], + sprintf(filespec, "%s/%s%s", prefix, dirNames[dirIndexes[filenum]], baseNames[filenum]); - free(baseNames); - free(dirNames); + baseNames = hfd(baseNames, bnt); + dirNames = hfd(dirNames, dnt); + } *result = 0; /* Check to see if the file was installed - if not pretend all is OK */ - if (headerGetEntry(h, RPMTAG_FILESTATES, &type, - (void **) &fileStatesList, &count) && fileStatesList) { + if (hge(h, RPMTAG_FILESTATES, NULL, (void **) &fileStatesList, NULL) && + fileStatesList != NULL) + { if (fileStatesList[filenum] == RPMFILE_STATE_NOTINSTALLED) return 0; } @@ -175,7 +174,11 @@ int rpmVerifyFile(const char * prefix, Header h, int filenum, flags &= ~(omitMask | RPMVERIFY_LSTATFAIL|RPMVERIFY_READFAIL|RPMVERIFY_READLINKFAIL); if (flags & RPMVERIFY_MD5) { - headerGetEntry(h, RPMTAG_FILEMD5S, &type, (void **) &md5List, &count); + unsigned char md5sum[40]; + const char ** md5List; + int mdt; + + (void) hge(h, RPMTAG_FILEMD5S, &mdt, (void **) &md5List, NULL); if (useBrokenMd5) { rc = mdfileBroken(filespec, md5sum); } else { @@ -186,10 +189,16 @@ int rpmVerifyFile(const char * prefix, Header h, int filenum, *result |= (RPMVERIFY_READFAIL|RPMVERIFY_MD5); else if (strcmp(md5sum, md5List[filenum])) *result |= RPMVERIFY_MD5; - free(md5List); + md5List = hfd(md5List, mdt); } + if (flags & RPMVERIFY_LINKTO) { - headerGetEntry(h, RPMTAG_FILELINKTOS, &type, (void **) &linktoList, &count); + char linkto[1024]; + int size; + const char ** linktoList; + int ltt; + + (void) hge(h, RPMTAG_FILELINKTOS, <t, (void **) &linktoList, NULL); size = readlink(filespec, linkto, sizeof(linkto)-1); if (size == -1) *result |= (RPMVERIFY_READLINKFAIL|RPMVERIFY_LINKTO); @@ -198,11 +207,13 @@ int rpmVerifyFile(const char * prefix, Header h, int filenum, if (strcmp(linkto, linktoList[filenum])) *result |= RPMVERIFY_LINKTO; } - free(linktoList); + linktoList = hfd(linktoList, ltt); } if (flags & RPMVERIFY_FILESIZE) { - headerGetEntry(h, RPMTAG_FILESIZES, &type, (void **) &sizeList, &count); + int_32 * sizeList; + + (void) hge(h, RPMTAG_FILESIZES, NULL, (void **) &sizeList, NULL); if (sizeList[filenum] != sb.st_size) *result |= RPMVERIFY_FILESIZE; } @@ -221,28 +232,33 @@ int rpmVerifyFile(const char * prefix, Header h, int filenum, S_ISBLK(modeList[filenum]) != S_ISBLK(sb.st_mode)) { *result |= RPMVERIFY_RDEV; } else if (S_ISDEV(modeList[filenum]) && S_ISDEV(sb.st_mode)) { - headerGetEntry(h, RPMTAG_FILERDEVS, NULL, (void **) &rdevList, - NULL); + unsigned short * rdevList; + (void) hge(h, RPMTAG_FILERDEVS, NULL, (void **) &rdevList, NULL); if (rdevList[filenum] != sb.st_rdev) *result |= RPMVERIFY_RDEV; } } if (flags & RPMVERIFY_MTIME) { - headerGetEntry(h, RPMTAG_FILEMTIMES, NULL, (void **) &mtimeList, NULL); + int_32 * mtimeList; + + (void) hge(h, RPMTAG_FILEMTIMES, NULL, (void **) &mtimeList, NULL); if (mtimeList[filenum] != sb.st_mtime) *result |= RPMVERIFY_MTIME; } if (flags & RPMVERIFY_USER) { - if (headerGetEntry(h, RPMTAG_FILEUSERNAME, NULL, (void **) &unameList, - NULL)) { + const char * name; + const char ** unameList; + int_32 * uidList; + int unt; + + if (hge(h, RPMTAG_FILEUSERNAME, &unt, (void **) &unameList, NULL)) { name = uidToUname(sb.st_uid); if (!name || strcmp(unameList[filenum], name)) *result |= RPMVERIFY_USER; - free(unameList); - } else if (headerGetEntry(h, RPMTAG_FILEUIDS, NULL, (void **) &uidList, - &count)) { + unameList = hfd(unameList, unt); + } else if (hge(h, RPMTAG_FILEUIDS, NULL, (void **) &uidList, NULL)) { if (uidList[filenum] != sb.st_uid) *result |= RPMVERIFY_GROUP; } else { @@ -253,14 +269,17 @@ int rpmVerifyFile(const char * prefix, Header h, int filenum, } if (flags & RPMVERIFY_GROUP) { - if (headerGetEntry(h, RPMTAG_FILEGROUPNAME, NULL, (void **) &gnameList, - NULL)) { - rc = gnameToGid(gnameList[filenum],&gid); + const char ** gnameList; + int_32 * gidList; + int gnt; + gid_t gid; + + if (hge(h, RPMTAG_FILEGROUPNAME, &gnt, (void **) &gnameList, NULL)) { + rc = gnameToGid(gnameList[filenum], &gid); if (rc || (gid != sb.st_gid)) *result |= RPMVERIFY_GROUP; - free(gnameList); - } else if (headerGetEntry(h, RPMTAG_FILEGIDS, NULL, (void **) &gidList, - &count)) { + gnameList = hfd(gnameList, gnt); + } else if (hge(h, RPMTAG_FILEGIDS, NULL, (void **) &gidList, NULL)) { if (gidList[filenum] != sb.st_gid) *result |= RPMVERIFY_GROUP; } else { @@ -309,6 +328,7 @@ int rpmVerifyScript(const char * rootDir, Header h, FD_t scriptFd) /* ======================================================================== */ static int verifyHeader(QVA_t *qva, Header h) { + HGE_t hge = (HGE_t)headerGetEntryMinMemory; char buf[BUFSIZ]; char * t, * te; @@ -324,7 +344,7 @@ static int verifyHeader(QVA_t *qva, Header h) te = t = buf; *te = '\0'; - if (!headerGetEntry(h, RPMTAG_FILEFLAGS, NULL, (void **) &fileFlagsList, NULL)) + if (!hge(h, RPMTAG_FILEFLAGS, NULL, (void **) &fileFlagsList, NULL)) goto exit; if (!headerIsEntry(h, RPMTAG_BASENAMES)) @@ -400,16 +420,16 @@ static int verifyDependencies(rpmdb rpmdb, Header h) int i; rpmdep = rpmtransCreateSet(rpmdb, NULL); - rpmtransAddPackage(rpmdep, h, NULL, NULL, 0, NULL); + (void) rpmtransAddPackage(rpmdep, h, NULL, NULL, 0, NULL); - rpmdepCheck(rpmdep, &conflicts, &numConflicts); + (void) rpmdepCheck(rpmdep, &conflicts, &numConflicts); rpmtransFree(rpmdep); if (numConflicts) { const char * name, * version, * release; char * t, * te; int nb = 512; - headerNVR(h, &name, &version, &release); + (void) headerNVR(h, &name, &version, &release); for (i = 0; i < numConflicts; i++) { nb += strlen(conflicts[i].needsName) + sizeof(", ") - 1; @@ -463,7 +483,7 @@ int showVerifyPackage(QVA_t *qva, rpmdb rpmdb, Header h) if ((qva->qva_flags & VERIFY_SCRIPT) && (rc = rpmVerifyScript(qva->qva_prefix, h, fdo)) != 0) ec = rc; - Fclose(fdo); + (void) Fclose(fdo); return ec; } @@ -486,7 +506,7 @@ int rpmVerify(QVA_t *qva, rpmQVSources source, const char *arg) rc = rpmQueryVerify(qva, source, arg, rpmdb, showVerifyPackage); if (rpmdb != NULL) - rpmdbClose(rpmdb); + (void) rpmdbClose(rpmdb); return rc; } diff --git a/po/rpm.pot b/po/rpm.pot index 959ce35d3..294da7454 100644 --- a/po/rpm.pot +++ b/po/rpm.pot @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2001-04-26 16:39-0400\n" +"POT-Creation-Date: 2001-04-30 18:16-0400\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -70,21 +70,21 @@ msgstr "" msgid "Building for target %s\n" msgstr "" -#: rpm.c:224 rpmqv.c:391 +#: rpm.c:224 rpmqv.c:392 #, c-format msgid "rpm: %s\n" msgstr "" -#: rpm.c:235 rpmqv.c:396 +#: rpm.c:235 rpmqv.c:397 #, c-format msgid "RPM version %s\n" msgstr "" -#: rpm.c:239 rpmqv.c:400 +#: rpm.c:239 rpmqv.c:401 msgid "Copyright (C) 1998-2000 - Red Hat, Inc." msgstr "" -#: rpm.c:240 rpmqv.c:401 +#: rpm.c:240 rpmqv.c:402 msgid "This program may be freely redistributed under the terms of the GNU GPL" msgstr "" @@ -271,15 +271,15 @@ msgstr "" msgid " rpm {--querytags}" msgstr "" -#: rpm.c:327 rpmqv.c:476 +#: rpm.c:327 rpmqv.c:477 msgid "Usage:" msgstr "" -#: rpm.c:329 rpmqv.c:478 +#: rpm.c:329 rpmqv.c:479 msgid "print this message" msgstr "" -#: rpm.c:331 rpmqv.c:128 rpmqv.c:480 +#: rpm.c:331 rpmqv.c:128 rpmqv.c:481 msgid "print the version of rpm being used" msgstr "" @@ -291,7 +291,7 @@ msgstr "" msgid " --define '<name> <body>'" msgstr "" -#: rpm.c:336 rpmqv.c:135 rpmqv.c:485 +#: rpm.c:336 rpmqv.c:135 rpmqv.c:486 msgid "define macro <name> with value <body>" msgstr "" @@ -307,7 +307,7 @@ msgstr "" msgid " --pipe <cmd> " msgstr "" -#: rpm.c:340 rpmqv.c:141 rpmqv.c:489 +#: rpm.c:340 rpmqv.c:141 rpmqv.c:490 msgid "send stdout to <cmd>" msgstr "" @@ -319,15 +319,15 @@ msgstr "" msgid "use <file> instead of /etc/rpmrc and $HOME/.rpmrc" msgstr "" -#: rpm.c:344 rpmqv.c:159 rpmqv.c:493 +#: rpm.c:344 rpmqv.c:159 rpmqv.c:494 msgid "display final rpmrc and macro configuration" msgstr "" -#: rpm.c:346 rpmqv.c:501 +#: rpm.c:346 rpmqv.c:502 msgid "be a little more verbose" msgstr "" -#: rpm.c:348 rpmqv.c:503 +#: rpm.c:348 rpmqv.c:504 msgid "be incredibly verbose (for debugging)" msgstr "" @@ -343,7 +343,7 @@ msgstr "" msgid " --ftpproxy <host> " msgstr "" -#: rpm.c:354 rpmqv.c:510 +#: rpm.c:354 rpmqv.c:511 msgid "hostname or IP of ftp proxy" msgstr "" @@ -351,7 +351,7 @@ msgstr "" msgid " --ftpport <port> " msgstr "" -#: rpm.c:356 rpmqv.c:512 +#: rpm.c:356 rpmqv.c:513 msgid "port number of ftp server (or proxy)" msgstr "" @@ -359,7 +359,7 @@ msgstr "" msgid " --httpproxy <host> " msgstr "" -#: rpm.c:358 rpmqv.c:514 +#: rpm.c:358 rpmqv.c:515 msgid "hostname or IP of http proxy" msgstr "" @@ -367,11 +367,11 @@ msgstr "" msgid " --httpport <port> " msgstr "" -#: rpm.c:360 rpmqv.c:516 +#: rpm.c:360 rpmqv.c:517 msgid "port number of http server (or proxy)" msgstr "" -#: rpm.c:364 rpmqv.c:536 +#: rpm.c:364 rpmqv.c:537 msgid "query mode" msgstr "" @@ -379,7 +379,7 @@ msgstr "" msgid " --dbpath <dir> " msgstr "" -#: rpm.c:366 rpm.c:412 rpm.c:437 rpm.c:489 rpm.c:561 rpmqv.c:496 +#: rpm.c:366 rpm.c:412 rpm.c:437 rpm.c:489 rpm.c:561 rpmqv.c:497 msgid "use <dir> as the directory for the database" msgstr "" @@ -387,7 +387,7 @@ msgstr "" msgid " --queryformat <qfmt>" msgstr "" -#: rpm.c:368 rpmqv.c:538 +#: rpm.c:368 rpmqv.c:539 msgid "use <qfmt> as the header format (implies --info)" msgstr "" @@ -395,7 +395,7 @@ msgstr "" msgid " --root <dir> " msgstr "" -#: rpm.c:370 rpm.c:414 rpm.c:472 rpm.c:501 rpm.c:563 rpmqv.c:144 rpmqv.c:498 +#: rpm.c:370 rpm.c:414 rpm.c:472 rpm.c:501 rpm.c:563 rpmqv.c:144 rpmqv.c:499 msgid "use <dir> as the top level directory" msgstr "" @@ -451,31 +451,31 @@ msgstr "" msgid " Information selection options:" msgstr "" -#: rpm.c:386 rpmqv.c:542 +#: rpm.c:386 rpmqv.c:543 msgid "display package information" msgstr "" -#: rpm.c:388 rpmqv.c:544 +#: rpm.c:388 rpmqv.c:545 msgid "display the package's change log" msgstr "" -#: rpm.c:390 rpmqv.c:546 +#: rpm.c:390 rpmqv.c:547 msgid "display package file list" msgstr "" -#: rpm.c:392 rpmqv.c:548 +#: rpm.c:392 rpmqv.c:549 msgid "show file states (implies -l)" msgstr "" -#: rpm.c:394 rpmqv.c:550 +#: rpm.c:394 rpmqv.c:551 msgid "list only documentation files (implies -l)" msgstr "" -#: rpm.c:396 rpmqv.c:552 +#: rpm.c:396 rpmqv.c:553 msgid "list only configuration files (implies -l)" msgstr "" -#: rpm.c:398 rpmqv.c:554 +#: rpm.c:398 rpmqv.c:555 msgid "" "show all verifiable information for each file (must be used with -l, -c, or " "-d)" @@ -497,26 +497,26 @@ msgstr "" msgid "show the trigger scripts contained in the package" msgstr "" -#: rpm.c:410 rpmqv.c:565 +#: rpm.c:410 rpmqv.c:566 msgid "" "verify a package installation using the same same package specification " "options as -q" msgstr "" -#: lib/poptBT.c:187 lib/verify.c:58 rpm.c:416 rpm.c:458 rpm.c:493 rpmqv.c:268 -#: rpmqv.c:567 rpmqv.c:615 rpmqv.c:649 +#: lib/poptBT.c:187 lib/verify.c:60 rpm.c:416 rpm.c:458 rpm.c:493 rpmqv.c:268 +#: rpmqv.c:568 rpmqv.c:616 rpmqv.c:650 msgid "do not verify package dependencies" msgstr "" -#: lib/verify.c:64 rpm.c:418 rpmqv.c:208 rpmqv.c:571 +#: lib/verify.c:66 rpm.c:418 rpmqv.c:208 rpmqv.c:572 msgid "do not verify file md5 checksums" msgstr "" -#: rpm.c:420 rpmqv.c:569 +#: rpm.c:420 rpmqv.c:570 msgid "do not verify file attributes" msgstr "" -#: rpm.c:422 rpmqv.c:576 +#: rpm.c:422 rpmqv.c:577 msgid "list the tags that can be used in a query format" msgstr "" @@ -528,7 +528,7 @@ msgstr "" msgid " -i <packagefile> " msgstr "" -#: rpm.c:427 rpmqv.c:264 rpmqv.c:590 +#: rpm.c:427 rpmqv.c:264 rpmqv.c:591 msgid "install package" msgstr "" @@ -544,11 +544,11 @@ msgstr "" msgid " --relocate <oldpath>=<newpath>" msgstr "" -#: rpm.c:431 rpmqv.c:627 +#: rpm.c:431 rpmqv.c:628 msgid "relocate files from <oldpath> to <newpath>" msgstr "" -#: rpm.c:433 rpmqv.c:236 rpmqv.c:595 +#: rpm.c:433 rpmqv.c:236 rpmqv.c:596 msgid "relocate files in non-relocateable package" msgstr "" @@ -556,47 +556,47 @@ msgstr "" msgid " --prefix <dir> " msgstr "" -#: rpm.c:435 rpmqv.c:311 rpmqv.c:625 +#: rpm.c:435 rpmqv.c:311 rpmqv.c:626 msgid "relocate the package to <dir>, if relocatable" msgstr "" -#: rpm.c:439 rpmqv.c:242 rpmqv.c:597 +#: rpm.c:439 rpmqv.c:242 rpmqv.c:598 msgid "do not install documentation" msgstr "" -#: rpm.c:441 rpmqv.c:247 rpmqv.c:601 +#: rpm.c:441 rpmqv.c:247 rpmqv.c:602 msgid "short hand for --replacepkgs --replacefiles" msgstr "" -#: rpm.c:443 rpmqv.c:253 rpmqv.c:603 +#: rpm.c:443 rpmqv.c:253 rpmqv.c:604 msgid "print hash marks as package installs (good with -v)" msgstr "" -#: rpm.c:445 rpmqv.c:224 rpmqv.c:592 +#: rpm.c:445 rpmqv.c:224 rpmqv.c:593 msgid "install all files, even configurations which might otherwise be skipped" msgstr "" -#: rpm.c:448 rpmqv.c:255 rpmqv.c:605 +#: rpm.c:448 rpmqv.c:255 rpmqv.c:606 msgid "don't verify package architecture" msgstr "" -#: rpm.c:450 rpmqv.c:260 rpmqv.c:607 +#: rpm.c:450 rpmqv.c:260 rpmqv.c:608 msgid "don't check disk space before installing" msgstr "" -#: rpm.c:452 rpmqv.c:257 rpmqv.c:609 +#: rpm.c:452 rpmqv.c:257 rpmqv.c:610 msgid "don't verify package operating system" msgstr "" -#: rpm.c:454 rpmqv.c:262 rpmqv.c:611 +#: rpm.c:454 rpmqv.c:262 rpmqv.c:612 msgid "install documentation" msgstr "" -#: rpm.c:456 rpm.c:491 rpmqv.c:266 rpmqv.c:613 rpmqv.c:647 +#: rpm.c:456 rpm.c:491 rpmqv.c:266 rpmqv.c:614 rpmqv.c:648 msgid "update the database, but do not modify the filesystem" msgstr "" -#: rpm.c:460 rpm.c:495 rpmqv.c:270 rpmqv.c:617 rpmqv.c:651 +#: rpm.c:460 rpm.c:495 rpmqv.c:270 rpmqv.c:618 rpmqv.c:652 msgid "do not reorder package installation to satisfy dependencies" msgstr "" @@ -604,23 +604,23 @@ msgstr "" msgid "don't execute any installation scripts" msgstr "" -#: rpm.c:464 rpm.c:499 rpmqv.c:655 +#: rpm.c:464 rpm.c:499 rpmqv.c:656 msgid "don't execute any scripts triggered by this package" msgstr "" -#: rpm.c:466 rpmqv.c:309 rpmqv.c:623 +#: rpm.c:466 rpmqv.c:309 rpmqv.c:624 msgid "print percentages as package installs" msgstr "" -#: rpm.c:468 rpmqv.c:320 rpmqv.c:629 +#: rpm.c:468 rpmqv.c:320 rpmqv.c:630 msgid "install even if the package replaces installed files" msgstr "" -#: rpm.c:470 rpmqv.c:322 rpmqv.c:631 +#: rpm.c:470 rpmqv.c:322 rpmqv.c:632 msgid "reinstall if the package is already present" msgstr "" -#: rpm.c:474 rpmqv.c:324 rpmqv.c:633 +#: rpm.c:474 rpmqv.c:324 rpmqv.c:634 msgid "don't install, but tell if it would work or not" msgstr "" @@ -632,11 +632,11 @@ msgstr "" msgid " -U <packagefile> " msgstr "" -#: rpm.c:479 rpmqv.c:637 +#: rpm.c:479 rpmqv.c:638 msgid "upgrade package (same options as --install, plus)" msgstr "" -#: rpm.c:481 rpmqv.c:306 rpmqv.c:639 +#: rpm.c:481 rpmqv.c:306 rpmqv.c:640 msgid "" "upgrade to an old version of the package (--force on upgrades does this " "automatically)" @@ -650,17 +650,17 @@ msgstr "" msgid " -e <package> " msgstr "" -#: rpm.c:485 rpmqv.c:240 rpmqv.c:643 +#: rpm.c:485 rpmqv.c:240 rpmqv.c:644 msgid "erase (uninstall) package" msgstr "" -#: rpm.c:487 rpmqv.c:227 rpmqv.c:645 +#: rpm.c:487 rpmqv.c:227 rpmqv.c:646 msgid "" "remove all packages which match <package> (normally an error is generated if " "<package> specified multiple packages)" msgstr "" -#: rpm.c:497 rpmqv.c:653 +#: rpm.c:497 rpmqv.c:654 msgid "do not execute any package specific scripts" msgstr "" @@ -763,7 +763,7 @@ msgstr "" msgid " --resign <pkg>+ " msgstr "" -#: rpm.c:542 rpmqv.c:198 rpmqv.c:661 +#: rpm.c:542 rpmqv.c:198 rpmqv.c:662 msgid "sign a package (discard current signature)" msgstr "" @@ -771,7 +771,7 @@ msgstr "" msgid " --addsign <pkg>+ " msgstr "" -#: rpm.c:544 rpmqv.c:196 rpmqv.c:663 +#: rpm.c:544 rpmqv.c:196 rpmqv.c:664 msgid "add a signature to a package" msgstr "" @@ -783,19 +783,19 @@ msgstr "" msgid " -K <pkg>+ " msgstr "" -#: rpm.c:547 rpmqv.c:202 rpmqv.c:667 +#: rpm.c:547 rpmqv.c:202 rpmqv.c:668 msgid "verify package signature" msgstr "" -#: rpm.c:549 rpmqv.c:204 rpmqv.c:669 +#: rpm.c:549 rpmqv.c:204 rpmqv.c:670 msgid "skip any PGP signatures" msgstr "" -#: rpm.c:551 rpmqv.c:206 rpmqv.c:671 +#: rpm.c:551 rpmqv.c:206 rpmqv.c:672 msgid "skip any GPG signatures" msgstr "" -#: rpm.c:553 rpmqv.c:673 +#: rpm.c:553 rpmqv.c:674 msgid "skip any MD5 signatures" msgstr "" @@ -807,21 +807,21 @@ msgstr "" msgid "rebuild database from existing database" msgstr "" -#: rpm.c:567 rpmqv.c:578 +#: rpm.c:567 rpmqv.c:579 msgid "" "set the file permissions to those in the package database using the same " "package specification options as -q" msgstr "" -#: rpm.c:570 rpmqv.c:581 +#: rpm.c:570 rpmqv.c:582 msgid "" "set the file owner and group to those in the package database using the same " "package specification options as -q" msgstr "" #: rpm.c:722 rpm.c:728 rpm.c:737 rpm.c:759 rpm.c:765 rpm.c:772 rpm.c:780 -#: rpm.c:788 rpm.c:809 rpm.c:872 rpmqv.c:866 rpmqv.c:872 rpmqv.c:879 -#: rpmqv.c:885 rpmqv.c:919 rpmqv.c:927 rpmqv.c:933 rpmqv.c:941 rpmqv.c:1008 +#: rpm.c:788 rpm.c:809 rpm.c:872 rpmqv.c:867 rpmqv.c:873 rpmqv.c:880 +#: rpmqv.c:886 rpmqv.c:920 rpmqv.c:928 rpmqv.c:934 rpmqv.c:942 rpmqv.c:1009 msgid "only one major mode may be specified" msgstr "" @@ -833,23 +833,23 @@ msgstr "" msgid "Use -e or --erase instead.\n" msgstr "" -#: rpm.c:815 rpmqv.c:903 +#: rpm.c:815 rpmqv.c:904 msgid "relocations must begin with a /" msgstr "" -#: rpm.c:817 rpmqv.c:905 +#: rpm.c:817 rpmqv.c:906 msgid "relocations must contain a =" msgstr "" -#: rpm.c:820 rpmqv.c:908 +#: rpm.c:820 rpmqv.c:909 msgid "relocations must have a / following the =" msgstr "" -#: rpm.c:829 rpmqv.c:892 +#: rpm.c:829 rpmqv.c:893 msgid "exclude paths must begin with a /" msgstr "" -#: rpm.c:838 rpmqv.c:962 +#: rpm.c:838 rpmqv.c:963 msgid "The --rcfile option has been eliminated.\n" msgstr "" @@ -857,101 +857,101 @@ msgstr "" msgid "Use --macros with a colon separated list of macro files to read.\n" msgstr "" -#: rpm.c:844 rpmqv.c:968 +#: rpm.c:844 rpmqv.c:969 #, c-format msgid "Internal error in argument processing (%d) :-(\n" msgstr "" -#: rpm.c:879 rpmqv.c:1023 +#: rpm.c:879 rpmqv.c:1024 msgid "one type of query/verify may be performed at a time" msgstr "" -#: rpm.c:884 rpmqv.c:1027 +#: rpm.c:884 rpmqv.c:1028 msgid "unexpected query flags" msgstr "" -#: rpm.c:887 rpmqv.c:1030 +#: rpm.c:887 rpmqv.c:1031 msgid "unexpected query format" msgstr "" -#: rpm.c:890 rpmqv.c:1033 +#: rpm.c:890 rpmqv.c:1034 msgid "unexpected query source" msgstr "" -#: rpm.c:893 rpmqv.c:1043 +#: rpm.c:893 rpmqv.c:1044 msgid "only installation, upgrading, rmsource and rmspec may be forced" msgstr "" -#: rpm.c:896 rpmqv.c:1048 +#: rpm.c:896 rpmqv.c:1049 msgid "files may only be relocated during package installation" msgstr "" -#: rpm.c:899 rpmqv.c:1051 +#: rpm.c:899 rpmqv.c:1052 msgid "only one of --prefix or --relocate may be used" msgstr "" -#: rpm.c:902 rpmqv.c:1054 +#: rpm.c:902 rpmqv.c:1055 msgid "" "--relocate and --excludepath may only be used when installing new packages" msgstr "" -#: rpm.c:905 rpmqv.c:1057 +#: rpm.c:905 rpmqv.c:1058 msgid "--prefix may only be used when installing new packages" msgstr "" -#: rpm.c:908 rpmqv.c:1060 +#: rpm.c:908 rpmqv.c:1061 msgid "arguments to --prefix must begin with a /" msgstr "" -#: rpm.c:911 rpmqv.c:1063 +#: rpm.c:911 rpmqv.c:1064 msgid "--hash (-h) may only be specified during package installation" msgstr "" -#: rpm.c:915 rpmqv.c:1067 +#: rpm.c:915 rpmqv.c:1068 msgid "--percent may only be specified during package installation" msgstr "" -#: rpm.c:919 rpmqv.c:1072 +#: rpm.c:919 rpmqv.c:1073 msgid "--replacefiles may only be specified during package installation" msgstr "" -#: rpm.c:923 rpmqv.c:1076 +#: rpm.c:923 rpmqv.c:1077 msgid "--replacepkgs may only be specified during package installation" msgstr "" -#: rpm.c:927 rpmqv.c:1080 +#: rpm.c:927 rpmqv.c:1081 msgid "--excludedocs may only be specified during package installation" msgstr "" -#: rpm.c:931 rpmqv.c:1084 +#: rpm.c:931 rpmqv.c:1085 msgid "--includedocs may only be specified during package installation" msgstr "" -#: rpm.c:935 rpmqv.c:1088 +#: rpm.c:935 rpmqv.c:1089 msgid "only one of --excludedocs and --includedocs may be specified" msgstr "" -#: rpm.c:939 rpmqv.c:1092 +#: rpm.c:939 rpmqv.c:1093 msgid "--ignorearch may only be specified during package installation" msgstr "" -#: rpm.c:943 rpmqv.c:1096 +#: rpm.c:943 rpmqv.c:1097 msgid "--ignoreos may only be specified during package installation" msgstr "" -#: rpm.c:947 rpmqv.c:1101 +#: rpm.c:947 rpmqv.c:1102 msgid "--ignoresize may only be specified during package installation" msgstr "" -#: rpm.c:951 rpmqv.c:1105 +#: rpm.c:951 rpmqv.c:1106 msgid "--allmatches may only be specified during package erasure" msgstr "" -#: rpm.c:955 rpmqv.c:1109 +#: rpm.c:955 rpmqv.c:1110 msgid "--allfiles may only be specified during package installation" msgstr "" -#: rpm.c:959 rpmqv.c:1114 +#: rpm.c:959 rpmqv.c:1115 msgid "--justdb may only be specified during package installation and erasure" msgstr "" @@ -965,31 +965,31 @@ msgstr "" msgid "--apply may only be specified during package installation" msgstr "" -#: rpm.c:975 rpmqv.c:1126 +#: rpm.c:975 rpmqv.c:1127 msgid "" "trigger disabling options may only be specified during package installation " "and erasure" msgstr "" -#: rpm.c:979 rpmqv.c:1130 +#: rpm.c:979 rpmqv.c:1131 msgid "" "--nodeps may only be specified during package building, rebuilding, " "recompilation, installation,erasure, and verification" msgstr "" -#: rpm.c:984 rpmqv.c:1135 +#: rpm.c:984 rpmqv.c:1136 msgid "" "--test may only be specified during package installation, erasure, and " "building" msgstr "" -#: rpm.c:988 rpmqv.c:1140 +#: rpm.c:988 rpmqv.c:1141 msgid "" "--root (-r) may only be specified during installation, erasure, querying, " "and database rebuilds" msgstr "" -#: rpm.c:1000 rpmqv.c:1152 +#: rpm.c:1000 rpmqv.c:1153 msgid "arguments to --root (-r) must begin with a /" msgstr "" @@ -997,89 +997,89 @@ msgstr "" msgid "--oldpackage may only be used during upgrades" msgstr "" -#: rpm.c:1009 rpmqv.c:1159 +#: rpm.c:1009 rpmqv.c:1160 msgid "--nopgp may only be used during signature checking" msgstr "" -#: rpm.c:1012 rpmqv.c:1162 +#: rpm.c:1012 rpmqv.c:1163 msgid "--nogpg may only be used during signature checking" msgstr "" -#: rpm.c:1015 rpmqv.c:1167 +#: rpm.c:1015 rpmqv.c:1168 msgid "" "--nomd5 may only be used during signature checking and package verification" msgstr "" -#: rpm.c:1026 rpmqv.c:1183 +#: rpm.c:1026 rpmqv.c:1184 msgid "no files to sign\n" msgstr "" -#: rpm.c:1031 rpmqv.c:1188 +#: rpm.c:1031 rpmqv.c:1189 #, c-format msgid "cannot access file %s\n" msgstr "" -#: rpm.c:1046 rpmqv.c:1204 +#: rpm.c:1046 rpmqv.c:1208 msgid "pgp not found: " msgstr "" -#: rpm.c:1050 rpmqv.c:1208 +#: rpm.c:1050 rpmqv.c:1213 msgid "Enter pass phrase: " msgstr "" -#: rpm.c:1052 rpmqv.c:1210 +#: rpm.c:1052 rpmqv.c:1215 msgid "Pass phrase check failed\n" msgstr "" -#: rpm.c:1055 rpmqv.c:1213 +#: rpm.c:1055 rpmqv.c:1219 msgid "Pass phrase is good.\n" msgstr "" -#: rpm.c:1060 rpmqv.c:1218 +#: rpm.c:1060 rpmqv.c:1224 msgid "Invalid %%_signature spec in macro file.\n" msgstr "" -#: rpm.c:1066 rpmqv.c:1224 +#: rpm.c:1066 rpmqv.c:1231 msgid "--sign may only be used during package building" msgstr "" -#: rpm.c:1081 rpmqv.c:1240 +#: rpm.c:1081 rpmqv.c:1247 msgid "exec failed\n" msgstr "" -#: rpm.c:1100 rpmqv.c:1484 +#: rpm.c:1100 rpmqv.c:1497 msgid "unexpected arguments to --querytags " msgstr "" -#: rpm.c:1111 rpmqv.c:1506 +#: rpm.c:1111 rpmqv.c:1521 msgid "no packages given for signature check" msgstr "" -#: rpm.c:1122 rpmqv.c:1517 +#: rpm.c:1122 rpmqv.c:1532 msgid "no packages given for signing" msgstr "" -#: rpm.c:1138 rpmqv.c:1380 +#: rpm.c:1138 rpmqv.c:1391 msgid "no packages given for uninstall" msgstr "" -#: rpm.c:1227 rpmqv.c:1409 +#: rpm.c:1227 rpmqv.c:1420 msgid "no packages given for install" msgstr "" -#: rpm.c:1251 rpmqv.c:1450 +#: rpm.c:1251 rpmqv.c:1463 msgid "extra arguments given for query of all packages" msgstr "" -#: rpm.c:1256 rpmqv.c:1455 +#: rpm.c:1256 rpmqv.c:1468 msgid "no arguments given for query" msgstr "" -#: rpm.c:1273 rpmqv.c:1472 +#: rpm.c:1273 rpmqv.c:1485 msgid "extra arguments given for verify of all packages" msgstr "" -#: rpm.c:1277 rpmqv.c:1476 +#: rpm.c:1277 rpmqv.c:1489 msgid "no arguments given for verify" msgstr "" @@ -1185,7 +1185,7 @@ msgstr "" msgid "<package>+" msgstr "" -#: rpmqv.c:244 rpmqv.c:599 +#: rpmqv.c:244 rpmqv.c:600 msgid "skip files with leading component <path> " msgstr "" @@ -1281,243 +1281,243 @@ msgstr "" msgid "Common options for all rpm modes:" msgstr "" -#: rpmqv.c:412 +#: rpmqv.c:413 #, c-format msgid "Usage: %s {--help}\n" msgstr "" -#: rpmqv.c:483 +#: rpmqv.c:484 msgid " All modes support the following options:" msgstr "" -#: rpmqv.c:484 +#: rpmqv.c:485 msgid " --define '<name> <body>'" msgstr "" -#: rpmqv.c:486 +#: rpmqv.c:487 msgid " --eval '<expr>+' " msgstr "" -#: rpmqv.c:487 +#: rpmqv.c:488 msgid "print the expansion of macro <expr> to stdout" msgstr "" -#: rpmqv.c:488 +#: rpmqv.c:489 msgid " --pipe <cmd> " msgstr "" -#: rpmqv.c:490 +#: rpmqv.c:491 msgid " --rcfile <file:...> " msgstr "" -#: rpmqv.c:491 +#: rpmqv.c:492 msgid "use <file:...> instead of default list of macro files" msgstr "" -#: rpmqv.c:495 +#: rpmqv.c:496 msgid " --dbpath <dir> " msgstr "" -#: rpmqv.c:497 +#: rpmqv.c:498 msgid " --root <dir> " msgstr "" -#: rpmqv.c:507 +#: rpmqv.c:508 msgid "" " Install, upgrade and query (with -p) modes allow URL's to be used in place" msgstr "" -#: rpmqv.c:508 +#: rpmqv.c:509 msgid " of file names as well as the following options:" msgstr "" -#: rpmqv.c:509 +#: rpmqv.c:510 msgid " --ftpproxy <host> " msgstr "" -#: rpmqv.c:511 +#: rpmqv.c:512 msgid " --ftpport <port> " msgstr "" -#: rpmqv.c:513 +#: rpmqv.c:514 msgid " --httpproxy <host> " msgstr "" -#: rpmqv.c:515 +#: rpmqv.c:516 msgid " --httpport <port> " msgstr "" -#: rpmqv.c:521 +#: rpmqv.c:522 msgid " Package specification options:" msgstr "" -#: lib/poptQV.c:68 rpmqv.c:523 +#: lib/poptQV.c:68 rpmqv.c:524 msgid "query/verify all packages" msgstr "" -#: rpmqv.c:524 +#: rpmqv.c:525 msgid " -f <file>+ " msgstr "" -#: rpmqv.c:525 +#: rpmqv.c:526 msgid "query/verify package owning <file>" msgstr "" -#: rpmqv.c:526 +#: rpmqv.c:527 msgid " -p <packagefile>+ " msgstr "" -#: rpmqv.c:527 +#: rpmqv.c:528 msgid "query/verify (uninstalled) package <packagefile>" msgstr "" -#: rpmqv.c:528 +#: rpmqv.c:529 msgid " --triggeredby <pkg> " msgstr "" -#: rpmqv.c:529 +#: rpmqv.c:530 msgid "query/verify packages triggered by <pkg>" msgstr "" -#: rpmqv.c:530 +#: rpmqv.c:531 msgid " --whatprovides <cap> " msgstr "" -#: rpmqv.c:531 +#: rpmqv.c:532 msgid "query/verify packages which provide <cap> capability" msgstr "" -#: rpmqv.c:532 +#: rpmqv.c:533 msgid " --whatrequires <cap> " msgstr "" -#: rpmqv.c:533 +#: rpmqv.c:534 msgid "query/verify packages which require <cap> capability" msgstr "" -#: rpmqv.c:537 +#: rpmqv.c:538 msgid " --queryformat <qfmt> " msgstr "" -#: rpmqv.c:540 +#: rpmqv.c:541 msgid " Information selection options:" msgstr "" -#: rpmqv.c:556 +#: rpmqv.c:557 msgid "list capabilities provided by package" msgstr "" -#: rpmqv.c:558 +#: rpmqv.c:559 msgid "list capabilities required by package" msgstr "" -#: rpmqv.c:560 +#: rpmqv.c:561 msgid "print the various [un]install scriptlets" msgstr "" -#: rpmqv.c:562 +#: rpmqv.c:563 msgid "show the trigger scriptlets contained in the package" msgstr "" -#: rpmqv.c:573 +#: rpmqv.c:574 msgid "do not execute scripts (if any)" msgstr "" -#: rpmqv.c:588 +#: rpmqv.c:589 msgid " --install <packagefile>" msgstr "" -#: rpmqv.c:589 +#: rpmqv.c:590 msgid " -i <packagefile> " msgstr "" -#: rpmqv.c:598 +#: rpmqv.c:599 msgid " --excludepath <path> " msgstr "" -#: rpmqv.c:619 +#: rpmqv.c:620 msgid "don't execute any installation scriptlets" msgstr "" -#: rpmqv.c:621 +#: rpmqv.c:622 msgid "don't execute any scriptlets triggered by this package" msgstr "" -#: rpmqv.c:624 +#: rpmqv.c:625 msgid " --prefix <dir> " msgstr "" -#: rpmqv.c:626 +#: rpmqv.c:627 msgid " --relocate <oldpath>=<newpath>" msgstr "" -#: rpmqv.c:635 +#: rpmqv.c:636 msgid " --upgrade <packagefile>" msgstr "" -#: rpmqv.c:636 +#: rpmqv.c:637 msgid " -U <packagefile> " msgstr "" -#: rpmqv.c:641 +#: rpmqv.c:642 msgid " --erase <package>" msgstr "" -#: rpmqv.c:642 +#: rpmqv.c:643 msgid " -e <package> " msgstr "" -#: rpmqv.c:660 +#: rpmqv.c:661 msgid " --resign <pkg>+ " msgstr "" -#: rpmqv.c:662 +#: rpmqv.c:663 msgid " --addsign <pkg>+ " msgstr "" -#: rpmqv.c:665 +#: rpmqv.c:666 msgid " --checksig <pkg>+" msgstr "" -#: rpmqv.c:666 +#: rpmqv.c:667 msgid " -K <pkg>+ " msgstr "" -#: rpmqv.c:679 +#: rpmqv.c:680 msgid "initalize database (unnecessary, legacy use)" msgstr "" -#: rpmqv.c:681 +#: rpmqv.c:682 msgid "rebuild database indices from existing database headers" msgstr "" -#: rpmqv.c:963 +#: rpmqv.c:964 msgid "Use \"--macros <file:...>\" instead.\n" msgstr "" -#: rpmqv.c:1037 +#: rpmqv.c:1038 msgid "--dbpath given for operation that does not use a database" msgstr "" -#: rpmqv.c:1121 +#: rpmqv.c:1122 msgid "" "script disabling options may only be specified during package installation " "and erasure" msgstr "" -#: rpmqv.c:1280 +#: rpmqv.c:1289 msgid "no packages files given for rebuild" msgstr "" -#: rpmqv.c:1349 +#: rpmqv.c:1358 msgid "no spec files given for build" msgstr "" -#: rpmqv.c:1351 +#: rpmqv.c:1360 msgid "no tar files given for build" msgstr "" -#: build/build.c:117 build/pack.c:389 +#: build/build.c:117 build/pack.c:390 msgid "Unable to open temp file.\n" msgstr "" @@ -1543,202 +1543,202 @@ msgid "" "RPM build errors:\n" msgstr "" -#: build/expression.c:215 +#: build/expression.c:216 msgid "syntax error while parsing ==\n" msgstr "" -#: build/expression.c:245 +#: build/expression.c:246 msgid "syntax error while parsing &&\n" msgstr "" -#: build/expression.c:254 +#: build/expression.c:255 msgid "syntax error while parsing ||\n" msgstr "" -#: build/expression.c:294 +#: build/expression.c:295 msgid "parse error in expression\n" msgstr "" -#: build/expression.c:326 +#: build/expression.c:327 msgid "unmatched (\n" msgstr "" -#: build/expression.c:356 +#: build/expression.c:357 msgid "- only on numbers\n" msgstr "" -#: build/expression.c:372 +#: build/expression.c:373 msgid "! only on numbers\n" msgstr "" -#: build/expression.c:414 build/expression.c:462 build/expression.c:520 -#: build/expression.c:612 +#: build/expression.c:415 build/expression.c:463 build/expression.c:521 +#: build/expression.c:613 msgid "types must match\n" msgstr "" -#: build/expression.c:427 +#: build/expression.c:428 msgid "* / not suported for strings\n" msgstr "" -#: build/expression.c:478 +#: build/expression.c:479 msgid "- not suported for strings\n" msgstr "" -#: build/expression.c:625 +#: build/expression.c:626 msgid "&& and || not suported for strings\n" msgstr "" -#: build/expression.c:658 build/expression.c:705 +#: build/expression.c:659 build/expression.c:706 msgid "syntax error in expression\n" msgstr "" -#: build/files.c:249 +#: build/files.c:255 #, c-format msgid "TIMECHECK failure: %s\n" msgstr "" -#: build/files.c:303 build/files.c:392 build/files.c:570 +#: build/files.c:308 build/files.c:398 build/files.c:576 #, c-format msgid "Missing '(' in %s %s\n" msgstr "" -#: build/files.c:314 build/files.c:515 build/files.c:581 +#: build/files.c:319 build/files.c:521 build/files.c:587 #, c-format msgid "Missing ')' in %s(%s\n" msgstr "" -#: build/files.c:352 build/files.c:540 +#: build/files.c:357 build/files.c:546 #, c-format msgid "Invalid %s token: %s\n" msgstr "" -#: build/files.c:408 +#: build/files.c:414 #, c-format msgid "Non-white space follows %s(): %s\n" msgstr "" -#: build/files.c:446 +#: build/files.c:452 #, c-format msgid "Bad syntax: %s(%s)\n" msgstr "" -#: build/files.c:456 +#: build/files.c:462 #, c-format msgid "Bad mode spec: %s(%s)\n" msgstr "" -#: build/files.c:468 +#: build/files.c:474 #, c-format msgid "Bad dirmode spec: %s(%s)\n" msgstr "" -#: build/files.c:608 +#: build/files.c:614 msgid "Unusual locale length: \"%.*s\" in %%lang(%s)\n" msgstr "" -#: build/files.c:618 +#: build/files.c:624 msgid "Duplicate locale %.*s in %%lang(%s)\n" msgstr "" -#: build/files.c:756 +#: build/files.c:763 msgid "Hit limit for %%docdir\n" msgstr "" -#: build/files.c:762 +#: build/files.c:769 msgid "Only one arg for %%docdir\n" msgstr "" #. We already got a file -- error -#: build/files.c:790 +#: build/files.c:797 #, c-format msgid "Two files on one line: %s\n" msgstr "" -#: build/files.c:804 +#: build/files.c:811 #, c-format msgid "File must begin with \"/\": %s\n" msgstr "" -#: build/files.c:816 +#: build/files.c:823 msgid "Can't mix special %%doc with other forms: %s\n" msgstr "" -#: build/files.c:983 +#: build/files.c:990 #, c-format msgid "File listed twice: %s\n" msgstr "" -#: build/files.c:1125 +#: build/files.c:1132 #, c-format msgid "Symlink points to BuildRoot: %s -> %s\n" msgstr "" -#: build/files.c:1312 +#: build/files.c:1316 #, c-format msgid "File doesn't match prefix (%s): %s\n" msgstr "" -#: build/files.c:1322 +#: build/files.c:1326 #, c-format msgid "File not found: %s\n" msgstr "" -#: build/files.c:1365 build/files.c:1892 build/parsePrep.c:44 +#: build/files.c:1369 build/files.c:1896 build/parsePrep.c:44 #, c-format msgid "Bad owner/group: %s\n" msgstr "" -#: build/files.c:1377 +#: build/files.c:1381 #, c-format msgid "File %4d: %07o %s.%s\t %s\n" msgstr "" -#: build/files.c:1455 +#: build/files.c:1459 #, c-format msgid "File needs leading \"/\": %s\n" msgstr "" -#: build/files.c:1485 +#: build/files.c:1489 #, c-format msgid "File not found by glob: %s\n" msgstr "" -#: build/files.c:1539 +#: build/files.c:1545 msgid "Could not open %%files file %s: %s\n" msgstr "" -#: build/files.c:1548 build/pack.c:122 +#: build/files.c:1555 build/pack.c:122 #, c-format msgid "line: %s\n" msgstr "" -#: build/files.c:1880 +#: build/files.c:1884 #, c-format msgid "Bad file: %s: %s\n" msgstr "" #. XXX this error message is probably not seen. -#: build/files.c:1948 +#: build/files.c:1952 #, c-format msgid "Couldn't exec %s: %s\n" msgstr "" -#: build/files.c:1953 +#: build/files.c:1957 #, c-format msgid "Couldn't fork %s: %s\n" msgstr "" -#: build/files.c:2035 +#: build/files.c:2039 #, c-format msgid "%s failed\n" msgstr "" -#: build/files.c:2039 +#: build/files.c:2043 #, c-format msgid "failed to write all data to %s\n" msgstr "" -#: build/files.c:2166 +#: build/files.c:2170 #, c-format msgid "Finding %s: (using %s)...\n" msgstr "" @@ -1748,33 +1748,33 @@ msgstr "" msgid "Failed to find %s:\n" msgstr "" -#: build/files.c:2321 +#: build/files.c:2325 #, c-format msgid "Processing files: %s-%s-%s\n" msgstr "" -#: build/names.c:42 +#: build/names.c:41 msgid "getUname: too many uid's\n" msgstr "" -#: build/names.c:68 +#: build/names.c:62 msgid "getUnameS: too many uid's\n" msgstr "" -#: build/names.c:95 +#: build/names.c:83 msgid "getGname: too many gid's\n" msgstr "" -#: build/names.c:121 +#: build/names.c:104 msgid "getGnameS: too many gid's\n" msgstr "" -#: build/names.c:155 +#: build/names.c:134 #, c-format msgid "Could not canonicalize hostname: %s\n" msgstr "" -#: build/pack.c:66 +#: build/pack.c:67 #, c-format msgid "create archive failed on file %s: %s\n" msgstr "" @@ -1789,111 +1789,111 @@ msgstr "" msgid "cpio_copy read failed: %s\n" msgstr "" -#: build/pack.c:179 +#: build/pack.c:180 #, c-format msgid "Could not open PreIn file: %s\n" msgstr "" -#: build/pack.c:186 +#: build/pack.c:187 #, c-format msgid "Could not open PreUn file: %s\n" msgstr "" -#: build/pack.c:193 +#: build/pack.c:194 #, c-format msgid "Could not open PostIn file: %s\n" msgstr "" -#: build/pack.c:200 +#: build/pack.c:201 #, c-format msgid "Could not open PostUn file: %s\n" msgstr "" -#: build/pack.c:208 +#: build/pack.c:209 #, c-format msgid "Could not open VerifyScript file: %s\n" msgstr "" -#: build/pack.c:223 +#: build/pack.c:224 #, c-format msgid "Could not open Trigger script file: %s\n" msgstr "" -#: build/pack.c:249 +#: build/pack.c:250 #, c-format msgid "readRPM: open %s: %s\n" msgstr "" -#: build/pack.c:259 +#: build/pack.c:260 #, c-format msgid "readRPM: read %s: %s\n" msgstr "" -#: build/pack.c:280 +#: build/pack.c:281 #, c-format msgid "readRPM: %s is not an RPM package\n" msgstr "" -#: build/pack.c:289 +#: build/pack.c:290 #, c-format msgid "readRPM: reading header from %s\n" msgstr "" -#: build/pack.c:401 +#: build/pack.c:402 msgid "Bad CSA data\n" msgstr "" -#: build/pack.c:442 +#: build/pack.c:444 #, c-format msgid "Generating signature: %d\n" msgstr "" -#: build/pack.c:452 +#: build/pack.c:454 #, c-format msgid "Could not open %s: %s\n" msgstr "" -#: build/pack.c:489 lib/psm.c:1448 +#: build/pack.c:491 lib/psm.c:1449 #, c-format msgid "Unable to write package: %s\n" msgstr "" -#: build/pack.c:504 +#: build/pack.c:506 #, c-format msgid "Unable to open sigtarget %s: %s\n" msgstr "" -#: build/pack.c:514 +#: build/pack.c:516 #, c-format msgid "Unable to read header from %s: %s\n" msgstr "" -#: build/pack.c:528 +#: build/pack.c:530 #, c-format msgid "Unable to write header to %s: %s\n" msgstr "" -#: build/pack.c:538 +#: build/pack.c:540 #, c-format msgid "Unable to read payload from %s: %s\n" msgstr "" -#: build/pack.c:544 +#: build/pack.c:546 #, c-format msgid "Unable to write payload to %s: %s\n" msgstr "" -#: build/pack.c:571 lib/psm.c:1684 +#: build/pack.c:573 lib/psm.c:1686 #, c-format msgid "Wrote: %s\n" msgstr "" -#: build/pack.c:636 +#: build/pack.c:638 #, c-format msgid "Could not generate output filename for package %s: %s\n" msgstr "" -#: build/pack.c:653 +#: build/pack.c:655 #, c-format msgid "cannot create %s: %s\n" msgstr "" @@ -1959,118 +1959,118 @@ msgstr "" msgid "line %d: Second %%files list\n" msgstr "" -#: build/parsePreamble.c:213 +#: build/parsePreamble.c:216 #, c-format msgid "Architecture is excluded: %s\n" msgstr "" -#: build/parsePreamble.c:218 +#: build/parsePreamble.c:221 #, c-format msgid "Architecture is not included: %s\n" msgstr "" -#: build/parsePreamble.c:223 +#: build/parsePreamble.c:226 #, c-format msgid "OS is excluded: %s\n" msgstr "" -#: build/parsePreamble.c:228 +#: build/parsePreamble.c:231 #, c-format msgid "OS is not included: %s\n" msgstr "" -#: build/parsePreamble.c:245 +#: build/parsePreamble.c:248 #, c-format msgid "%s field must be present in package: %s\n" msgstr "" -#: build/parsePreamble.c:272 +#: build/parsePreamble.c:275 #, c-format msgid "Duplicate %s entries in package: %s\n" msgstr "" -#: build/parsePreamble.c:326 +#: build/parsePreamble.c:329 #, c-format msgid "Unable to open icon %s: %s\n" msgstr "" -#: build/parsePreamble.c:344 +#: build/parsePreamble.c:347 #, c-format msgid "Unable to read icon %s: %s\n" msgstr "" -#: build/parsePreamble.c:357 +#: build/parsePreamble.c:360 #, c-format msgid "Unknown icon type: %s\n" msgstr "" -#: build/parsePreamble.c:424 +#: build/parsePreamble.c:431 #, c-format msgid "line %d: Malformed tag: %s\n" msgstr "" #. Empty field -#: build/parsePreamble.c:432 +#: build/parsePreamble.c:439 #, c-format msgid "line %d: Empty tag: %s\n" msgstr "" -#: build/parsePreamble.c:454 build/parsePreamble.c:461 +#: build/parsePreamble.c:461 build/parsePreamble.c:468 #, c-format msgid "line %d: Illegal char '-' in %s: %s\n" msgstr "" -#: build/parsePreamble.c:518 build/parseSpec.c:388 +#: build/parsePreamble.c:525 build/parseSpec.c:388 #, c-format msgid "BuildRoot can not be \"/\": %s\n" msgstr "" -#: build/parsePreamble.c:531 +#: build/parsePreamble.c:538 #, c-format msgid "line %d: Prefixes must not end with \"/\": %s\n" msgstr "" -#: build/parsePreamble.c:543 +#: build/parsePreamble.c:550 #, c-format msgid "line %d: Docdir must begin with '/': %s\n" msgstr "" -#: build/parsePreamble.c:555 +#: build/parsePreamble.c:562 #, c-format msgid "line %d: Epoch/Serial field must be a number: %s\n" msgstr "" -#: build/parsePreamble.c:595 build/parsePreamble.c:606 +#: build/parsePreamble.c:602 build/parsePreamble.c:613 #, c-format msgid "line %d: Bad %s: qualifiers: %s\n" msgstr "" -#: build/parsePreamble.c:632 +#: build/parsePreamble.c:639 #, c-format msgid "line %d: Bad BuildArchitecture format: %s\n" msgstr "" -#: build/parsePreamble.c:641 +#: build/parsePreamble.c:648 #, c-format msgid "Internal error: Bogus tag %d\n" msgstr "" -#: build/parsePreamble.c:785 +#: build/parsePreamble.c:792 #, c-format msgid "Bad package specification: %s\n" msgstr "" -#: build/parsePreamble.c:791 +#: build/parsePreamble.c:798 #, c-format msgid "Package already exists: %s\n" msgstr "" -#: build/parsePreamble.c:817 +#: build/parsePreamble.c:824 #, c-format msgid "line %d: Unknown tag: %s\n" msgstr "" -#: build/parsePreamble.c:839 +#: build/parsePreamble.c:846 msgid "Spec file can't use BuildRoot\n" msgstr "" @@ -2084,49 +2084,49 @@ msgstr "" msgid "No patch number %d\n" msgstr "" -#: build/parsePrep.c:167 +#: build/parsePrep.c:168 #, c-format msgid "No source number %d\n" msgstr "" -#: build/parsePrep.c:187 +#: build/parsePrep.c:188 #, c-format msgid "Couldn't download nosource %s: %s\n" msgstr "" -#: build/parsePrep.c:281 +#: build/parsePrep.c:283 msgid "Error parsing %%setup: %s\n" msgstr "" -#: build/parsePrep.c:296 +#: build/parsePrep.c:298 msgid "line %d: Bad arg to %%setup %c: %s\n" msgstr "" -#: build/parsePrep.c:314 +#: build/parsePrep.c:316 msgid "line %d: Bad %%setup option %s: %s\n" msgstr "" -#: build/parsePrep.c:448 +#: build/parsePrep.c:450 msgid "line %d: Need arg to %%patch -b: %s\n" msgstr "" -#: build/parsePrep.c:457 +#: build/parsePrep.c:459 msgid "line %d: Need arg to %%patch -z: %s\n" msgstr "" -#: build/parsePrep.c:469 +#: build/parsePrep.c:471 msgid "line %d: Need arg to %%patch -p: %s\n" msgstr "" -#: build/parsePrep.c:476 +#: build/parsePrep.c:478 msgid "line %d: Bad arg to %%patch -p: %s\n" msgstr "" -#: build/parsePrep.c:483 +#: build/parsePrep.c:485 msgid "Too many patches!\n" msgstr "" -#: build/parsePrep.c:487 +#: build/parsePrep.c:489 msgid "line %d: Bad arg to %%patch: %s\n" msgstr "" @@ -2230,84 +2230,84 @@ msgstr "" msgid "line %d: Bad %s number: %s\n" msgstr "" -#: lib/cpio.c:195 +#: lib/cpio.c:185 #, c-format msgid "(error 0x%x)" msgstr "" -#: lib/cpio.c:198 +#: lib/cpio.c:188 msgid "Bad magic" msgstr "" -#: lib/cpio.c:199 +#: lib/cpio.c:189 msgid "Bad/unreadable header" msgstr "" -#: lib/cpio.c:220 +#: lib/cpio.c:210 msgid "Header size too big" msgstr "" -#: lib/cpio.c:221 +#: lib/cpio.c:211 msgid "Unknown file type" msgstr "" -#: lib/cpio.c:222 +#: lib/cpio.c:212 msgid "Missing hard link" msgstr "" -#: lib/cpio.c:223 +#: lib/cpio.c:213 msgid "MD5 sum mismatch" msgstr "" -#: lib/cpio.c:224 +#: lib/cpio.c:214 msgid "Internal error" msgstr "" -#: lib/cpio.c:233 +#: lib/cpio.c:223 msgid " failed - " msgstr "" -#: lib/db1.c:92 lib/db2.c:117 lib/db3.c:102 +#: lib/db1.c:99 lib/db2.c:117 lib/db3.c:102 #, c-format msgid "db%d error(%d) from %s: %s\n" msgstr "" -#: lib/db1.c:95 lib/db2.c:120 lib/db3.c:105 +#: lib/db1.c:102 lib/db2.c:120 lib/db3.c:105 #, c-format msgid "db%d error(%d): %s\n" msgstr "" -#: lib/db1.c:387 +#: lib/db1.c:414 #, c-format msgid "closed db file %s\n" msgstr "" -#: lib/db1.c:390 +#: lib/db1.c:417 #, c-format msgid "removed db file %s\n" msgstr "" -#: lib/db1.c:421 +#: lib/db1.c:448 #, c-format msgid "bad db file %s\n" msgstr "" -#: lib/db1.c:426 +#: lib/db1.c:453 #, c-format msgid "opening db file %s mode 0x%x\n" msgstr "" #. XXX check errno validity -#: lib/db1.c:449 +#: lib/db1.c:476 #, c-format msgid "cannot get %s lock on database\n" msgstr "" -#: lib/db1.c:450 lib/db2.c:786 lib/db3.c:771 +#: lib/db1.c:477 lib/db2.c:787 lib/db3.c:778 msgid "exclusive" msgstr "" -#: lib/db1.c:450 lib/db2.c:786 lib/db3.c:771 +#: lib/db1.c:477 lib/db2.c:787 lib/db3.c:778 msgid "shared" msgstr "" @@ -2326,22 +2326,22 @@ msgstr "" msgid "opening db environment %s/%s %s\n" msgstr "" -#: lib/db2.c:588 lib/db3.c:569 +#: lib/db2.c:588 lib/db3.c:575 #, c-format msgid "closed db index %s/%s\n" msgstr "" -#: lib/db2.c:678 lib/db3.c:659 +#: lib/db2.c:679 lib/db3.c:666 #, c-format msgid "opening db index %s/%s %s mode=0x%x\n" msgstr "" -#: lib/db2.c:784 lib/db3.c:769 +#: lib/db2.c:785 lib/db3.c:776 #, c-format msgid "cannot get %s lock on %s/%s\n" msgstr "" -#: lib/db2.c:791 lib/db3.c:776 +#: lib/db2.c:792 lib/db3.c:783 #, c-format msgid "locked db index %s/%s\n" msgstr "" @@ -2367,117 +2367,117 @@ msgid "%s has too large or too small integer value, skipped\n" msgstr "" #. XXX legacy epoch-less requires/conflicts compatibility -#: lib/depends.c:571 +#: lib/depends.c:563 #, c-format msgid "" "the \"B\" dependency needs an epoch (assuming same as \"A\")\n" "\tA %s\tB %s\n" msgstr "" -#: lib/depends.c:600 +#: lib/depends.c:592 #, c-format msgid " %s A %s\tB %s\n" msgstr "" -#: lib/depends.c:601 lib/depends.c:1072 lib/depends.c:1193 +#: lib/depends.c:593 lib/depends.c:1065 lib/depends.c:1188 msgid "YES" msgstr "" -#: lib/depends.c:601 lib/depends.c:1072 lib/depends.c:1193 +#: lib/depends.c:593 lib/depends.c:1065 lib/depends.c:1188 msgid "NO " msgstr "" -#: lib/depends.c:960 +#: lib/depends.c:953 #, c-format msgid "%s: %-45s YES (added files)\n" msgstr "" -#: lib/depends.c:1019 +#: lib/depends.c:1012 #, c-format msgid "%s: %-45s YES (added provide)\n" msgstr "" -#: lib/depends.c:1071 +#: lib/depends.c:1064 #, c-format msgid "%s: %-45s %-s (cached)\n" msgstr "" -#: lib/depends.c:1090 +#: lib/depends.c:1083 #, c-format msgid "%s: %-45s YES (rpmrc provides)\n" msgstr "" -#: lib/depends.c:1107 +#: lib/depends.c:1100 #, c-format msgid "%s: %-45s YES (rpmlib provides)\n" msgstr "" -#: lib/depends.c:1129 +#: lib/depends.c:1122 #, c-format msgid "%s: %-45s YES (db files)\n" msgstr "" -#: lib/depends.c:1142 +#: lib/depends.c:1135 #, c-format msgid "%s: %-45s YES (db provides)\n" msgstr "" -#: lib/depends.c:1156 +#: lib/depends.c:1149 #, c-format msgid "%s: %-45s YES (db package)\n" msgstr "" -#: lib/depends.c:1172 +#: lib/depends.c:1167 #, c-format msgid "%s: %-45s NO\n" msgstr "" -#: lib/depends.c:1193 +#: lib/depends.c:1188 #, c-format msgid "%s: (%s, %s) added to Depends cache.\n" msgstr "" #. requirements are not satisfied. -#: lib/depends.c:1255 +#: lib/depends.c:1249 #, c-format msgid "package %s-%s-%s require not satisfied: %s\n" msgstr "" #. conflicts exist. -#: lib/depends.c:1322 +#: lib/depends.c:1317 #, c-format msgid "package %s conflicts: %s\n" msgstr "" -#: lib/depends.c:1536 +#: lib/depends.c:1532 #, c-format msgid "removing %s-%s-%s \"%s\" from tsort relations.\n" msgstr "" #. Record all relations. -#: lib/depends.c:1679 +#: lib/depends.c:1675 msgid "========== recording tsort relations\n" msgstr "" #. T4. Scan for zeroes. -#: lib/depends.c:1731 +#: lib/depends.c:1727 msgid "" "========== tsorting packages (order, #predecessors, #succesors, depth)\n" msgstr "" -#: lib/depends.c:1778 +#: lib/depends.c:1776 msgid "========== successors only (presentation order)\n" msgstr "" -#: lib/depends.c:1827 +#: lib/depends.c:1825 msgid "LOOP:\n" msgstr "" -#: lib/depends.c:1855 +#: lib/depends.c:1853 msgid "========== continuing tsort ...\n" msgstr "" -#: lib/falloc.c:141 +#: lib/falloc.c:144 #, c-format msgid "" "free list corrupt (%u)- please run\n" @@ -2488,178 +2488,178 @@ msgid "" msgstr "" #: lib/formats.c:28 lib/formats.c:54 lib/formats.c:83 lib/formats.c:124 -#: lib/header.c:2625 lib/header.c:2642 lib/header.c:2662 +#: lib/header.c:2645 lib/header.c:2662 lib/header.c:2682 msgid "(not a number)" msgstr "" -#: lib/fs.c:69 +#: lib/fs.c:70 #, c-format msgid "mntctl() failed to return size: %s\n" msgstr "" -#: lib/fs.c:84 +#: lib/fs.c:85 #, c-format msgid "mntctl() failed to return mount points: %s\n" msgstr "" -#: lib/fs.c:104 lib/fs.c:184 lib/fs.c:287 +#: lib/fs.c:105 lib/fs.c:187 lib/fs.c:290 #, c-format msgid "failed to stat %s: %s\n" msgstr "" -#: lib/fs.c:147 +#: lib/fs.c:148 msgid "getting list of mounted filesystems\n" msgstr "" -#: lib/fs.c:152 rpmio/url.c:452 +#: lib/fs.c:153 rpmio/url.c:457 #, c-format msgid "failed to open %s: %s\n" msgstr "" -#: lib/fs.c:309 +#: lib/fs.c:312 #, c-format msgid "file %s is on an unknown device\n" msgstr "" -#: lib/fsm.c:272 +#: lib/fsm.c:266 msgid "========= Directories not explictly included in package:\n" msgstr "" -#: lib/fsm.c:274 +#: lib/fsm.c:268 #, c-format msgid "%9d %s\n" msgstr "" -#: lib/fsm.c:1044 +#: lib/fsm.c:1052 #, c-format msgid "%s directory created with perms %04o.\n" msgstr "" -#: lib/fsm.c:1346 lib/fsm.c:1463 +#: lib/fsm.c:1359 lib/fsm.c:1480 #, c-format msgid "%s saved as %s\n" msgstr "" -#: lib/fsm.c:1488 +#: lib/fsm.c:1506 #, c-format msgid "%s rmdir of %s failed: Directory not empty\n" msgstr "" -#: lib/fsm.c:1493 +#: lib/fsm.c:1512 #, c-format msgid "%s rmdir of %s failed: %s\n" msgstr "" -#: lib/fsm.c:1502 +#: lib/fsm.c:1522 #, c-format msgid "%s unlink of %s failed: %s\n" msgstr "" -#: lib/fsm.c:1519 +#: lib/fsm.c:1541 #, c-format msgid "%s created as %s\n" msgstr "" #. This should not be allowed -#: lib/header.c:172 +#: lib/header.c:173 msgid "dataLength() RPM_STRING_TYPE count must be 1.\n" msgstr "" -#: lib/header.c:207 lib/header.c:1110 lib/psm.c:378 +#: lib/header.c:208 lib/header.c:1115 lib/psm.c:368 #, c-format msgid "Data type %d not supported\n" msgstr "" -#: lib/header.c:1533 +#: lib/header.c:1540 #, c-format msgid "Bad count for headerAddEntry(): %d\n" msgstr "" #. @-observertrans@ -#: lib/header.c:1978 +#: lib/header.c:1993 #, c-format msgid "missing { after %" msgstr "" #. @-observertrans@ -#: lib/header.c:2008 +#: lib/header.c:2023 msgid "missing } after %{" msgstr "" #. @-observertrans@ -#: lib/header.c:2022 +#: lib/header.c:2037 msgid "empty tag format" msgstr "" #. @-observertrans@ -#: lib/header.c:2034 +#: lib/header.c:2049 msgid "empty tag name" msgstr "" #. @-observertrans@ -#: lib/header.c:2051 +#: lib/header.c:2066 msgid "unknown tag" msgstr "" #. @-observertrans@ -#: lib/header.c:2078 +#: lib/header.c:2093 msgid "] expected at end of array" msgstr "" #. @-observertrans@ -#: lib/header.c:2096 +#: lib/header.c:2111 msgid "unexpected ]" msgstr "" #. @-observertrans@ -#: lib/header.c:2100 +#: lib/header.c:2115 msgid "unexpected }" msgstr "" #. @-observertrans@ -#: lib/header.c:2160 +#: lib/header.c:2177 msgid "? expected in expression" msgstr "" #. @-observertrans@ -#: lib/header.c:2169 +#: lib/header.c:2186 msgid "{ expected after ? in expression" msgstr "" #. @-observertrans@ -#: lib/header.c:2182 lib/header.c:2223 +#: lib/header.c:2199 lib/header.c:2241 msgid "} expected in expression" msgstr "" #. @-observertrans@ -#: lib/header.c:2192 +#: lib/header.c:2209 msgid ": expected following ? subexpression" msgstr "" #. @-observertrans@ -#: lib/header.c:2208 +#: lib/header.c:2226 msgid "{ expected after : in expression" msgstr "" #. @-observertrans@ -#: lib/header.c:2233 +#: lib/header.c:2251 msgid "| expected at end of expression" msgstr "" -#: lib/header.c:2404 +#: lib/header.c:2422 msgid "(unknown type)" msgstr "" -#: lib/misc.c:338 lib/misc.c:343 lib/misc.c:349 +#: lib/misc.c:330 lib/misc.c:335 lib/misc.c:341 #, c-format msgid "error creating temporary file %s\n" msgstr "" -#: lib/package.c:119 +#: lib/package.c:122 msgid "packaging version 1 is not supported by this version of RPM\n" msgstr "" -#: lib/package.c:181 +#: lib/package.c:184 msgid "" "only packaging with major numbers <= 4 is supported by this version of RPM\n" msgstr "" @@ -2878,85 +2878,85 @@ msgstr "" msgid " conflicts with %s-%s-%s\n" msgstr "" -#: lib/problems.c:118 +#: lib/problems.c:119 #, c-format msgid "package %s is for a different architecture" msgstr "" -#: lib/problems.c:122 +#: lib/problems.c:124 #, c-format msgid "package %s is for a different operating system" msgstr "" -#: lib/problems.c:126 +#: lib/problems.c:129 #, c-format msgid "package %s is already installed" msgstr "" -#: lib/problems.c:130 +#: lib/problems.c:134 #, c-format msgid "path %s in package %s is not relocateable" msgstr "" -#: lib/problems.c:135 +#: lib/problems.c:139 #, c-format msgid "file %s conflicts between attempted installs of %s and %s" msgstr "" -#: lib/problems.c:140 +#: lib/problems.c:144 #, c-format msgid "file %s from install of %s conflicts with file from package %s" msgstr "" -#: lib/problems.c:145 +#: lib/problems.c:149 #, c-format msgid "package %s (which is newer than %s) is already installed" msgstr "" -#: lib/problems.c:150 +#: lib/problems.c:154 #, c-format msgid "installing package %s needs %ld%cb on the %s filesystem" msgstr "" -#: lib/problems.c:160 +#: lib/problems.c:164 #, c-format msgid "installing package %s needs %ld inodes on the %s filesystem" msgstr "" -#: lib/problems.c:165 +#: lib/problems.c:169 #, c-format msgid "package %s pre-transaction syscall(s): %s failed: %s" msgstr "" -#: lib/problems.c:172 +#: lib/problems.c:176 #, c-format msgid "unknown error %d encountered while manipulating package %s" msgstr "" -#: lib/psm.c:565 +#: lib/psm.c:555 #, c-format msgid "cannot create %s %s\n" msgstr "" -#: lib/psm.c:571 +#: lib/psm.c:561 #, c-format msgid "cannot write to %s\n" msgstr "" -#: lib/psm.c:605 +#: lib/psm.c:598 msgid "source package expected, binary found\n" msgstr "" -#: lib/psm.c:707 +#: lib/psm.c:702 msgid "source package contains no .spec file\n" msgstr "" -#: lib/psm.c:955 +#: lib/psm.c:951 #, c-format msgid "execution of %s scriptlet from %s-%s-%s failed, waitpid returned %s\n" msgstr "" -#: lib/psm.c:962 +#: lib/psm.c:958 #, c-format msgid "execution of %s scriptlet from %s-%s-%s failed, exit status %d\n" msgstr "" @@ -2966,480 +2966,480 @@ msgstr "" msgid "%s: %s-%s-%s has %d files, test = %d\n" msgstr "" -#: lib/psm.c:1379 +#: lib/psm.c:1380 #, c-format msgid "%s: %s scriptlet failed (%d), skipping %s-%s-%s\n" msgstr "" -#: lib/psm.c:1485 +#: lib/psm.c:1486 #, c-format msgid "user %s does not exist - using root\n" msgstr "" -#: lib/psm.c:1494 +#: lib/psm.c:1495 #, c-format msgid "group %s does not exist - using root\n" msgstr "" -#: lib/psm.c:1523 +#: lib/psm.c:1524 #, c-format msgid "unpacking of archive failed%s%s: %s\n" msgstr "" -#: lib/psm.c:1524 +#: lib/psm.c:1525 msgid " on file " msgstr "" -#: lib/psm.c:1775 +#: lib/psm.c:1777 #, c-format msgid "%s: running %s script(s) (if any)\n" msgstr "" -#: lib/query.c:121 +#: lib/query.c:113 #, c-format msgid "incorrect format: %s\n" msgstr "" -#: lib/query.c:205 +#: lib/query.c:201 msgid "(contains no files)" msgstr "" -#: lib/query.c:256 +#: lib/query.c:249 msgid "normal " msgstr "" -#: lib/query.c:258 +#: lib/query.c:251 msgid "replaced " msgstr "" -#: lib/query.c:260 +#: lib/query.c:253 msgid "not installed " msgstr "" -#: lib/query.c:262 +#: lib/query.c:255 msgid "net shared " msgstr "" -#: lib/query.c:264 +#: lib/query.c:257 #, c-format msgid "(unknown %3d) " msgstr "" -#: lib/query.c:269 +#: lib/query.c:262 msgid "(no state) " msgstr "" -#: lib/query.c:288 lib/query.c:333 +#: lib/query.c:281 lib/query.c:326 msgid "package has neither file owner or id lists\n" msgstr "" -#: lib/query.c:392 +#: lib/query.c:385 #, c-format msgid "can't query %s: %s\n" msgstr "" -#: lib/query.c:514 lib/query.c:546 lib/rpminstall.c:319 lib/rpminstall.c:448 +#: lib/query.c:511 lib/query.c:543 lib/rpminstall.c:313 lib/rpminstall.c:444 #, c-format msgid "open of %s failed: %s\n" msgstr "" -#: lib/query.c:525 +#: lib/query.c:522 #, c-format msgid "query of %s failed\n" msgstr "" -#: lib/query.c:531 +#: lib/query.c:528 msgid "old format source packages cannot be queried\n" msgstr "" -#: lib/query.c:556 lib/rpminstall.c:458 +#: lib/query.c:553 lib/rpminstall.c:454 #, c-format msgid "%s: read manifest failed: %s\n" msgstr "" -#: lib/query.c:599 +#: lib/query.c:596 #, c-format msgid "query of specfile %s failed, can't parse\n" msgstr "" -#: lib/query.c:622 +#: lib/query.c:619 msgid "no packages\n" msgstr "" -#: lib/query.c:633 +#: lib/query.c:630 #, c-format msgid "group %s does not contain any packages\n" msgstr "" -#: lib/query.c:643 +#: lib/query.c:640 #, c-format msgid "no package triggers %s\n" msgstr "" -#: lib/query.c:653 +#: lib/query.c:650 #, c-format msgid "no package requires %s\n" msgstr "" -#: lib/query.c:664 +#: lib/query.c:661 #, c-format msgid "no package provides %s\n" msgstr "" -#: lib/query.c:695 +#: lib/query.c:692 #, c-format msgid "file %s: %s\n" msgstr "" -#: lib/query.c:699 +#: lib/query.c:696 #, c-format msgid "file %s is not owned by any package\n" msgstr "" -#: lib/query.c:725 +#: lib/query.c:722 #, c-format msgid "invalid package number: %s\n" msgstr "" -#: lib/query.c:728 +#: lib/query.c:725 #, c-format msgid "package record number: %u\n" msgstr "" -#: lib/query.c:733 +#: lib/query.c:730 #, c-format -msgid "record %d could not be read\n" +msgid "record %u could not be read\n" msgstr "" -#: lib/query.c:744 lib/rpminstall.c:593 +#: lib/query.c:741 lib/rpminstall.c:589 #, c-format msgid "package %s is not installed\n" msgstr "" -#: lib/rpmchecksig.c:38 +#: lib/rpmchecksig.c:39 #, c-format msgid "%s: open failed: %s\n" msgstr "" -#: lib/rpmchecksig.c:49 +#: lib/rpmchecksig.c:51 msgid "makeTempFile failed\n" msgstr "" -#: lib/rpmchecksig.c:81 +#: lib/rpmchecksig.c:84 #, c-format msgid "%s: Fwrite failed: %s\n" msgstr "" -#: lib/rpmchecksig.c:87 +#: lib/rpmchecksig.c:90 #, c-format msgid "%s: Fread failed: %s\n" msgstr "" -#: lib/rpmchecksig.c:121 lib/rpmchecksig.c:253 +#: lib/rpmchecksig.c:125 lib/rpmchecksig.c:258 #, c-format msgid "%s: readLead failed\n" msgstr "" -#: lib/rpmchecksig.c:126 +#: lib/rpmchecksig.c:130 #, c-format msgid "%s: Can't sign v1.0 RPM\n" msgstr "" -#: lib/rpmchecksig.c:130 +#: lib/rpmchecksig.c:134 #, c-format msgid "%s: Can't re-sign v2.0 RPM\n" msgstr "" -#: lib/rpmchecksig.c:139 lib/rpmchecksig.c:269 +#: lib/rpmchecksig.c:143 lib/rpmchecksig.c:274 #, c-format msgid "%s: rpmReadSignature failed\n" msgstr "" -#: lib/rpmchecksig.c:143 lib/rpmchecksig.c:274 +#: lib/rpmchecksig.c:147 lib/rpmchecksig.c:279 #, c-format msgid "%s: No signature available\n" msgstr "" -#: lib/rpmchecksig.c:176 +#: lib/rpmchecksig.c:180 #, c-format msgid "%s: writeLead failed: %s\n" msgstr "" -#: lib/rpmchecksig.c:182 +#: lib/rpmchecksig.c:186 #, c-format msgid "%s: rpmWriteSignature failed: %s\n" msgstr "" -#: lib/rpmchecksig.c:259 +#: lib/rpmchecksig.c:264 #, c-format msgid "%s: No signature available (v1.0 RPM)\n" msgstr "" -#: lib/rpmchecksig.c:423 +#: lib/rpmchecksig.c:434 msgid "NOT OK" msgstr "" -#: lib/rpmchecksig.c:424 lib/rpmchecksig.c:438 +#: lib/rpmchecksig.c:435 lib/rpmchecksig.c:449 msgid " (MISSING KEYS:" msgstr "" -#: lib/rpmchecksig.c:426 lib/rpmchecksig.c:440 +#: lib/rpmchecksig.c:437 lib/rpmchecksig.c:451 msgid ") " msgstr "" -#: lib/rpmchecksig.c:427 lib/rpmchecksig.c:441 +#: lib/rpmchecksig.c:438 lib/rpmchecksig.c:452 msgid " (UNTRUSTED KEYS:" msgstr "" -#: lib/rpmchecksig.c:429 lib/rpmchecksig.c:443 +#: lib/rpmchecksig.c:440 lib/rpmchecksig.c:454 msgid ")" msgstr "" -#: lib/rpmchecksig.c:437 +#: lib/rpmchecksig.c:448 msgid "OK" msgstr "" -#: lib/rpmdb.c:101 +#: lib/rpmdb.c:100 #, c-format msgid "dbiTagsInit: unrecognized tag name: \"%s\" ignored\n" msgstr "" -#: lib/rpmdb.c:272 +#: lib/rpmdb.c:270 #, c-format msgid "cannot open %s index using db%d - %s (%d)\n" msgstr "" -#: lib/rpmdb.c:292 +#: lib/rpmdb.c:290 #, c-format msgid "cannot open %s index\n" msgstr "" -#: lib/rpmdb.c:378 +#: lib/rpmdb.c:376 #, c-format msgid "error(%d) getting \"%s\" records from %s index\n" msgstr "" -#: lib/rpmdb.c:499 +#: lib/rpmdb.c:500 #, c-format msgid "error(%d) storing record %s into %s\n" msgstr "" -#: lib/rpmdb.c:509 +#: lib/rpmdb.c:510 #, c-format msgid "error(%d) removing record %s from %s\n" msgstr "" -#: lib/rpmdb.c:742 +#: lib/rpmdb.c:737 msgid "no dbpath has been set\n" msgstr "" -#: lib/rpmdb.c:836 +#: lib/rpmdb.c:831 msgid "" "old format database is present; use --rebuilddb to generate a new format " "database\n" msgstr "" #. error -#: lib/rpmdb.c:1020 +#: lib/rpmdb.c:1012 #, c-format msgid "error(%d) counting packages\n" msgstr "" -#: lib/rpmdb.c:1076 lib/rpmdb.c:1634 +#: lib/rpmdb.c:1068 lib/rpmdb.c:1626 #, c-format msgid "%s: cannot read header at 0x%x\n" msgstr "" -#: lib/rpmdb.c:1698 +#: lib/rpmdb.c:1333 lib/rpmdb.c:2444 +#, c-format +msgid "record number %u in database is bad -- skipping.\n" +msgstr "" + +#: lib/rpmdb.c:1689 #, c-format msgid "removing \"%s\" from %s index.\n" msgstr "" -#: lib/rpmdb.c:1707 +#: lib/rpmdb.c:1698 #, c-format msgid "removing %d entries from %s index.\n" msgstr "" -#: lib/rpmdb.c:1890 +#: lib/rpmdb.c:1885 #, c-format msgid "error(%d) allocating new package instance\n" msgstr "" -#: lib/rpmdb.c:1964 +#: lib/rpmdb.c:1958 #, c-format msgid "adding \"%s\" to %s index.\n" msgstr "" -#: lib/rpmdb.c:1973 +#: lib/rpmdb.c:1969 #, c-format msgid "adding %d entries to %s index.\n" msgstr "" -#: lib/rpmdb.c:2342 +#: lib/rpmdb.c:2340 #, c-format msgid "removing %s after successful db3 rebuild.\n" msgstr "" -#: lib/rpmdb.c:2368 +#: lib/rpmdb.c:2366 msgid "no dbpath has been set" msgstr "" -#: lib/rpmdb.c:2393 +#: lib/rpmdb.c:2391 #, c-format msgid "rebuilding database %s into %s\n" msgstr "" -#: lib/rpmdb.c:2397 +#: lib/rpmdb.c:2395 #, c-format msgid "temporary database %s already exists\n" msgstr "" -#: lib/rpmdb.c:2403 +#: lib/rpmdb.c:2401 #, c-format msgid "creating directory %s\n" msgstr "" -#: lib/rpmdb.c:2405 +#: lib/rpmdb.c:2403 #, c-format msgid "creating directory %s: %s\n" msgstr "" -#: lib/rpmdb.c:2412 +#: lib/rpmdb.c:2410 #, c-format msgid "opening old database with dbapi %d\n" msgstr "" -#: lib/rpmdb.c:2423 +#: lib/rpmdb.c:2421 #, c-format msgid "opening new database with dbapi %d\n" msgstr "" -#: lib/rpmdb.c:2446 +#: lib/rpmdb.c:2483 #, c-format -msgid "record number %d in database is bad -- skipping.\n" +msgid "cannot add record originally at %u\n" msgstr "" -#: lib/rpmdb.c:2485 -#, c-format -msgid "cannot add record originally at %d\n" -msgstr "" - -#: lib/rpmdb.c:2503 +#: lib/rpmdb.c:2501 msgid "failed to rebuild database: original database remains in place\n" msgstr "" -#: lib/rpmdb.c:2511 +#: lib/rpmdb.c:2509 msgid "failed to replace old database with new database!\n" msgstr "" -#: lib/rpmdb.c:2513 +#: lib/rpmdb.c:2511 #, c-format msgid "replace files in %s with files from %s to recover" msgstr "" -#: lib/rpmdb.c:2523 +#: lib/rpmdb.c:2521 #, c-format msgid "removing directory %s\n" msgstr "" -#: lib/rpmdb.c:2525 +#: lib/rpmdb.c:2523 #, c-format msgid "failed to remove directory %s: %s\n" msgstr "" -#: lib/rpminstall.c:162 +#: lib/rpminstall.c:153 msgid "Preparing..." msgstr "" -#: lib/rpminstall.c:164 +#: lib/rpminstall.c:155 msgid "Preparing packages for installation..." msgstr "" -#: lib/rpminstall.c:270 +#: lib/rpminstall.c:264 #, c-format msgid "Retrieving %s\n" msgstr "" #. XXX undefined %{name}/%{version}/%{release} here #. XXX %{_tmpdir} does not exist -#: lib/rpminstall.c:280 +#: lib/rpminstall.c:274 #, c-format msgid " ... as %s\n" msgstr "" -#: lib/rpminstall.c:284 +#: lib/rpminstall.c:278 #, c-format msgid "skipping %s - transfer failed - %s\n" msgstr "" -#: lib/rpminstall.c:353 +#: lib/rpminstall.c:350 #, c-format msgid "cannot open Packages database in %s\n" msgstr "" -#: lib/rpminstall.c:375 +#: lib/rpminstall.c:372 #, c-format msgid "package %s is not relocateable\n" msgstr "" -#: lib/rpminstall.c:422 +#: lib/rpminstall.c:418 #, c-format msgid "error reading from file %s\n" msgstr "" -#: lib/rpminstall.c:428 +#: lib/rpminstall.c:424 #, c-format msgid "file %s requires a newer version of RPM\n" msgstr "" -#: lib/rpminstall.c:440 lib/rpminstall.c:661 +#: lib/rpminstall.c:436 lib/rpminstall.c:657 #, c-format msgid "%s cannot be installed\n" msgstr "" -#: lib/rpminstall.c:472 +#: lib/rpminstall.c:468 #, c-format msgid "found %d source and %d binary packages\n" msgstr "" -#: lib/rpminstall.c:487 +#: lib/rpminstall.c:483 msgid "failed dependencies:\n" msgstr "" -#: lib/rpminstall.c:508 +#: lib/rpminstall.c:504 msgid "installing binary packages\n" msgstr "" -#: lib/rpminstall.c:526 +#: lib/rpminstall.c:522 #, c-format msgid "cannot open file %s: %s\n" msgstr "" -#: lib/rpminstall.c:580 +#: lib/rpminstall.c:576 #, c-format msgid "cannot open %s/packages.rpm\n" msgstr "" -#: lib/rpminstall.c:596 +#: lib/rpminstall.c:592 #, c-format msgid "\"%s\" specifies multiple packages\n" msgstr "" -#: lib/rpminstall.c:619 +#: lib/rpminstall.c:615 msgid "removing these packages would break dependencies:\n" msgstr "" -#: lib/rpminstall.c:648 +#: lib/rpminstall.c:644 #, c-format msgid "cannot open %s: %s\n" msgstr "" -#: lib/rpminstall.c:654 +#: lib/rpminstall.c:650 #, c-format msgid "Installing %s\n" msgstr "" -#: lib/rpmlead.c:48 +#: lib/rpmlead.c:49 #, c-format msgid "read failed: %s (%d)\n" msgstr "" @@ -3469,73 +3469,73 @@ msgstr "" msgid "Bad arch/os number: %s (%s:%d)\n" msgstr "" -#: lib/rpmrc.c:354 +#: lib/rpmrc.c:357 #, c-format msgid "Incomplete default line at %s:%d\n" msgstr "" -#: lib/rpmrc.c:359 +#: lib/rpmrc.c:362 #, c-format msgid "Too many args in default line at %s:%d\n" msgstr "" -#: lib/rpmrc.c:549 +#: lib/rpmrc.c:555 #, c-format msgid "Cannot expand %s\n" msgstr "" -#: lib/rpmrc.c:554 +#: lib/rpmrc.c:560 #, c-format msgid "Cannot read %s, HOME is too large.\n" msgstr "" -#: lib/rpmrc.c:571 +#: lib/rpmrc.c:577 #, c-format msgid "Unable to open %s for reading: %s.\n" msgstr "" #. XXX Feof(fd) -#: lib/rpmrc.c:616 +#: lib/rpmrc.c:622 #, c-format msgid "Failed to read %s: %s.\n" msgstr "" -#: lib/rpmrc.c:653 +#: lib/rpmrc.c:659 #, c-format msgid "missing ':' (found 0x%02x) at %s:%d\n" msgstr "" -#: lib/rpmrc.c:670 lib/rpmrc.c:744 +#: lib/rpmrc.c:676 lib/rpmrc.c:750 #, c-format msgid "missing argument for %s at %s:%d\n" msgstr "" -#: lib/rpmrc.c:687 lib/rpmrc.c:709 +#: lib/rpmrc.c:693 lib/rpmrc.c:715 #, c-format msgid "%s expansion failed at %s:%d \"%s\"\n" msgstr "" -#: lib/rpmrc.c:696 +#: lib/rpmrc.c:702 #, c-format msgid "cannot open %s at %s:%d: %s\n" msgstr "" -#: lib/rpmrc.c:736 +#: lib/rpmrc.c:742 #, c-format msgid "missing architecture for %s at %s:%d\n" msgstr "" -#: lib/rpmrc.c:803 +#: lib/rpmrc.c:809 #, c-format msgid "bad option '%s' at %s:%d\n" msgstr "" -#: lib/rpmrc.c:1350 +#: lib/rpmrc.c:1352 #, c-format msgid "Unknown system: %s\n" msgstr "" -#: lib/rpmrc.c:1351 +#: lib/rpmrc.c:1353 msgid "Please contact rpm-list@redhat.com\n" msgstr "" @@ -3657,72 +3657,72 @@ msgstr "" msgid "You must set \"%%_pgp_name\" in your macro file\n" msgstr "" -#: lib/transaction.c:420 +#: lib/transaction.c:414 msgid "========== relocations\n" msgstr "" -#: lib/transaction.c:423 +#: lib/transaction.c:417 #, c-format msgid "%5d exclude %s\n" msgstr "" -#: lib/transaction.c:426 +#: lib/transaction.c:420 #, c-format msgid "%5d relocate %s -> %s\n" msgstr "" -#: lib/transaction.c:495 +#: lib/transaction.c:489 #, c-format msgid "excluding multilib path %s%s\n" msgstr "" -#: lib/transaction.c:557 +#: lib/transaction.c:551 #, c-format msgid "excluding %s %s\n" msgstr "" -#: lib/transaction.c:567 +#: lib/transaction.c:561 #, c-format msgid "relocating %s to %s\n" msgstr "" -#: lib/transaction.c:642 +#: lib/transaction.c:636 #, c-format msgid "relocating directory %s to %s\n" msgstr "" -#: lib/transaction.c:771 +#: lib/transaction.c:765 #, c-format msgid "%s skipped due to missingok flag\n" msgstr "" -#: lib/transaction.c:1358 +#: lib/transaction.c:1352 #, c-format msgid "excluding directory %s\n" msgstr "" -#: lib/verify.c:61 +#: lib/verify.c:63 msgid "don't verify files in package" msgstr "" -#: lib/verify.c:67 +#: lib/verify.c:69 msgid "do not execute %verifyscript (if any)" msgstr "" -#: lib/verify.c:257 +#: lib/verify.c:265 msgid "package lacks both user name and id lists (this should never happen)\n" msgstr "" -#: lib/verify.c:275 +#: lib/verify.c:286 msgid "package lacks both group name and id lists (this should never happen)\n" msgstr "" -#: lib/verify.c:348 +#: lib/verify.c:360 #, c-format msgid "missing %s" msgstr "" -#: lib/verify.c:429 +#: lib/verify.c:441 #, c-format msgid "Unsatisfied dependencies for %s-%s-%s: " msgstr "" @@ -3733,135 +3733,135 @@ msgid "======================== active %d empty %d\n" msgstr "" #. XXX just in case -#: rpmio/macro.c:301 +#: rpmio/macro.c:303 #, c-format msgid "%3d>%*s(empty)" msgstr "" -#: rpmio/macro.c:342 +#: rpmio/macro.c:344 #, c-format msgid "%3d<%*s(empty)\n" msgstr "" -#: rpmio/macro.c:556 +#: rpmio/macro.c:560 msgid "Macro %%%s has unterminated body\n" msgstr "" -#: rpmio/macro.c:583 +#: rpmio/macro.c:587 msgid "Macro %%%s has illegal name (%%define)\n" msgstr "" -#: rpmio/macro.c:590 +#: rpmio/macro.c:594 msgid "Macro %%%s has unterminated opts\n" msgstr "" -#: rpmio/macro.c:595 +#: rpmio/macro.c:599 msgid "Macro %%%s has empty body\n" msgstr "" -#: rpmio/macro.c:600 +#: rpmio/macro.c:604 msgid "Macro %%%s failed to expand\n" msgstr "" -#: rpmio/macro.c:632 +#: rpmio/macro.c:636 msgid "Macro %%%s has illegal name (%%undefine)\n" msgstr "" -#: rpmio/macro.c:726 +#: rpmio/macro.c:732 msgid "Macro %%%s (%s) was not used below level %d\n" msgstr "" -#: rpmio/macro.c:819 +#: rpmio/macro.c:825 #, c-format msgid "Unknown option %c in %s(%s)\n" msgstr "" -#: rpmio/macro.c:999 +#: rpmio/macro.c:1005 #, c-format msgid "Recursion depth(%d) greater than max(%d)\n" msgstr "" -#: rpmio/macro.c:1066 rpmio/macro.c:1083 +#: rpmio/macro.c:1072 rpmio/macro.c:1089 #, c-format msgid "Unterminated %c: %s\n" msgstr "" -#: rpmio/macro.c:1124 +#: rpmio/macro.c:1130 msgid "A %% is followed by an unparseable macro\n" msgstr "" -#: rpmio/macro.c:1251 +#: rpmio/macro.c:1257 msgid "Macro %%%.*s not found, skipping\n" msgstr "" -#: rpmio/macro.c:1322 +#: rpmio/macro.c:1334 msgid "Target buffer overflow\n" msgstr "" #. XXX Fstrerror -#: rpmio/macro.c:1502 rpmio/macro.c:1508 +#: rpmio/macro.c:1522 rpmio/macro.c:1528 #, c-format msgid "File %s: %s\n" msgstr "" -#: rpmio/macro.c:1511 +#: rpmio/macro.c:1531 #, c-format msgid "File %s is smaller than %u bytes\n" msgstr "" -#: rpmio/rpmio.c:535 +#: rpmio/rpmio.c:549 msgid "Success" msgstr "" -#: rpmio/rpmio.c:538 +#: rpmio/rpmio.c:552 msgid "Bad server response" msgstr "" -#: rpmio/rpmio.c:541 +#: rpmio/rpmio.c:555 msgid "Server I/O error" msgstr "" -#: rpmio/rpmio.c:544 +#: rpmio/rpmio.c:558 msgid "Server timeout" msgstr "" -#: rpmio/rpmio.c:547 +#: rpmio/rpmio.c:561 msgid "Unable to lookup server host address" msgstr "" -#: rpmio/rpmio.c:550 +#: rpmio/rpmio.c:564 msgid "Unable to lookup server host name" msgstr "" -#: rpmio/rpmio.c:553 +#: rpmio/rpmio.c:567 msgid "Failed to connect to server" msgstr "" -#: rpmio/rpmio.c:556 +#: rpmio/rpmio.c:570 msgid "Failed to establish data connection to server" msgstr "" -#: rpmio/rpmio.c:559 +#: rpmio/rpmio.c:573 msgid "I/O error to local file" msgstr "" -#: rpmio/rpmio.c:562 +#: rpmio/rpmio.c:576 msgid "Error setting remote server to passive mode" msgstr "" -#: rpmio/rpmio.c:565 +#: rpmio/rpmio.c:579 msgid "File not found on server" msgstr "" -#: rpmio/rpmio.c:568 +#: rpmio/rpmio.c:582 msgid "Abort in progress" msgstr "" -#: rpmio/rpmio.c:572 +#: rpmio/rpmio.c:586 msgid "Unknown or unexpected error" msgstr "" -#: rpmio/rpmio.c:1167 +#: rpmio/rpmio.c:1194 #, c-format msgid "logging into %s as %s, pw %s\n" msgstr "" @@ -3905,22 +3905,22 @@ msgstr "" msgid "warning: uCache[%d] %p nrefs(%d) != 1 (%s %s)\n" msgstr "" -#: rpmio/url.c:224 +#: rpmio/url.c:229 #, c-format msgid "Password for %s@%s: " msgstr "" -#: rpmio/url.c:248 rpmio/url.c:274 +#: rpmio/url.c:253 rpmio/url.c:279 #, c-format msgid "error: %sport must be a number\n" msgstr "" -#: rpmio/url.c:412 +#: rpmio/url.c:417 msgid "url port must be a number\n" msgstr "" #. XXX Fstrerror -#: rpmio/url.c:469 +#: rpmio/url.c:474 #, c-format msgid "failed to create %s: %s\n" msgstr "" diff --git a/popt/.lclintrc b/popt/.lclintrc index 3e869d52b..81370f681 100644 --- a/popt/.lclintrc +++ b/popt/.lclintrc @@ -9,18 +9,12 @@ # don't-bother-me-yet parameters #-branchstate -#-immediatetrans -mustfree -#-observertrans -#-statictrans # not-yet normal parameters -boolops # w->n --fixedformalarray --null +#-null -predboolint # w->n --predboolothers # w->n --retvalint # w->n -type diff --git a/rpmio/.lclintrc b/rpmio/.lclintrc index 5da960259..0d1f2d9de 100644 --- a/rpmio/.lclintrc +++ b/rpmio/.lclintrc @@ -12,21 +12,15 @@ # don't-bother-me-yet parameters -branchstate # ~43 occurences -#-immediatetrans --mustfree # alloca is painful -#-observertrans -#-statictrans +-mustfree # ~122 alloca is painful # not-yet normal parameters --boolops # w->n -#-fixedformalarray --null # ugh --predboolint # w->n ~144 -#-predboolothers # w->n ~8 --retvalint # w->n ~48 --type # ~449 +-boolops # ~244 w->n +#-null # ~84 +-predboolint # ~147 w->n +-type # ~373 -# not-yet -weak paramaters +# -weak paramaters #+boolint #-boolops #+ignorequals diff --git a/rpmio/digest.c b/rpmio/digest.c index 8fa83dea4..461aebd47 100644 --- a/rpmio/digest.c +++ b/rpmio/digest.c @@ -453,14 +453,18 @@ rpmDigestUpdate(DIGEST_CTX ctx, const void * data, size_t len) /* Process data in ctx->datalen chunks */ for (; len >= ctx->datalen; buf += ctx->datalen, len -= ctx->datalen) { + /*@-mayaliasunique@*/ memcpy(ctx->in, buf, ctx->datalen); + /*@=mayaliasunique@*/ if (ctx->doByteReverse) byteReverse(ctx->in, ctx->datalen); ctx->transform(ctx); } /* Handle any remaining bytes of data. */ + /*@-mayaliasunique@*/ memcpy(ctx->in, buf, len); + /*@=mayaliasunique@*/ } void diff --git a/rpmio/macro.c b/rpmio/macro.c index 9fb896507..e74698a64 100644 --- a/rpmio/macro.c +++ b/rpmio/macro.c @@ -214,7 +214,9 @@ findEntry(MacroContext *mc, const char *name, size_t namelen) key = &keybuf; memset(key, 0, sizeof(*key)); + /*@-temptrans@*/ key->name = (char *)name; + /*@=temptrans@*/ ret = (MacroEntry **)bsearch(&key, mc->macroTable, mc->firstFree, sizeof(*(mc->macroTable)), compareMacroName); /* XXX TODO: find 1st empty slot and return that */ @@ -466,7 +468,9 @@ expandU(MacroBuf *mb, char *u, size_t ulen) tbuf = alloca(ulen + 1); memset(tbuf, 0, (ulen + 1)); + /*@-temptrans@*/ mb->s = u; + /*@=temptrans@*/ mb->t = tbuf; mb->nb = ulen; rc = expandMacro(mb); @@ -507,7 +511,7 @@ doShellEscape(MacroBuf *mb, const char *cmd, size_t clen) return 1; while(mb->nb > 0 && (c = fgetc(shf)) != EOF) SAVECHAR(mb, c); - pclose(shf); + (void) pclose(shf); /* XXX delete trailing \r \n */ while (iseol(mb->t[-1])) { @@ -686,11 +690,13 @@ popMacro(MacroEntry **mep) if (me) { /* XXX cast to workaround const */ + /*@-onlytrans@*/ if ((*mep = me->prev) == NULL) FREE(me->name); FREE(me->opts); FREE(me->body); FREE(me); + /*@=onlytrans@*/ } } @@ -817,7 +823,7 @@ grabArgs(MacroBuf *mb, const MacroEntry *me, const char *se, char lastc) while((c = getopt(argc, (char **)argv, opts)) != -1) { if (c == '?' || (o = strchr(opts, c)) == NULL) { rpmError(RPMERR_BADSPEC, _("Unknown option %c in %s(%s)\n"), - c, me->name, opts); + (char)c, me->name, opts); return se; } *be++ = '-'; @@ -869,7 +875,7 @@ doOutput(MacroBuf *mb, int waserror, const char *msg, size_t msglen) strncpy(buf, msg, msglen); buf[msglen] = '\0'; - expandU(mb, buf, sizeof(buf)); + (void) expandU(mb, buf, sizeof(buf)); if (waserror) rpmError(RPMERR_BADSPEC, "%s\n", buf); else @@ -895,7 +901,7 @@ doFoo(MacroBuf *mb, int negate, const char *f, size_t fn, const char *g, size_t if (g) { strncpy(buf, g, glen); buf[glen] = '\0'; - expandU(mb, buf, sizeof(buf)); + (void) expandU(mb, buf, sizeof(buf)); } if (STREQ("basename", f, fn)) { if ((b = strrchr(buf, '/')) == NULL) @@ -928,7 +934,7 @@ doFoo(MacroBuf *mb, int negate, const char *f, size_t fn, const char *g, size_t be++; *be++ = '\0'; #ifndef DEBUG_MACROS - isCompressed(b, &compressed); + (void) isCompressed(b, &compressed); #endif switch(compressed) { default: @@ -968,7 +974,7 @@ doFoo(MacroBuf *mb, int negate, const char *f, size_t fn, const char *g, size_t } if (b) { - expandT(mb, b, strlen(b)); + (void) expandT(mb, b, strlen(b)); } } @@ -1063,7 +1069,7 @@ expandMacro(MacroBuf *mb) case '(': /* %(...) shell escape */ if ((se = matchchar(s, c, ')')) == NULL) { rpmError(RPMERR_BADSPEC, - _("Unterminated %c: %s\n"), c, s); + _("Unterminated %c: %s\n"), (char)c, s); rc = 1; continue; } @@ -1080,7 +1086,7 @@ expandMacro(MacroBuf *mb) case '{': /* %{...}/%{...:...} substitution */ if ((se = matchchar(s, c, '}')) == NULL) { rpmError(RPMERR_BADSPEC, - _("Unterminated %c: %s\n"), c, s); + _("Unterminated %c: %s\n"), (char)c, s); rc = 1; continue; } @@ -1268,7 +1274,9 @@ expandMacro(MacroBuf *mb) /* Recursively expand body of macro */ if (me->body && *me->body) { + /*@-onlytrans@*/ mb->s = me->body; + /*@=onlytrans@*/ rc = expandMacro(mb); if (rc == 0) me->used++; /* Mark macro as used */ @@ -1306,15 +1314,19 @@ expandMacros(void *spec, MacroContext *mc, char *s, size_t slen) tbuf = alloca(slen + 1); memset(tbuf, 0, (slen + 1)); + /*@-temptrans@*/ mb->s = s; + /*@=temptrans@*/ mb->t = tbuf; mb->nb = slen; mb->depth = 0; mb->macro_trace = print_macro_trace; mb->expand_trace = print_expand_trace; + /*@-temptrans@*/ mb->spec = spec; /* (future) %file expansion info */ mb->mc = mc; + /*@=temptrans@*/ rc = expandMacro(mb); @@ -1373,7 +1385,9 @@ rpmDefineMacro(MacroContext *mc, const char *macro, int level) memset(mb, 0, sizeof(*mb)); /* XXX just enough to get by */ + /*@-temptrans@*/ mb->mc = (mc ? mc : &rpmGlobalMacroContext); + /*@=temptrans@*/ (void)doDefine(mb, macro, level, 0); return 0; } @@ -1436,7 +1450,7 @@ rpmInitMacros(MacroContext *mc, const char *macrofiles) fd = Fopen(buf, "r.fpio"); if (fd == NULL || Ferror(fd)) { - if (fd) Fclose(fd); + if (fd) (void) Fclose(fd); continue; } @@ -1454,15 +1468,18 @@ rpmInitMacros(MacroContext *mc, const char *macrofiles) n++; /* skip % */ (void)rpmDefineMacro(NULL, n, RMIL_MACROFILES); } - Fclose(fd); + (void) Fclose(fd); } - if (m) + if (m) { free(m); + m = NULL; + } /* Reload cmdline macros */ rpmLoadMacros(&rpmCLIMacroContext, RMIL_CMDLINE); } +/*@-globstate@*/ void rpmFreeMacros(MacroContext *mc) { @@ -1475,8 +1492,10 @@ rpmFreeMacros(MacroContext *mc) MacroEntry *me; while ((me = mc->macroTable[i]) != NULL) { /* XXX cast to workaround const */ + /*@-onlytrans@*/ if ((mc->macroTable[i] = me->prev) == NULL) FREE(me->name); + /*@=onlytrans@*/ FREE(me->opts); FREE(me->body); FREE(me); @@ -1485,6 +1504,7 @@ rpmFreeMacros(MacroContext *mc) FREE(mc->macroTable); memset(mc, 0, sizeof(*mc)); } +/*@=globstate@*/ /* =============================================================== */ int isCompressed(const char *file, rpmCompressedMagic *compressed) @@ -1500,7 +1520,7 @@ int isCompressed(const char *file, rpmCompressedMagic *compressed) if (fd == NULL || Ferror(fd)) { /* XXX Fstrerror */ rpmError(RPMERR_BADSPEC, _("File %s: %s\n"), file, Fstrerror(fd)); - if (fd) Fclose(fd); + if (fd) (void) Fclose(fd); return 1; } nb = Fread(magic, sizeof(char), sizeof(magic), fd); @@ -1512,7 +1532,7 @@ int isCompressed(const char *file, rpmCompressedMagic *compressed) file, (unsigned)sizeof(magic)); rc = 0; } - Fclose(fd); + (void) Fclose(fd); if (rc >= 0) return rc; @@ -1555,7 +1575,7 @@ rpmExpand(const char *arg, ...) while ((s = va_arg(ap, const char *)) != NULL) pe = stpcpy(pe, s); va_end(ap); - expandMacros(NULL, NULL, buf, sizeof(buf)); + (void) expandMacros(NULL, NULL, buf, sizeof(buf)); return xstrdup(buf); } @@ -1661,7 +1681,7 @@ char *rpmCleanPath(char * path) *t = '\0'; /*fprintf(stderr, "\t%s\n", path); */ - return path; + /*@-temptrans@*/ return path; /*@=temptrans@*/ } /* Return concatenated and expanded canonical path. */ @@ -1688,7 +1708,7 @@ rpmGetPath(const char *path, ...) *te = '\0'; } va_end(ap); - expandMacros(NULL, NULL, buf, sizeof(buf)); + (void) expandMacros(NULL, NULL, buf, sizeof(buf)); (void) rpmCleanPath(buf); return xstrdup(buf); /* XXX xstrdup has side effects. */ diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c index d9b5606a5..63ecd2441 100644 --- a/rpmio/rpmio.c +++ b/rpmio/rpmio.c @@ -278,7 +278,7 @@ static inline /*@null@*/ FD_t XfdNew(const char *msg, const char *file, unsigned fd->errcookie = NULL; fd->stats = xcalloc(1, sizeof(*fd->stats)); fd->digest = NULL; - gettimeofday(&fd->stats->create, NULL); + (void) gettimeofday(&fd->stats->create, NULL); fd->stats->begin = fd->stats->create; /* structure assignment */ fd->ftpFileDoneNeeded = 0; @@ -352,7 +352,7 @@ static inline int fdSeek(void * cookie, _libio_pos_t pos, int whence) { rc = lseek(fdFileno(fd), p, whence); fdstat_exit(fd, FDSTAT_SEEK, rc); -DBGIO(fd, (stderr, "==>\tfdSeek(%p,%ld,%d) rc %lx %s\n", cookie, (long)p, whence, (long)rc, fdbg(fd))); +DBGIO(fd, (stderr, "==>\tfdSeek(%p,%ld,%d) rc %lx %s\n", cookie, (long)p, whence, (unsigned long)rc, fdbg(fd))); return rc; } @@ -372,7 +372,7 @@ int fdClose( /*@only@*/ void * cookie) { rc = ((fdno >= 0) ? close(fdno) : -2); fdstat_exit(fd, FDSTAT_CLOSE, rc); -DBGIO(fd, (stderr, "==>\tfdClose(%p) rc %lx %s\n", fd, (long)rc, fdbg(fd))); +DBGIO(fd, (stderr, "==>\tfdClose(%p) rc %lx %s\n", fd, (unsigned long)rc, fdbg(fd))); fd = fdFree(fd, "open (fdClose)"); return rc; @@ -387,7 +387,7 @@ DBGIO(fd, (stderr, "==>\tfdClose(%p) rc %lx %s\n", fd, (long)rc, fdbg(fd))); fd = fdNew("open (fdOpen)"); fdSetFdno(fd, fdno); fd->flags = flags; -DBGIO(fd, (stderr, "==>\tfdOpen(\"%s\",%x,0%o) %s\n", path, flags, (unsigned)mode, fdbg(fd))); +DBGIO(fd, (stderr, "==>\tfdOpen(\"%s\",%x,0%o) %s\n", path, (unsigned)flags, (unsigned)mode, fdbg(fd))); /*@-refcounttrans@*/ return fd; /*@=refcounttrans@*/ } @@ -418,7 +418,9 @@ int fdWritable(FD_t fd, int secs) tvp->tv_usec = 0; } errno = 0; + /*@-compdef@*/ rc = select(fdno + 1, NULL, &wrfds, NULL, tvp); + /*@=compdef@*/ if (_rpmio_debug && !(rc == 1 && errno == 0)) fprintf(stderr, "*** fdWritable fdno %d rc %d %s\n", fdno, rc, strerror(errno)); @@ -456,7 +458,9 @@ int fdReadable(FD_t fd, int secs) tvp->tv_usec = 0; } errno = 0; + /*@-compdef@*/ rc = select(fdno + 1, &rdfds, NULL, NULL, tvp); + /*@=compdef@*/ if (rc < 0) { switch (errno) { @@ -619,25 +623,25 @@ static int mygethostbyname(const char * host, struct in_addr * address) static int getHostAddress(const char * host, struct in_addr * address) { if (xisdigit(host[0])) { - if (! /*@-unrecog@*/ inet_aton(host, address) /*@=unrecog@*/ ) { - return FTPERR_BAD_HOST_ADDR; - } + if (! /*@-unrecog@*/ inet_aton(host, address) /*@=unrecog@*/ ) + return FTPERR_BAD_HOST_ADDR; } else { - if (mygethostbyname(host, address)) { - errno = h_errno; - return FTPERR_BAD_HOSTNAME; - } + if (mygethostbyname(host, address)) { + errno = /*@-unrecog@*/ h_errno /*@=unrecog@*/; + return FTPERR_BAD_HOSTNAME; + } } return 0; } -static int tcpConnect(FD_t ctrl, const char *host, int port) +static int tcpConnect(FD_t ctrl, const char * host, int port) { struct sockaddr_in sin; int fdno = -1; int rc; + memset(&sin, 0, sizeof(sin)); sin.sin_family = AF_INET; sin.sin_port = htons(port); sin.sin_addr.s_addr = INADDR_ANY; @@ -669,9 +673,11 @@ ntohs(sin.sin_port), fdno); return 0; errxit: + /*@-observertrans@*/ fdSetSyserrno(ctrl, errno, ftpStrerror(rc)); + /*@=observertrans@*/ if (fdno >= 0) - close(fdno); + (void) close(fdno); return rc; } @@ -929,8 +935,9 @@ static int ftpLogin(urlinfo u) } if (fdFileno(u->ctrl) >= 0 && fdWritable(u->ctrl, 0) < 1) - fdClose(u->ctrl); + /*@-refcounttrans@*/ (void) fdClose(u->ctrl); /*@=refcounttrans@*/ +/*@-usereleased@*/ if (fdFileno(u->ctrl) < 0) { rc = tcpConnect(u->ctrl, host, port); if (rc < 0) @@ -949,14 +956,21 @@ static int ftpLogin(urlinfo u) if ((rc = ftpCommand(u, NULL, "TYPE", "I", NULL))) goto errxit; + /*@-compdef@*/ return 0; + /*@=compdef@*/ errxit: + /*@-observertrans@*/ fdSetSyserrno(u->ctrl, errno, ftpStrerror(rc)); + /*@=observertrans@*/ errxit2: if (fdFileno(u->ctrl) >= 0) - fdClose(u->ctrl); + /*@-refcounttrans@*/ (void) fdClose(u->ctrl); /*@=refcounttrans@*/ + /*@-compdef@*/ return rc; + /*@=compdef@*/ +/*@=usereleased@*/ } int ftpReq(FD_t data, const char * ftpCmd, const char * ftpArg) @@ -1028,6 +1042,7 @@ int ftpReq(FD_t data, const char * ftpCmd, const char * ftpArg) port number portion */ { int i, j; + memset(&dataAddress, 0, sizeof(dataAddress)); dataAddress.sin_family = AF_INET; if (sscanf(chptr, "%d,%d", &i, &j) != 2) { rc = FTPERR_PASSIVE_ERROR; @@ -1083,9 +1098,11 @@ fprintf(stderr, "-> %s", cmd); return 0; errxit: + /*@-observertrans@*/ fdSetSyserrno(u->ctrl, errno, ftpStrerror(rc)); + /*@=observertrans@*/ if (fdFileno(data) >= 0) - fdClose(data); + /*@-refcounttrans@*/ (void) fdClose(data); /*@=refcounttrans@*/ return rc; } @@ -1200,7 +1217,7 @@ int ufdGetFile(FD_t sfd, FD_t tfd) FDSANE(sfd); FDSANE(tfd); rc = ufdCopy(sfd, tfd); - Fclose(sfd); + (void) Fclose(sfd); if (rc > 0) /* XXX ufdCopy now returns no. bytes copied */ rc = 0; return rc; @@ -1253,14 +1270,15 @@ static int ftpAbort(urlinfo u, FD_t data) { DBGIO(0, (stderr, "-> ABOR\n")); +/*@-usereleased -compdef@*/ if (send(fdFileno(ctrl), ipbuf, sizeof(ipbuf), MSG_OOB) != sizeof(ipbuf)) { - fdClose(ctrl); + /*@-refcounttrans@*/ (void) fdClose(ctrl); /*@=refcounttrans@*/ return FTPERR_SERVER_IO_ERROR; } sprintf(u->buf, "%cABOR\r\n",(char) DM); if (fdWrite(ctrl, u->buf, 7) != 7) { - fdClose(ctrl); + /*@-refcounttrans@*/ (void) fdClose(ctrl); /*@=refcounttrans@*/ return FTPERR_SERVER_IO_ERROR; } @@ -1274,8 +1292,8 @@ static int ftpAbort(urlinfo u, FD_t data) { } data->rd_timeoutsecs = tosecs; /* XXX ftp abort needs to close the data channel to receive status */ - shutdown(fdFileno(data), SHUT_RDWR); - close(fdFileno(data)); + (void) shutdown(fdFileno(data), SHUT_RDWR); + (void) close(fdFileno(data)); data->fps[0].fdno = -1; /* XXX WRONG but expedient */ } @@ -1289,6 +1307,7 @@ static int ftpAbort(urlinfo u, FD_t data) { u->ctrl->rd_timeoutsecs = tosecs; return rc; +/*@=usereleased =compdef@*/ } static int ftpFileDone(urlinfo u, FD_t data) @@ -1351,9 +1370,10 @@ static int httpReq(FD_t ctrl, const char * httpCmd, const char * httpArg) reopen: if (fdFileno(ctrl) >= 0 && (rc = fdWritable(ctrl, 0)) < 1) { - fdClose(ctrl); + /*@-refcounttrans@*/ (void) fdClose(ctrl); /*@=refcounttrans@*/ } +/*@-usereleased@*/ if (fdFileno(ctrl) < 0) { rc = tcpConnect(ctrl, host, port); if (rc < 0) @@ -1410,7 +1430,7 @@ fprintf(stderr, "-> %s", req); if (rc) { if (!retrying) { /* not HTTP_OK */ retrying = 1; - fdClose(ctrl); + /*@-refcounttrans@*/ (void) fdClose(ctrl); /*@=refcounttrans@*/ goto reopen; } goto errxit; @@ -1421,11 +1441,14 @@ fprintf(stderr, "-> %s", req); return 0; errxit: + /*@-observertrans@*/ fdSetSyserrno(ctrl, errno, ftpStrerror(rc)); + /*@=observertrans@*/ errxit2: if (fdFileno(ctrl) >= 0) - fdClose(ctrl); + /*@-refcounttrans@*/ (void) fdClose(ctrl); /*@=refcounttrans@*/ return rc; +/*@=usereleased@*/ } /* XXX DYING: unused */ @@ -1446,7 +1469,7 @@ static ssize_t ufdRead(void * cookie, /*@out@*/ char * buf, size_t count) { if (fdGetIo(fd) == fdio) { struct stat sb; int fdno = fdFileno(fd); - fstat(fdno, &sb); + (void) fstat(fdno, &sb); if (S_ISREG(sb.st_mode)) return fdRead(fd, buf, count); } @@ -1506,7 +1529,7 @@ static ssize_t ufdWrite(void * cookie, const char * buf, size_t count) #ifdef NOTYET if (fdGetIo(fd) == fdio) { struct stat sb; - fstat(fdGetFdno(fd), &sb); + (void) fstat(fdGetFdno(fd), &sb); if (S_ISREG(sb.st_mode)) return fdWrite(fd, buf, count); } @@ -1624,9 +1647,9 @@ int ufdClose( /*@only@*/ void * cookie) if (fd->bytesRemain > 0) { if (fd->ftpFileDoneNeeded) { if (fdReadable(u->ctrl, 0) > 0) - ftpFileDone(u, fd); + (void) ftpFileDone(u, fd); else - ftpAbort(u, fd); + (void) ftpAbort(u, fd); } } else { int rc; @@ -1636,7 +1659,7 @@ int ufdClose( /*@only@*/ void * cookie) assert(fd->ftpFileDoneNeeded != 0); #endif if (fd->ftpFileDoneNeeded) - ftpFileDone(u, fd); + (void) ftpFileDone(u, fd); return rc; } } @@ -1726,8 +1749,8 @@ exit: return fd; } -static /*@null@*/ FD_t httpOpen(const char *url, int flags, mode_t mode, - /*@out@*/ urlinfo *uret) +static /*@null@*/ FD_t httpOpen(const char * url, /*@unused@*/ int flags, + /*@unused@*/ mode_t mode, /*@out@*/ urlinfo * uret) { urlinfo u = NULL; FD_t fd = NULL; @@ -1775,7 +1798,7 @@ static /*@null@*/ FD_t ufdOpen(const char *url, int flags, mode_t mode) urltype urlType = urlPath(url, &path); if (_rpmio_debug) -fprintf(stderr, "*** ufdOpen(%s,0x%x,0%o)\n", url, flags, (unsigned)mode); +fprintf(stderr, "*** ufdOpen(%s,0x%x,0%o)\n", url, (unsigned)flags, (unsigned)mode); switch (urlType) { case URL_IS_FTP: @@ -1843,10 +1866,10 @@ fprintf(stderr, "*** ufdOpen(%s,0x%x,0%o)\n", url, flags, (unsigned)mode); if (fd == NULL) return NULL; fd->urlType = urlType; if (Fileno(fd) < 0) { - ufdClose(fd); + (void) ufdClose(fd); return NULL; } -DBGIO(fd, (stderr, "==>\tufdOpen(\"%s\",%x,0%o) %s\n", url, flags, (unsigned)mode, fdbg(fd))); +DBGIO(fd, (stderr, "==>\tufdOpen(\"%s\",%x,0%o) %s\n", url, (unsigned)flags, (unsigned)mode, fdbg(fd))); return fd; } @@ -1922,7 +1945,7 @@ static ssize_t gzdRead(void * cookie, /*@out@*/ char * buf, size_t count) { gzfile = gzdFileno(fd); fdstat_enter(fd, FDSTAT_READ); rc = gzread(gzfile, buf, count); -DBGIO(fd, (stderr, "==>\tgzdRead(%p,%p,%u) rc %lx %s\n", cookie, buf, (unsigned)count, (long)rc, fdbg(fd))); +DBGIO(fd, (stderr, "==>\tgzdRead(%p,%p,%u) rc %lx %s\n", cookie, buf, (unsigned)count, (unsigned long)rc, fdbg(fd))); if (rc < 0) { int zerror = 0; fd->errcookie = gzerror(gzfile, &zerror); @@ -1949,7 +1972,7 @@ static ssize_t gzdWrite(void * cookie, const char * buf, size_t count) { gzfile = gzdFileno(fd); fdstat_enter(fd, FDSTAT_WRITE); rc = gzwrite(gzfile, (void *)buf, count); -DBGIO(fd, (stderr, "==>\tgzdWrite(%p,%p,%u) rc %lx %s\n", cookie, buf, (unsigned)count, (long)rc, fdbg(fd))); +DBGIO(fd, (stderr, "==>\tgzdWrite(%p,%p,%u) rc %lx %s\n", cookie, buf, (unsigned)count, (unsigned long)rc, fdbg(fd))); if (rc < 0) { int zerror = 0; fd->errcookie = gzerror(gzfile, &zerror); @@ -1979,7 +2002,7 @@ static inline int gzdSeek(void * cookie, _libio_pos_t pos, int whence) { gzfile = gzdFileno(fd); fdstat_enter(fd, FDSTAT_SEEK); rc = gzseek(gzfile, p, whence); -DBGIO(fd, (stderr, "==>\tgzdSeek(%p,%ld,%d) rc %lx %s\n", cookie, (long)p, whence, (long)rc, fdbg(fd))); +DBGIO(fd, (stderr, "==>\tgzdSeek(%p,%ld,%d) rc %lx %s\n", cookie, (long)p, whence, (unsigned long)rc, fdbg(fd))); if (rc < 0) { int zerror = 0; fd->errcookie = gzerror(gzfile, &zerror); @@ -2022,7 +2045,7 @@ DBGIO(fd, (stderr, "==>\tgzdClose(%p) zerror %d %s\n", cookie, rc, fdbg(fd))); } } -DBGIO(fd, (stderr, "==>\tgzdClose(%p) rc %lx %s\n", cookie, (long)rc, fdbg(fd))); +DBGIO(fd, (stderr, "==>\tgzdClose(%p) rc %lx %s\n", cookie, (unsigned long)rc, fdbg(fd))); if (_rpmio_debug || rpmIsDebug()) fdstat_print(fd, "GZDIO", stderr); if (rc == 0) @@ -2174,7 +2197,7 @@ static int bzdClose( /*@only@*/ void * cookie) { } } -DBGIO(fd, (stderr, "==>\tbzdClose(%p) rc %lx %s\n", cookie, (long)rc, fdbg(fd))); +DBGIO(fd, (stderr, "==>\tbzdClose(%p) rc %lx %s\n", cookie, (unsigned long)rc, fdbg(fd))); if (_rpmio_debug || rpmIsDebug()) fdstat_print(fd, "BZDIO", stderr); if (rc == 0) @@ -2322,9 +2345,12 @@ DBGIO(fd, (stderr, "==> Fclose(%p) %s\n", fd, fdbg(fd))); fd->fps[fd->nfps-1].fp == fp && fd->fps[fd->nfps-1].fdno >= 0) { - fflush(fp); + (void) fflush(fp); fd->nfps--; + /*@-refcounttrans@*/ rc = ufdClose(fd); + /*@=refcounttrans@*/ +/*@-usereleased@*/ if (fdGetFdno(fd) >= 0) break; fdSetFp(fd, NULL); @@ -2352,6 +2378,7 @@ DBGIO(fd, (stderr, "==> Fclose(%p) %s\n", fd, fdbg(fd))); } fd = fdFree(fd, "Fclose"); return ec; +/*@=usereleased@*/ } /* @@ -2452,7 +2479,7 @@ fprintf(stderr, "*** Fdopen(%p,%s) %s\n", fd, fmode, fdbg(fd)); strncat(zstdio, other, sizeof(zstdio) - strlen(zstdio)); if (end == NULL && other[0] == '\0') - return fd; + /*@-refcounttrans@*/ return fd; /*@=refcounttrans@*/ if (end && *end) { if (!strcmp(end, "fdio")) { @@ -2474,14 +2501,18 @@ fprintf(stderr, "*** Fdopen(%p,%s) %s\n", fd, fmode, fdbg(fd)); if (noLibio) { int fdno = Fileno(fd); FILE * fp = fdopen(fdno, stdio); +/*@+voidabstract@*/ if (_rpmio_debug) -fprintf(stderr, "*** Fdopen fpio fp %p\n", fp); +fprintf(stderr, "*** Fdopen fpio fp %p\n", (void *)fp); +/*@=voidabstract@*/ if (fp == NULL) return NULL; /* XXX gzdio/bzdio use fp for private data */ + /*@+voidabstract@*/ if (fdGetFp(fd) == NULL) fdSetFp(fd, fp); fdPush(fd, fpio, fp, fdno); /* Push fpio onto stack */ + /*@=voidabstract@*/ } } } else if (other[0] != '\0') { @@ -2493,7 +2524,7 @@ fprintf(stderr, "*** Fdopen fpio fp %p\n", fp); } } if (iof == NULL) - return fd; + /*@-refcounttrans@*/ return fd; /*@=refcounttrans@*/ if (!noLibio) { FILE * fp = NULL; @@ -2511,15 +2542,17 @@ DBGIO(fd, (stderr, "==> fopencookie(%p,\"%s\",*%p) returns fp %p\n", fd, stdio, if (fp) { /* XXX gzdio/bzdio use fp for private data */ + /*@+voidabstract@*/ if (fdGetFp(fd) == NULL) fdSetFp(fd, fp); fdPush(fd, fpio, fp, fileno(fp)); /* Push fpio onto stack */ + /*@=voidabstract@*/ fd = fdLink(fd, "fopencookie"); } } DBGIO(fd, (stderr, "==> Fdopen(%p,\"%s\") returns fd %p %s\n", ofd, fmode, fd, fdbg(fd))); - return fd; + /*@-refcounttrans@*/ return fd; /*@=refcounttrans@*/ } FD_t Fopen(const char *path, const char *fmode) @@ -2542,7 +2575,7 @@ if (_rpmio_debug) fprintf(stderr, "*** Fopen fdio path %s fmode %s\n", path, fmode); fd = fdOpen(path, flags, perms); if (fdFileno(fd) < 0) { - fdClose(fd); + (void) fdClose(fd); return NULL; } } else if (!strcmp(end, "fadio")) { @@ -2550,7 +2583,7 @@ if (_rpmio_debug) fprintf(stderr, "*** Fopen fadio path %s fmode %s\n", path, fmode); fd = fadio->_open(path, flags, perms); if (fdFileno(fd) < 0) { - fdClose(fd); + /*@-refcounttrans@*/ (void) fdClose(fd); /*@=refcounttrans@*/ return NULL; } } else { @@ -2583,7 +2616,9 @@ 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)) { + /*@+voidabstract@*/ fdPush(fd, fpio, fp, fileno(fp)); /* Push fpio onto stack */ + /*@=voidabstract@*/ return fd; } } diff --git a/rpmio/rpmio_api.c b/rpmio/rpmio_api.c index af0afd3b9..a12899835 100644 --- a/rpmio/rpmio_api.c +++ b/rpmio/rpmio_api.c @@ -13,9 +13,12 @@ /*@access FD_t@*/ +/*@-redef@*/ +int fdFileno(void * cookie); /* Yet Another Prototype. */ int fdFileno(void * cookie) { FD_t fd; if (cookie == NULL) return -2; fd = c2f(cookie); return fd->fps[0].fdno; } +/*@=redef@*/ diff --git a/rpmio/rpmio_internal.h b/rpmio/rpmio_internal.h index 52529be56..ea7585fa2 100644 --- a/rpmio/rpmio_internal.h +++ b/rpmio/rpmio_internal.h @@ -235,7 +235,7 @@ int ufdClose( /*@only@*/ void * cookie); { if (fd->stats == NULL) return; fd->stats->ops[opx].count++; - gettimeofday(&fd->stats->begin, NULL); + (void) gettimeofday(&fd->stats->begin, NULL); } /** \ingroup rpmio @@ -259,7 +259,7 @@ int ufdClose( /*@only@*/ void * cookie); struct timeval end; if (rc == -1) fd->syserrno = errno; if (fd->stats == NULL) return; - gettimeofday(&end, NULL); + (void) gettimeofday(&end, NULL); if (rc >= 0) { switch(opx) { case FDSTAT_SEEK: diff --git a/rpmio/rpmlog.c b/rpmio/rpmlog.c index 94e4d1ecb..a7b1318c6 100644 --- a/rpmio/rpmlog.c +++ b/rpmio/rpmlog.c @@ -179,10 +179,10 @@ static void vrpmlog (unsigned code, const char *fmt, va_list ap) } if (rpmlogMsgPrefix[pri] && *rpmlogMsgPrefix[pri]) - fputs(_(rpmlogMsgPrefix[pri]), msgout); + (void) fputs(_(rpmlogMsgPrefix[pri]), msgout); - fputs(msg, msgout); - fflush(msgout); + (void) fputs(msg, msgout); + (void) fflush(msgout); if (freeMsgbuf) free(msgbuf); if (pri <= RPMLOG_CRIT) diff --git a/rpmio/rpmrpc.c b/rpmio/rpmrpc.c index abc297530..91a979ae4 100644 --- a/rpmio/rpmrpc.c +++ b/rpmio/rpmrpc.c @@ -277,79 +277,83 @@ static int is_dos_date(char *str) { if (strlen(str) == 8 && str[2] == str[5] && strchr("\\-/", (int)str[2]) != NULL) - return (1); + return 1; - return (0); + return 0; } static int -is_week (char *str, struct tm *tim) +is_week (const char * str, /*@out@*/ struct tm * tim) { - static char *week = "SunMonTueWedThuFriSat"; - char *pos; +/*@observer@*/ static const char * week = "SunMonTueWedThuFriSat"; + const char * pos; - if((pos=strstr(week, str)) != NULL){ - if(tim != NULL) + /*@-observertrans -mayaliasunique@*/ + if ((pos=strstr(week, str)) != NULL) { + /*@=observertrans =mayaliasunique@*/ + if (tim != NULL) tim->tm_wday = (pos - week)/3; - return (1); + return 1; } - return (0); + return 0; } static int -is_month (char *str, struct tm *tim) +is_month (const char * str, /*@out@*/ struct tm * tim) { - static char *month = "JanFebMarAprMayJunJulAugSepOctNovDec"; - char *pos; +/*@observer@*/ static const char * month = "JanFebMarAprMayJunJulAugSepOctNovDec"; + const char * pos; - if((pos=strstr(month, str)) != NULL){ - if(tim != NULL) + /*@-observertrans -mayaliasunique@*/ + if ((pos=strstr(month, str)) != NULL) { + /*@=observertrans -mayaliasunique@*/ + if (tim != NULL) tim->tm_mon = (pos - month)/3; - return (1); + return 1; } - return (0); + return 0; } static int -is_time (char *str, struct tm *tim) +is_time (const char * str, /*@out@*/ struct tm * tim) { - char *p, *p2; + const char * p, * p2; if ((p=strchr(str, ':')) && (p2=strrchr(str, ':'))) { if (p != p2) { if (sscanf (str, "%2d:%2d:%2d", &tim->tm_hour, &tim->tm_min, &tim->tm_sec) != 3) - return (0); + return 0; } else { if (sscanf (str, "%2d:%2d", &tim->tm_hour, &tim->tm_min) != 2) - return (0); + return 0; } } else - return (0); + return 0; - return (1); + return 1; } -static int is_year(char *str, struct tm *tim) +static int is_year(const char * str, /*@out@*/ struct tm * tim) { long year; if (strchr(str,':')) - return (0); + return 0; if (strlen(str)!=4) - return (0); + return 0; if (sscanf(str, "%ld", &year) != 1) - return (0); + return 0; if (year < 1900 || year > 3000) - return (0); + return 0; tim->tm_year = (int) (year - 1900); - return (1); + return 1; } /* @@ -361,7 +365,7 @@ static int is_year(char *str, struct tm *tim) static int vfs_parse_filetype (char c) { - switch (c){ + switch (c) { case 'd': return S_IFDIR; case 'b': return S_IFBLK; case 'c': return S_IFCHR; @@ -377,37 +381,37 @@ vfs_parse_filetype (char c) } } -static int vfs_parse_filemode (char *p) +static int vfs_parse_filemode (const char *p) { /* converts rw-rw-rw- into 0666 */ int res = 0; - switch (*(p++)){ + switch (*(p++)) { case 'r': res |= 0400; break; case '-': break; default: return -1; } - switch (*(p++)){ + switch (*(p++)) { case 'w': res |= 0200; break; case '-': break; default: return -1; } - switch (*(p++)){ + switch (*(p++)) { case 'x': res |= 0100; break; case 's': res |= 0100 | S_ISUID; break; case 'S': res |= S_ISUID; break; case '-': break; default: return -1; } - switch (*(p++)){ + switch (*(p++)) { case 'r': res |= 0040; break; case '-': break; default: return -1; } - switch (*(p++)){ + switch (*(p++)) { case 'w': res |= 0020; break; case '-': break; default: return -1; } - switch (*(p++)){ + switch (*(p++)) { case 'x': res |= 0010; break; case 's': res |= 0010 | S_ISGID; break; case 'l': /* Solaris produces these */ @@ -415,17 +419,17 @@ static int vfs_parse_filemode (char *p) case '-': break; default: return -1; } - switch (*(p++)){ + switch (*(p++)) { case 'r': res |= 0004; break; case '-': break; default: return -1; } - switch (*(p++)){ + switch (*(p++)) { case 'w': res |= 0002; break; case '-': break; default: return -1; } - switch (*(p++)){ + switch (*(p++)) { case 'x': res |= 0001; break; case 't': res |= 0001 | S_ISVTX; break; case 'T': res |= S_ISVTX; break; @@ -482,7 +486,8 @@ static int vfs_parse_filedate(int idx, time_t *t) if (is_dos_date(p)){ p[2] = p[5] = '-'; - if(sscanf(p, "%2d-%2d-%2d", &d[0], &d[1], &d[2]) == 3){ + memset(d, 0, sizeof(d)); + if (sscanf(p, "%2d-%2d-%2d", &d[0], &d[1], &d[2]) == 3){ /* We expect to get: 1. MM-DD-YY 2. DD-MM-YY @@ -540,7 +545,9 @@ static int vfs_parse_filedate(int idx, time_t *t) } static int -vfs_parse_ls_lga (char *p, struct stat *st, char **filename, char **linkname) +vfs_parse_ls_lga (char * p, /*@out@*/ struct stat * st, + /*@out@*/ const char ** filename, + /*@out@*/ const char ** linkname) { int idx, idx2, num_cols; int i; @@ -563,11 +570,13 @@ vfs_parse_ls_lga (char *p, struct stat *st, char **filename, char **linkname) if (strlen (p) <= 8 || p [8] != ']') goto error; /* Should parse here the Notwell permissions :) */ + /*@-unrecog@*/ if (S_ISDIR (st->st_mode)) st->st_mode |= (S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR | S_IXUSR | S_IXGRP | S_IXOTH); else st->st_mode |= (S_IRUSR | S_IRGRP | S_IROTH | S_IWUSR); p += 9; + /*@=unrecog@*/ } else { if ((i = vfs_parse_filemode(p)) == -1) goto error; @@ -591,7 +600,7 @@ vfs_parse_ls_lga (char *p, struct stat *st, char **filename, char **linkname) #ifdef HACK st->st_uid = finduid (columns [1]); #else - unameToUid (columns [1], &st->st_uid); + (void) unameToUid (columns [1], &st->st_uid); #endif else st->st_uid = (uid_t) atol (columns [1]); @@ -615,7 +624,7 @@ vfs_parse_ls_lga (char *p, struct stat *st, char **filename, char **linkname) #ifdef HACK st->st_gid = findgid (columns [2]); #else - gnameToGid (columns [1], &st->st_gid); + (void) gnameToGid (columns [1], &st->st_gid); #endif idx2 = 3; } @@ -731,7 +740,9 @@ error: } #endif + /*@-usereleased@*/ if (p_copy != p) /* Carefull! */ + /*@=usereleased@*/ g_free (p_copy); return 0; } @@ -749,7 +760,7 @@ static /*@only@*/ char * ftpBuf = NULL; #define alloca_strdup(_s) strcpy(alloca(strlen(_s)+1), (_s)) static int ftpNLST(const char * url, ftpSysCall_t ftpSysCall, - struct stat * st, char * rlbuf, size_t rlbufsiz) + /*@out@*/ struct stat * st, char * rlbuf, size_t rlbufsiz) { FD_t fd; const char * path; @@ -916,16 +927,16 @@ static int ftpNLST(const char * url, ftpSysCall_t ftpSysCall, } exit: - ufdClose(fd); + (void) ufdClose(fd); return rc; } -static int ftpStat(const char * path, struct stat *st) +static int ftpStat(const char * path, /*@out@*/ struct stat *st) { return ftpNLST(path, DO_FTP_STAT, st, NULL, 0); } -static int ftpLstat(const char * path, struct stat *st) { +static int ftpLstat(const char * path, /*@out@*/ struct stat *st) { int rc; rc = ftpNLST(path, DO_FTP_LSTAT, st, NULL, 0); if (_rpmio_debug) @@ -938,15 +949,18 @@ static int ftpReadlink(const char * path, char * buf, size_t bufsiz) { } static int ftpGlob(const char * path, int flags, - int errfunc(const char * epath, int eerno), glob_t * pglob) + int errfunc(const char * epath, int eerno), + /*@out@*/ glob_t * pglob) { int rc; if (pglob == NULL) return -2; rc = ftpNLST(path, DO_FTP_GLOB, NULL, NULL, 0); +/*@-castfcnptr@*/ if (_rpmio_debug) -fprintf(stderr, "*** ftpGlob(%s,0x%x,%p,%p) ftpNLST rc %d\n", path, (unsigned)flags, errfunc, pglob, rc); +fprintf(stderr, "*** ftpGlob(%s,0x%x,%p,%p) ftpNLST rc %d\n", path, (unsigned)flags, (void *)errfunc, pglob, rc); +/*@=castfcnptr@*/ if (rc) return rc; rc = poptParseArgvString(ftpBuf, &pglob->gl_pathc, (const char ***)&pglob->gl_pathv); @@ -957,8 +971,10 @@ fprintf(stderr, "*** ftpGlob(%s,0x%x,%p,%p) ftpNLST rc %d\n", path, (unsigned)fl static void ftpGlobfree(glob_t * pglob) { if (_rpmio_debug) fprintf(stderr, "*** ftpGlobfree(%p)\n", pglob); - if (pglob->gl_offs == -1) /* XXX HACK HACK HACK */ + if (pglob->gl_offs == -1) { /* XXX HACK HACK HACK */ free((void *)pglob->gl_pathv); + pglob->gl_pathv = NULL; + } } int Stat(const char * path, struct stat * st) { @@ -1059,8 +1075,10 @@ int Glob(const char *path, int flags, const char * lpath; int ut = urlPath(path, &lpath); +/*@-castfcnptr@*/ if (_rpmio_debug) -fprintf(stderr, "*** Glob(%s,0x%x,%p,%p)\n", path, (unsigned)flags, errfunc, pglob); +fprintf(stderr, "*** Glob(%s,0x%x,%p,%p)\n", path, (unsigned)flags, (void *)errfunc, pglob); +/*@=castfcnptr@*/ switch (ut) { case URL_IS_FTP: /* XXX WRONG WRONG WRONG */ return ftpGlob(path, flags, errfunc, pglob); @@ -1112,16 +1130,18 @@ fprintf(stderr, "*** Opendir(%s)\n", path); return opendir(path); } +/*@+voidabstract@*/ struct dirent * Readdir(DIR * dir) { if (_rpmio_debug) -fprintf(stderr, "*** Readdir(%p)\n", dir); +fprintf(stderr, "*** Readdir(%p)\n", (void *)dir); return readdir(dir); } int Closedir(DIR * dir) { if (_rpmio_debug) -fprintf(stderr, "*** Closedir(%p)\n", dir); +fprintf(stderr, "*** Closedir(%p)\n", (void *)dir); return closedir(dir); } +/*@=voidabstract@*/ diff --git a/rpmio/url.c b/rpmio/url.c index 1d4d46905..a6b4e30da 100644 --- a/rpmio/url.c +++ b/rpmio/url.c @@ -78,11 +78,11 @@ URLDBGREFS(0, (stderr, "--> url %p -- %d %s at %s:%u\n", u, u->nrefs, msg, file, void * fp = fdGetFp(u->ctrl); if (fp) { fdPush(u->ctrl, fpio, fp, -1); /* Push fpio onto stack */ - Fclose(u->ctrl); + (void) Fclose(u->ctrl); } else if (fdio->_fileno(u->ctrl) >= 0) fdio->close(u->ctrl); #else - Fclose(u->ctrl); + (void) Fclose(u->ctrl); #endif u->ctrl = fdio->_fdderef(u->ctrl, "persist ctrl (urlFree)", file, line); @@ -97,11 +97,11 @@ URLDBGREFS(0, (stderr, "--> url %p -- %d %s at %s:%u\n", u, u->nrefs, msg, file, void * fp = fdGetFp(u->data); if (fp) { fdPush(u->data, fpio, fp, -1); /* Push fpio onto stack */ - Fclose(u->data); + (void) Fclose(u->data); } else if (fdio->_fileno(u->data) >= 0) fdio->close(u->data); #else - Fclose(u->ctrl); + (void) Fclose(u->ctrl); #endif u->data = fdio->_fdderef(u->data, "persist data (urlFree)", file, line); @@ -209,11 +209,16 @@ static void urlFind(urlinfo *uret, int mustAsk) u = urlLink(uCache[ucx], "uCache"); *uret = u; + /*@-usereleased@*/ u = urlFree(u, "uCache (urlFind)"); + /*@=usereleased@*/ /* Zap proxy host and port in case they have been reset */ u->proxyp = -1; - if (u->proxyh) free((void *)u->proxyh); + if (u->proxyh) { + free((void *)u->proxyh); + u->proxyh = NULL; + } /* Perform one-time FTP initialization */ if (u->urltype == URL_IS_FTP) { @@ -478,9 +483,9 @@ fprintf(stderr, "*** urlGetFile sfd %p %s tfd %p %s\n", sfd, url, tfd, dest); case URL_IS_DASH: case URL_IS_UNKNOWN: if ((rc = ufdGetFile(sfd, tfd))) { - Unlink(dest); + (void) Unlink(dest); /* XXX FIXME: sfd possibly closed by copyData */ - /*@-usereleased@*/ Fclose(sfd) /*@=usereleased@*/ ; + /*@-usereleased@*/ (void) Fclose(sfd) /*@=usereleased@*/ ; } sfd = NULL; /* XXX Fclose(sfd) done by ufdGetFile */ break; @@ -491,9 +496,9 @@ fprintf(stderr, "*** urlGetFile sfd %p %s tfd %p %s\n", sfd, url, tfd, dest); exit: if (tfd) - Fclose(tfd); + (void) Fclose(tfd); if (sfd) - Fclose(sfd); + (void) Fclose(sfd); return rc; } @@ -1557,7 +1557,9 @@ int main(int argc, const char ** argv) } +#if defined(IAM_RPMBT) || defined(IAM_RPMK) exit: +#endif /* IAM_RPMBT || IAM_RPMK */ poptFreeContext(optCon); rpmFreeMacros(NULL); rpmFreeMacros(&rpmCLIMacroContext); |