diff options
author | jbj <devnull@localhost> | 2002-06-20 17:17:23 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2002-06-20 17:17:23 +0000 |
commit | 110df96c22325d96559d5d66a89308c1fc708f9c (patch) | |
tree | 2b958de776db8165f751da68a303c54c0560fef0 /rpmdb | |
parent | be2a538537041702617102a5a26cf00f1fcf9578 (diff) | |
download | rpm-110df96c22325d96559d5d66a89308c1fc708f9c.tar.gz rpm-110df96c22325d96559d5d66a89308c1fc708f9c.tar.bz2 rpm-110df96c22325d96559d5d66a89308c1fc708f9c.zip |
- add translated man pages from PLD.
CVS patchset: 5514
CVS date: 2002/06/20 17:17:23
Diffstat (limited to 'rpmdb')
-rw-r--r-- | rpmdb/legacy.c | 28 | ||||
-rw-r--r-- | rpmdb/legacy.h | 4 |
2 files changed, 21 insertions, 11 deletions
diff --git a/rpmdb/legacy.c b/rpmdb/legacy.c index 1607b452f..2afb5df45 100644 --- a/rpmdb/legacy.c +++ b/rpmdb/legacy.c @@ -5,6 +5,9 @@ #include "system.h" #if HAVE_LIBELF_GELF_H +#define __LIBELF_INTERNAL__ 1 +# undef __P +# define __P(protos) protos #include <gelf.h> #define DT_GNU_PRELINKED 0x6ffffdf5 #endif @@ -23,12 +26,15 @@ * @param path file path * @retval pidp prelink helper pid or 0 * @retval fsizep file size - * @return -1 on error, otherwise open file descriptor + * @return -1 on error, otherwise, an open file descriptor */ static int open_dso(const char * path, /*@null@*/ pid_t * pidp, /*@null@*/ size_t *fsizep) - /*@globals rpmGlobalMacroContext, fileSystem @*/ - /*@modifies *pidp, *fsizep, rpmGlobalMacroContext, fileSystem @*/ + /*@globals rpmGlobalMacroContext, + fileSystem, internalState @*/ + /*@modifies *pidp, *fsizep, rpmGlobalMacroContext, + fileSystem, internalState @*/ { +/*@only@*/ static const char * cmd = NULL; static int initted = 0; pid_t pid; @@ -64,7 +70,7 @@ static int open_dso(const char * path, /*@null@*/ pid_t * pidp, /*@null@*/ size_ GElf_Dyn dyn; int bingo; - elf_version(EV_CURRENT); + (void) elf_version(EV_CURRENT); if ((elf = elf_begin (fdno, ELF_C_READ, NULL)) == NULL || elf_kind(elf) != ELF_K_ELF @@ -73,8 +79,9 @@ static int open_dso(const char * path, /*@null@*/ pid_t * pidp, /*@null@*/ size_ goto exit; bingo = 0; + /*@-branchstate -uniondef @*/ while (!bingo && (scn = elf_nextscn(elf, scn)) != NULL) { - gelf_getshdr(scn, &shdr); + (void) gelf_getshdr(scn, &shdr); if (shdr.sh_type != SHT_DYNAMIC) continue; while (!bingo && (data = elf_getdata (scn, data)) != NULL) { @@ -82,16 +89,17 @@ static int open_dso(const char * path, /*@null@*/ pid_t * pidp, /*@null@*/ size_ int ndx; for (ndx = 0; ndx < maxndx; ++ndx) { - gelf_getdyn (data, ndx, &dyn); + (void) gelf_getdyn (data, ndx, &dyn); if (dyn.d_tag != DT_GNU_PRELINKED) - continue; + /*@innercontinue@*/ continue; bingo = 1; - break; + /*@innerbreak@*/ break; } } } + /*@=branchstate =uniondef @*/ - if (bingo) { + if (pidp != NULL && bingo) { int pipes[2]; int xx; @@ -138,7 +146,9 @@ int domd5(const char * fn, unsigned char * digest, int asAscii, size_t *fsizep) int fdno; int xx; +/*@-globs -internalglobs -mods @*/ fdno = open_dso(path, &pid, &fsize); +/*@=globs =internalglobs =mods @*/ if (fdno < 0) { rc = 1; goto exit; diff --git a/rpmdb/legacy.h b/rpmdb/legacy.h index fcf4e7c85..69ade41cf 100644 --- a/rpmdb/legacy.h +++ b/rpmdb/legacy.h @@ -27,8 +27,8 @@ extern "C" { */ int domd5(const char * fn, /*@out@*/ unsigned char * digest, int asAscii, /*@null@*/ /*@out@*/ size_t *fsizep) - /*@globals fileSystem@*/ - /*@modifies digest, fileSystem @*/; + /*@globals fileSystem @*/ + /*@modifies digest, *fsizep, fileSystem @*/; /** * Convert absolute path tag to (dirname,basename,dirindex) tags. |