summaryrefslogtreecommitdiff
path: root/rpmio
diff options
context:
space:
mode:
Diffstat (limited to 'rpmio')
-rw-r--r--rpmio/macro.c16
-rw-r--r--rpmio/rpmio.c194
-rw-r--r--rpmio/rpmio.h24
-rw-r--r--rpmio/rpmio_internal.h11
-rw-r--r--rpmio/rpmlog.h2
-rw-r--r--rpmio/rpmmacro.h28
-rw-r--r--rpmio/rpmpgp.h2
-rw-r--r--rpmio/rpmrpc.c26
-rw-r--r--rpmio/rpmurl.h4
-rw-r--r--rpmio/url.c2
10 files changed, 113 insertions, 196 deletions
diff --git a/rpmio/macro.c b/rpmio/macro.c
index cfa7c3351..27f6415e6 100644
--- a/rpmio/macro.c
+++ b/rpmio/macro.c
@@ -114,7 +114,7 @@ int print_expand_trace = 0;
/* forward ref */
static int expandMacro(MacroBuf mb)
/*@globals rpmGlobalMacroContext,
- print_macro_trace, print_expand_trace, fileSystem @*/
+ print_macro_trace, print_expand_trace, h_errno, fileSystem @*/
/*@modifies mb, rpmGlobalMacroContext,
print_macro_trace, print_expand_trace, fileSystem @*/;
@@ -492,7 +492,7 @@ printExpansion(MacroBuf mb, const char * t, const char * te)
*/
static int
expandT(MacroBuf mb, const char * f, size_t flen)
- /*@globals rpmGlobalMacroContext, fileSystem@*/
+ /*@globals rpmGlobalMacroContext, h_errno, fileSystem@*/
/*@modifies mb, rpmGlobalMacroContext, fileSystem @*/
{
char *sbuf;
@@ -546,7 +546,7 @@ expandS(MacroBuf mb, char * tbuf, size_t tbuflen)
/*@-boundswrite@*/
static int
expandU(MacroBuf mb, char * u, size_t ulen)
- /*@globals rpmGlobalMacroContext, fileSystem@*/
+ /*@globals rpmGlobalMacroContext, h_errno, fileSystem@*/
/*@modifies mb, *u, rpmGlobalMacroContext, fileSystem @*/
{
const char *s = mb->s;
@@ -585,7 +585,7 @@ expandU(MacroBuf mb, char * u, size_t ulen)
/*@-boundswrite@*/
static int
doShellEscape(MacroBuf mb, const char * cmd, size_t clen)
- /*@globals rpmGlobalMacroContext, fileSystem @*/
+ /*@globals rpmGlobalMacroContext, h_errno, fileSystem @*/
/*@modifies mb, rpmGlobalMacroContext, fileSystem @*/
{
char pcmd[BUFSIZ];
@@ -624,7 +624,7 @@ doShellEscape(MacroBuf mb, const char * cmd, size_t clen)
*/
/*@dependent@*/ static const char *
doDefine(MacroBuf mb, /*@returned@*/ const char * se, int level, int expandbody)
- /*@globals rpmGlobalMacroContext @*/
+ /*@globals rpmGlobalMacroContext, h_errno @*/
/*@modifies mb, rpmGlobalMacroContext @*/
{
const char *s = se;
@@ -1032,7 +1032,7 @@ grabArgs(MacroBuf mb, const MacroEntry me, /*@returned@*/ const char * se, char
*/
static void
doOutput(MacroBuf mb, int waserror, const char * msg, size_t msglen)
- /*@globals rpmGlobalMacroContext, fileSystem @*/
+ /*@globals rpmGlobalMacroContext, h_errno, fileSystem @*/
/*@modifies mb, rpmGlobalMacroContext, fileSystem @*/
{
char buf[BUFSIZ];
@@ -1058,7 +1058,7 @@ doOutput(MacroBuf mb, int waserror, const char * msg, size_t msglen)
static void
doFoo(MacroBuf mb, int negate, const char * f, size_t fn,
/*@null@*/ const char * g, size_t gn)
- /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
+ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies mb, rpmGlobalMacroContext, fileSystem, internalState @*/
{
char buf[BUFSIZ], *b = NULL, *be;
@@ -1160,7 +1160,7 @@ doFoo(MacroBuf mb, int negate, const char * f, size_t fn,
static int
expandMacro(MacroBuf mb)
/*@globals rpmGlobalMacroContext,
- print_macro_trace, print_expand_trace, fileSystem @*/
+ print_macro_trace, print_expand_trace, h_errno, fileSystem @*/
/*@modifies mb, rpmGlobalMacroContext,
print_macro_trace, print_expand_trace, fileSystem @*/
{
diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c
index 8d80138a8..b4a027fe8 100644
--- a/rpmio/rpmio.c
+++ b/rpmio/rpmio.c
@@ -1,4 +1,3 @@
-/*@-type@*/ /* LCL: function typedefs */
/** \ingroup rpmio
* \file rpmio/rpmio.c
*/
@@ -15,18 +14,6 @@
#if HAVE_NETINET_IN_SYSTM_H
# include <sys/types.h>
-
-#if defined(__LCLINT__)
-/*@-redef@*/ /* FIX: rpmdb/db3.c also declares */
-typedef unsigned int u_int32_t;
-typedef unsigned short u_int16_t;
-typedef unsigned char u_int8_t;
-/*@-incondefs@*/ /* LCLint 3.0.0.15 */
-typedef int int32_t;
-/*@=incondefs@*/
-/*@=redef@*/
-#endif
-
# include <netinet/in_systm.h>
#endif
@@ -34,7 +21,8 @@ typedef int int32_t;
#define _USE_LIBIO 1
#endif
-#if !defined(HAVE_HERRNO) && defined(__hpux) /* XXX HP-UX w/o -D_XOPEN_SOURCE needs */
+/* XXX HP-UX w/o -D_XOPEN_SOURCE needs */
+#if !defined(HAVE_HERRNO) && (defined(__hpux) || defined(__LCLINT__))
/*@unchecked@*/
extern int h_errno;
#endif
@@ -67,15 +55,20 @@ static int inet_aton(const char *cp, struct in_addr *inp)
#include <rpmio_internal.h>
#undef fdFileno
#undef fdOpen
+#define fdOpen __fdOpen
#undef fdRead
+#define fdRead __fdRead
#undef fdWrite
+#define fdWrite __fdWrite
#undef fdClose
+#define fdClose __fdClose
#include "ugid.h"
#include "rpmmessages.h"
#include "debug.h"
+/*@access FILE @*/ /* XXX to permit comparison/conversion with void *. */
/*@access urlinfo @*/
/*@access FDSTAT_t @*/
@@ -138,7 +131,6 @@ _free(/*@only@*/ /*@null@*/ /*@out@*/ const void * p)
/* =============================================================== */
/*@-boundswrite@*/
-/*@-modfilesys@*/
static /*@observer@*/ const char * fdbg(/*@null@*/ FD_t fd)
/*@*/
{
@@ -176,8 +168,6 @@ static /*@observer@*/ const char * fdbg(/*@null@*/ FD_t fd)
sprintf(be, "FD %d fp %p", fps->fdno, fps->fp);
} else if (fps->io == ufdio) {
sprintf(be, "UFD %d fp %p", fps->fdno, fps->fp);
- } else if (fps->io == fadio) {
- sprintf(be, "FAD %d fp %p", fps->fdno, fps->fp);
} else if (fps->io == gzdio) {
sprintf(be, "GZD %p fdno %d", fps->fp, fps->fdno);
#if HAVE_BZLIB_H
@@ -199,7 +189,6 @@ static /*@observer@*/ const char * fdbg(/*@null@*/ FD_t fd)
}
return buf;
}
-/*@=modfilesys@*/
/*@=boundswrite@*/
/* =============================================================== */
@@ -237,9 +226,7 @@ FD_t fdDup(int fdno)
return NULL;
fd = fdNew("open (fdDup)");
fdSetFdno(fd, nfdno);
-/*@-modfilesys@*/
DBGIO(fd, (stderr, "==> fdDup(%d) fd %p %s\n", fdno, (fd ? fd : NULL), fdbg(fd)));
-/*@=modfilesys@*/
/*@-refcounttrans@*/ return fd; /*@=refcounttrans@*/
}
@@ -263,16 +250,13 @@ FILE *fdFdopen(void * cookie, const char *fmode)
fdno = fdFileno(fd);
if (fdno < 0) return NULL;
fp = fdopen(fdno, fmode);
-/*@-modfilesys@*/
DBGIO(fd, (stderr, "==> fdFdopen(%p,\"%s\") fdno %d -> fp %p fdno %d\n", cookie, fmode, fdno, fp, fileno(fp)));
-/*@=modfilesys@*/
fd = fdFree(fd, "open (fdFdopen)");
return fp;
}
#endif
/* =============================================================== */
-/*@-modfilesys@*/
/*@-mustmod@*/ /* FIX: cookie is modified */
static inline /*@null@*/ FD_t XfdLink(void * cookie, const char * msg,
const char * file, unsigned line)
@@ -291,9 +275,7 @@ DBGREFS(fd, (stderr, "--> fd %p ++ %d %s at %s:%u %s\n", fd, fd->nrefs, msg, fi
return fd;
}
/*@=mustmod@*/
-/*@=modfilesys@*/
-/*@-modfilesys@*/
static inline /*@null@*/
FD_t XfdFree( /*@killref@*/ FD_t fd, const char *msg,
const char *file, unsigned line)
@@ -321,7 +303,6 @@ DBGREFS(fd, (stderr, "--> fd %p -- %d %s at %s:%u %s\n", fd, fd->nrefs, msg, fi
}
return NULL;
}
-/*@=modfilesys@*/
static inline /*@null@*/
FD_t XfdNew(const char * msg, const char * file, unsigned line)
@@ -339,9 +320,7 @@ FD_t XfdNew(const char * msg, const char * file, unsigned line)
fd->nfps = 0;
memset(fd->fps, 0, sizeof(fd->fps));
- /*@-assignexpose@*/
fd->fps[0].io = fdio;
- /*@=assignexpose@*/
fd->fps[0].fp = NULL;
fd->fps[0].fdno = -1;
@@ -364,9 +343,11 @@ FD_t XfdNew(const char * msg, const char * file, unsigned line)
return XfdLink(fd, msg, file, line);
}
-/*@-redef@*/ /* FIX: legacy API should be made static */
-ssize_t fdRead(void * cookie, /*@out@*/ char * buf, size_t count)
-/*@=redef@*/
+static ssize_t fdRead(void * cookie, /*@out@*/ char * buf, size_t count)
+ /*@globals errno, fileSystem, internalState @*/
+ /*@modifies *buf, errno, fileSystem, internalState @*/
+ /*@requires maxSet(buf) >= (count - 1) @*/
+ /*@ensures maxRead(buf) == result @*/
{
FD_t fd = c2f(cookie);
ssize_t rc;
@@ -381,16 +362,14 @@ ssize_t fdRead(void * cookie, /*@out@*/ char * buf, size_t count)
if (fd->ndigests && rc > 0) fdUpdateDigests(fd, buf, rc);
-/*@-modfilesys@*/
DBGIO(fd, (stderr, "==>\tfdRead(%p,%p,%ld) rc %ld %s\n", cookie, buf, (long)count, (long)rc, fdbg(fd)));
-/*@=modfilesys@*/
return rc;
}
-/*@-redef@*/ /* FIX: legacy API should be made static */
-ssize_t fdWrite(void * cookie, const char * buf, size_t count)
-/*@=redef@*/
+static ssize_t fdWrite(void * cookie, const char * buf, size_t count)
+ /*@globals errno, fileSystem, internalState @*/
+ /*@modifies errno, fileSystem, internalState @*/
{
FD_t fd = c2f(cookie);
int fdno = fdFileno(fd);
@@ -422,9 +401,7 @@ ssize_t fdWrite(void * cookie, const char * buf, size_t count)
if (ec == -1) fd->syserrno = errno;
}
-/*@-modfilesys@*/
DBGIO(fd, (stderr, "==>\tfdWrite(%p,%p,%ld) rc %ld %s\n", cookie, buf, (long)count, (long)rc, fdbg(fd)));
-/*@=modfilesys@*/
return rc;
}
@@ -446,16 +423,14 @@ static inline int fdSeek(void * cookie, _libio_pos_t pos, int whence)
rc = lseek(fdFileno(fd), p, whence);
fdstat_exit(fd, FDSTAT_SEEK, rc);
-/*@-modfilesys@*/
DBGIO(fd, (stderr, "==>\tfdSeek(%p,%ld,%d) rc %lx %s\n", cookie, (long)p, whence, (unsigned long)rc, fdbg(fd)));
-/*@=modfilesys@*/
return rc;
}
-/*@-redef@*/ /* FIX: legacy API should be made static */
-int fdClose( /*@only@*/ void * cookie)
-/*@=redef@*/
+static int fdClose( /*@only@*/ void * cookie)
+ /*@globals errno, fileSystem, systemState, internalState @*/
+ /*@modifies errno, fileSystem, systemState, internalState @*/
{
FD_t fd;
int fdno;
@@ -471,17 +446,15 @@ int fdClose( /*@only@*/ void * cookie)
rc = ((fdno >= 0) ? close(fdno) : -2);
fdstat_exit(fd, FDSTAT_CLOSE, rc);
-/*@-modfilesys@*/
DBGIO(fd, (stderr, "==>\tfdClose(%p) rc %lx %s\n", (fd ? fd : NULL), (unsigned long)rc, fdbg(fd)));
-/*@=modfilesys@*/
fd = fdFree(fd, "open (fdClose)");
return rc;
}
-/*@-redef@*/ /* FIX: legacy API should be made static */
-/*@null@*/ FD_t fdOpen(const char *path, int flags, mode_t mode)
-/*@=redef@*/
+/*@null@*/ static FD_t fdOpen(const char *path, int flags, mode_t mode)
+ /*@globals errno, fileSystem, internalState @*/
+ /*@modifies errno, fileSystem, internalState @*/
{
FD_t fd;
int fdno;
@@ -495,22 +468,18 @@ DBGIO(fd, (stderr, "==>\tfdClose(%p) rc %lx %s\n", (fd ? fd : NULL), (unsigned l
fd = fdNew("open (fdOpen)");
fdSetFdno(fd, fdno);
fd->flags = flags;
-/*@-modfilesys@*/
DBGIO(fd, (stderr, "==>\tfdOpen(\"%s\",%x,0%o) %s\n", path, (unsigned)flags, (unsigned)mode, fdbg(fd)));
-/*@=modfilesys@*/
/*@-refcounttrans@*/ return fd; /*@=refcounttrans@*/
}
+/*@-type@*/ /* LCL: function typedefs */
static struct FDIO_s fdio_s = {
fdRead, fdWrite, fdSeek, fdClose, XfdLink, XfdFree, XfdNew, fdFileno,
fdOpen, NULL, fdGetFp, NULL, mkdir, chdir, rmdir, rename, unlink
};
+/*@=type@*/
FDIO_t fdio = /*@-compmempass@*/ &fdio_s /*@=compmempass@*/ ;
-/*@-redef@*/ /* see lib/falloc.c */
-FDIO_t fadio; /* XXX usually NULL, filled in when linked with rpm */
-/*@=redef@*/
-
int fdWritable(FD_t fd, int secs)
{
int fdno;
@@ -726,21 +695,18 @@ const char *urlStrerror(const char *url)
#if !defined(USE_ALT_DNS) || !USE_ALT_DNS
static int mygethostbyname(const char * host,
/*@out@*/ struct in_addr * address)
+ /*@globals h_errno @*/
/*@modifies *address @*/
{
struct hostent * hostinfo;
- /*@-unrecog -multithreaded @*/
- /*@-globs@*/ /* FIX: h_errno access */
+ /*@-multithreaded @*/
hostinfo = gethostbyname(host);
- /*@=globs@*/
- /*@=unrecog =multithreaded @*/
+ /*@=multithreaded @*/
if (!hostinfo) return 1;
/*@-boundswrite@*/
- /*@-nullderef@*/
memcpy(address, hostinfo->h_addr_list[0], sizeof(*address));
- /*@=nullderef@*/
/*@=boundswrite@*/
return 0;
}
@@ -749,29 +715,27 @@ static int mygethostbyname(const char * host,
/*@-boundsread@*/
/*@-compdef@*/ /* FIX: address->s_addr undefined. */
static int getHostAddress(const char * host, /*@out@*/ struct in_addr * address)
- /*@globals errno @*/
+ /*@globals errno, h_errno @*/
/*@modifies *address, errno @*/
{
#if 0 /* XXX workaround nss_foo module hand-off using valgrind. */
if (!strcmp(host, "localhost")) {
- /*@-unrecog -moduncon @*/
+ /*@-moduncon @*/
if (!inet_aton("127.0.0.1", address))
return FTPERR_BAD_HOST_ADDR;
- /*@=unrecog =moduncon @*/
+ /*@=moduncon @*/
} else
#endif
if (xisdigit(host[0])) {
- /*@-unrecog -moduncon @*/
+ /*@-moduncon @*/
if (!inet_aton(host, address))
return FTPERR_BAD_HOST_ADDR;
- /*@=unrecog =moduncon @*/
+ /*@=moduncon @*/
} else {
- /*@-globs@*/ /* FIX: h_errno access */
if (mygethostbyname(host, address)) {
- errno = /*@-unrecog@*/ h_errno /*@=unrecog@*/;
+ errno = h_errno;
return FTPERR_BAD_HOSTNAME;
}
- /*@=globs@*/
}
return 0;
@@ -780,7 +744,7 @@ static int getHostAddress(const char * host, /*@out@*/ struct in_addr * address)
/*@=boundsread@*/
static int tcpConnect(FD_t ctrl, const char * host, int port)
- /*@globals fileSystem, internalState @*/
+ /*@globals h_errno, fileSystem, internalState @*/
/*@modifies ctrl, fileSystem, internalState @*/
{
struct sockaddr_in sin;
@@ -1065,7 +1029,7 @@ fprintf(stderr, "-> %s", t);
}
static int ftpLogin(urlinfo u)
- /*@globals fileSystem, internalState @*/
+ /*@globals h_errno, fileSystem, internalState @*/
/*@modifies u, fileSystem, internalState @*/
{
const char * host;
@@ -1355,10 +1319,8 @@ int ufdCopy(FD_t sfd, FD_t tfd)
}
}
-/*@-modfilesys@*/
DBGIO(sfd, (stderr, "++ copied %d bytes: %s\n", itemsCopied,
ftpStrerror(rc)));
-/*@=modfilesys@*/
if (urlNotify) {
/*@-boundsread@*/
@@ -1373,7 +1335,7 @@ int ufdCopy(FD_t sfd, FD_t tfd)
}
static int urlConnect(const char * url, /*@out@*/ urlinfo * uret)
- /*@globals fileSystem, internalState @*/
+ /*@globals h_errno, fileSystem, internalState @*/
/*@modifies *uret, fileSystem, internalState @*/
{
urlinfo u;
@@ -1480,9 +1442,7 @@ static int ftpAbort(urlinfo u, FD_t data)
}
ctrl = u->ctrl;
-/*@-modfilesys@*/
DBGIO(0, (stderr, "-> ABOR\n"));
-/*@=modfilesys@*/
/*@-usereleased -compdef@*/
if (send(fdFileno(ctrl), ipbuf, sizeof(ipbuf), MSG_OOB) != sizeof(ipbuf)) {
@@ -1569,7 +1529,7 @@ fprintf(stderr, "*** httpResp: rc %d ec %d\n", rc, ec);
}
static int httpReq(FD_t ctrl, const char * httpCmd, const char * httpArg)
- /*@globals fileSystem, internalState @*/
+ /*@globals h_errno, fileSystem, internalState @*/
/*@modifies ctrl, fileSystem, internalState @*/
{
urlinfo u = ctrl->url;
@@ -2013,7 +1973,7 @@ exit:
/*@-nullstate@*/ /* FIX: u->{ctrl,data}->url undef after XurlLink. */
static /*@null@*/ FD_t httpOpen(const char * url, /*@unused@*/ int flags,
/*@unused@*/ mode_t mode, /*@out@*/ urlinfo * uret)
- /*@globals internalState @*/
+ /*@globals h_errno, internalState @*/
/*@modifies *uret, internalState @*/
{
urlinfo u = NULL;
@@ -2059,7 +2019,7 @@ exit:
/*@=nullstate@*/
static /*@null@*/ FD_t ufdOpen(const char * url, int flags, mode_t mode)
- /*@globals fileSystem, internalState @*/
+ /*@globals h_errno, fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/
{
FD_t fd = NULL;
@@ -2142,16 +2102,16 @@ fprintf(stderr, "*** ufdOpen(%s,0x%x,0%o)\n", url, (unsigned)flags, (unsigned)mo
(void) ufdClose(fd);
return NULL;
}
-/*@-modfilesys@*/
DBGIO(fd, (stderr, "==>\tufdOpen(\"%s\",%x,0%o) %s\n", url, (unsigned)flags, (unsigned)mode, fdbg(fd)));
-/*@=modfilesys@*/
return fd;
}
+/*@-type@*/ /* LCL: function typedefs */
static struct FDIO_s ufdio_s = {
ufdRead, ufdWrite, ufdSeek, ufdClose, XfdLink, XfdFree, XfdNew, fdFileno,
ufdOpen, NULL, fdGetFp, NULL, Mkdir, Chdir, Rmdir, Rename, Unlink
};
+/*@=type@*/
FDIO_t ufdio = /*@-compmempass@*/ &ufdio_s /*@=compmempass@*/ ;
/* =============================================================== */
@@ -2190,26 +2150,23 @@ FD_t gzdOpen(const char * path, const char * fmode)
/*@modifies fileSystem, internalState @*/
{
FD_t fd;
- gzFile *gzfile;
+ gzFile gzfile;
if ((gzfile = gzopen(path, fmode)) == NULL)
return NULL;
fd = fdNew("open (gzdOpen)");
fdPop(fd); fdPush(fd, gzdio, gzfile, -1);
-/*@-modfilesys@*/
DBGIO(fd, (stderr, "==>\tgzdOpen(\"%s\", \"%s\") fd %p %s\n", path, fmode, (fd ? fd : NULL), fdbg(fd)));
-/*@=modfilesys@*/
return fdLink(fd, "gzdOpen");
}
-/*@-globuse@*/
static /*@null@*/ FD_t gzdFdopen(void * cookie, const char *fmode)
/*@globals fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/
{
FD_t fd = c2f(cookie);
int fdno;
- gzFile *gzfile;
+ gzFile gzfile;
if (fmode == NULL) return NULL;
fdno = fdFileno(fd);
@@ -2222,28 +2179,24 @@ static /*@null@*/ FD_t gzdFdopen(void * cookie, const char *fmode)
return fdLink(fd, "gzdFdopen");
}
-/*@=globuse@*/
-/*@-globuse@*/
static int gzdFlush(FD_t fd)
/*@globals fileSystem @*/
/*@modifies fileSystem @*/
{
- gzFile *gzfile;
+ gzFile gzfile;
gzfile = gzdFileno(fd);
if (gzfile == NULL) return -2;
return gzflush(gzfile, Z_SYNC_FLUSH); /* XXX W2DO? */
}
-/*@=globuse@*/
/* =============================================================== */
-/*@-mustmod@*/ /* LCL: *buf is modified */
static ssize_t gzdRead(void * cookie, /*@out@*/ char * buf, size_t count)
/*@globals fileSystem, internalState @*/
/*@modifies *buf, fileSystem, internalState @*/
{
FD_t fd = c2f(cookie);
- gzFile *gzfile;
+ gzFile gzfile;
ssize_t rc;
if (fd == NULL || fd->bytesRemain == 0) return 0; /* XXX simulate EOF */
@@ -2252,12 +2205,8 @@ static ssize_t gzdRead(void * cookie, /*@out@*/ char * buf, size_t count)
if (gzfile == NULL) return -2; /* XXX can't happen */
fdstat_enter(fd, FDSTAT_READ);
- /*@-compdef@*/ /* LCL: *buf is undefined */
rc = gzread(gzfile, buf, count);
-/*@-modfilesys@*/
DBGIO(fd, (stderr, "==>\tgzdRead(%p,%p,%u) rc %lx %s\n", cookie, buf, (unsigned)count, (unsigned long)rc, fdbg(fd)));
-/*@=modfilesys@*/
- /*@=compdef@*/
if (rc < 0) {
int zerror = 0;
fd->errcookie = gzerror(gzfile, &zerror);
@@ -2267,20 +2216,17 @@ DBGIO(fd, (stderr, "==>\tgzdRead(%p,%p,%u) rc %lx %s\n", cookie, buf, (unsigned)
}
} else if (rc >= 0) {
fdstat_exit(fd, FDSTAT_READ, rc);
- /*@-compdef@*/
if (fd->ndigests && rc > 0) fdUpdateDigests(fd, buf, rc);
- /*@=compdef@*/
}
return rc;
}
-/*@=mustmod@*/
static ssize_t gzdWrite(void * cookie, const char * buf, size_t count)
/*@globals fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/
{
FD_t fd = c2f(cookie);
- gzFile *gzfile;
+ gzFile gzfile;
ssize_t rc;
if (fd == NULL || fd->bytesRemain == 0) return 0; /* XXX simulate EOF */
@@ -2292,9 +2238,7 @@ static ssize_t gzdWrite(void * cookie, const char * buf, size_t count)
fdstat_enter(fd, FDSTAT_WRITE);
rc = gzwrite(gzfile, (void *)buf, count);
-/*@-modfilesys@*/
DBGIO(fd, (stderr, "==>\tgzdWrite(%p,%p,%u) rc %lx %s\n", cookie, buf, (unsigned)count, (unsigned long)rc, fdbg(fd)));
-/*@=modfilesys@*/
if (rc < 0) {
int zerror = 0;
fd->errcookie = gzerror(gzfile, &zerror);
@@ -2321,7 +2265,7 @@ static inline int gzdSeek(void * cookie, _libio_pos_t pos, int whence)
int rc;
#if HAVE_GZSEEK
FD_t fd = c2f(cookie);
- gzFile *gzfile;
+ gzFile gzfile;
if (fd == NULL) return -2;
assert(fd->bytesRemain == -1); /* XXX FIXME */
@@ -2331,9 +2275,7 @@ static inline int gzdSeek(void * cookie, _libio_pos_t pos, int whence)
fdstat_enter(fd, FDSTAT_SEEK);
rc = gzseek(gzfile, p, whence);
-/*@-modfilesys@*/
DBGIO(fd, (stderr, "==>\tgzdSeek(%p,%ld,%d) rc %lx %s\n", cookie, (long)p, whence, (unsigned long)rc, fdbg(fd)));
-/*@=modfilesys@*/
if (rc < 0) {
int zerror = 0;
fd->errcookie = gzerror(gzfile, &zerror);
@@ -2355,7 +2297,7 @@ static int gzdClose( /*@only@*/ void * cookie)
/*@modifies fileSystem, internalState @*/
{
FD_t fd = c2f(cookie);
- gzFile *gzfile;
+ gzFile gzfile;
int rc;
gzfile = gzdFileno(fd);
@@ -2369,9 +2311,7 @@ static int gzdClose( /*@only@*/ void * cookie)
/* XXX TODO: preserve fd if errors */
if (fd) {
-/*@-modfilesys@*/
DBGIO(fd, (stderr, "==>\tgzdClose(%p) zerror %d %s\n", cookie, rc, fdbg(fd)));
-/*@=modfilesys@*/
if (rc < 0) {
fd->errcookie = "gzclose error";
if (rc == Z_ERRNO) {
@@ -2383,9 +2323,7 @@ DBGIO(fd, (stderr, "==>\tgzdClose(%p) zerror %d %s\n", cookie, rc, fdbg(fd)));
}
}
-/*@-modfilesys@*/
DBGIO(fd, (stderr, "==>\tgzdClose(%p) rc %lx %s\n", cookie, (unsigned long)rc, fdbg(fd)));
-/*@=modfilesys@*/
if (_rpmio_debug || rpmIsDebug()) fdstat_print(fd, "GZDIO", stderr);
/*@-branchstate@*/
@@ -2395,10 +2333,12 @@ DBGIO(fd, (stderr, "==>\tgzdClose(%p) rc %lx %s\n", cookie, (unsigned long)rc, f
return rc;
}
+/*@-type@*/ /* LCL: function typedefs */
static struct FDIO_s gzdio_s = {
gzdRead, gzdWrite, gzdSeek, gzdClose, XfdLink, XfdFree, XfdNew, fdFileno,
NULL, gzdOpen, gzdFileno, gzdFlush, NULL, NULL, NULL, NULL, NULL
};
+/*@=type@*/
FDIO_t gzdio = /*@-compmempass@*/ &gzdio_s /*@=compmempass@*/ ;
/*@=moduncon@*/
@@ -2585,9 +2525,7 @@ static int bzdClose( /*@only@*/ void * cookie)
}
}
-/*@-modfilesys@*/
DBGIO(fd, (stderr, "==>\tbzdClose(%p) rc %lx %s\n", cookie, (unsigned long)rc, fdbg(fd)));
-/*@=modfilesys@*/
if (_rpmio_debug || rpmIsDebug()) fdstat_print(fd, "BZDIO", stderr);
/*@-branchstate@*/
@@ -2597,10 +2535,12 @@ DBGIO(fd, (stderr, "==>\tbzdClose(%p) rc %lx %s\n", cookie, (unsigned long)rc, f
return rc;
}
+/*@-type@*/ /* LCL: function typedefs */
static struct FDIO_s bzdio_s = {
bzdRead, bzdWrite, bzdSeek, bzdClose, XfdLink, XfdFree, XfdNew, fdFileno,
NULL, bzdOpen, bzdFileno, bzdFlush, NULL, NULL, NULL, NULL, NULL
};
+/*@=type@*/
FDIO_t bzdio = /*@-compmempass@*/ &bzdio_s /*@=compmempass@*/ ;
/*@=moduncon@*/
@@ -2650,9 +2590,7 @@ size_t Fread(void *buf, size_t size, size_t nmemb, FD_t fd) {
int rc;
FDSANE(fd);
-/*@-modfilesys@*/
DBGIO(fd, (stderr, "==> Fread(%p,%u,%u,%p) %s\n", buf, (unsigned)size, (unsigned)nmemb, (fd ? fd : NULL), fdbg(fd)));
-/*@=modfilesys@*/
if (fdGetIo(fd) == fpio) {
/*@+voidabstract -nullpass@*/
@@ -2675,9 +2613,7 @@ size_t Fwrite(const void *buf, size_t size, size_t nmemb, FD_t fd)
int rc;
FDSANE(fd);
-/*@-modfilesys@*/
DBGIO(fd, (stderr, "==> Fwrite(%p,%u,%u,%p) %s\n", buf, (unsigned)size, (unsigned)nmemb, (fd ? fd : NULL), fdbg(fd)));
-/*@=modfilesys@*/
if (fdGetIo(fd) == fpio) {
/*@-boundsread@*/
@@ -2708,9 +2644,7 @@ int Fseek(FD_t fd, _libio_off_t offset, int whence) {
long int rc;
FDSANE(fd);
-/*@-modfilesys@*/
DBGIO(fd, (stderr, "==> Fseek(%p,%ld,%d) %s\n", fd, (long)offset, whence, fdbg(fd)));
-/*@=modfilesys@*/
if (fdGetIo(fd) == fpio) {
FILE *fp;
@@ -2735,9 +2669,7 @@ int Fclose(FD_t fd)
int rc = 0, ec = 0;
FDSANE(fd);
-/*@-modfilesys@*/
DBGIO(fd, (stderr, "==> Fclose(%p) %s\n", (fd ? fd : NULL), fdbg(fd)));
-/*@=modfilesys@*/
fd = fdLink(fd, "Fclose");
/*@-branchstate@*/
@@ -2928,8 +2860,6 @@ fprintf(stderr, "*** Fdopen(%p,%s) %s\n", fd, fmode, fdbg(fd));
#endif
} else if (!strcmp(end, "ufdio")) {
iof = ufdio;
- } else if (!strcmp(end, "fadio")) {
- iof = fadio;
} else if (!strcmp(end, "fpio")) {
iof = fpio;
if (noLibio) {
@@ -2973,9 +2903,7 @@ fprintf(stderr, "*** Fdopen fpio fp %p\n", (void *)fp);
ciof.seek = iof->seek;
ciof.close = iof->close;
fp = fopencookie(fd, stdio, ciof);
-/*@-modfilesys@*/
DBGIO(fd, (stderr, "==> fopencookie(%p,\"%s\",*%p) returns fp %p\n", fd, stdio, iof, fp));
-/*@=modfilesys@*/
}
#endif
@@ -2992,9 +2920,7 @@ DBGIO(fd, (stderr, "==> fopencookie(%p,\"%s\",*%p) returns fp %p\n", fd, stdio,
/*@=branchstate@*/
}
-/*@-modfilesys@*/
DBGIO(fd, (stderr, "==> Fdopen(%p,\"%s\") returns fd %p %s\n", ofd, fmode, (fd ? fd : NULL), fdbg(fd)));
-/*@=modfilesys@*/
/*@-refcounttrans -retalias@*/ return fd; /*@=refcounttrans =retalias@*/
}
/*@=boundswrite@*/
@@ -3024,14 +2950,6 @@ fprintf(stderr, "*** Fopen fdio path %s fmode %s\n", path, fmode);
if (fd) (void) fdClose(fd);
return NULL;
}
- } else if (!strcmp(end, "fadio")) {
-if (_rpmio_debug)
-fprintf(stderr, "*** Fopen fadio path %s fmode %s\n", path, fmode);
- fd = fadio->_open(path, flags, perms);
- if (fdFileno(fd) < 0) {
- /*@-refcounttrans@*/ (void) fdClose(fd); /*@=refcounttrans@*/
- return NULL;
- }
} else {
FILE *fp;
int fdno;
@@ -3061,7 +2979,8 @@ fprintf(stderr, "*** Fopen WTFO path %s fmode %s\n", path, fmode);
}
/* XXX persistent HTTP/1.1 returns the previously opened fp */
- if (isHTTP && ((fp = fdGetFp(fd)) != NULL) && ((fdno = fdGetFdno(fd)) >= 0)) {
+ if (isHTTP && ((fp = fdGetFp(fd)) != NULL) && ((fdno = fdGetFdno(fd)) >= 0))
+ {
/*@+voidabstract@*/
fdPush(fd, fpio, fp, fileno(fp)); /* Push fpio onto stack */
/*@=voidabstract@*/
@@ -3128,9 +3047,7 @@ int Ferror(FD_t fd)
if (rc == 0 && ec)
rc = ec;
}
-/*@-modfilesys@*/
DBGIO(fd, (stderr, "==> Ferror(%p) rc %d %s\n", fd, rc, fdbg(fd)));
-/*@=modfilesys@*/
return rc;
}
@@ -3143,9 +3060,7 @@ int Fileno(FD_t fd)
rc = fd->fps[i].fdno;
/*@=boundsread@*/
}
-/*@-modfilesys@*/
DBGIO(fd, (stderr, "==> Fileno(%p) rc %d %s\n", (fd ? fd : NULL), rc, fdbg(fd)));
-/*@=modfilesys@*/
return rc;
}
@@ -3263,9 +3178,10 @@ exit:
}
/*@=boundswrite@*/
+/*@-type@*/ /* LCL: function typedefs */
static struct FDIO_s fpio_s = {
ufdRead, ufdWrite, fdSeek, ufdClose, XfdLink, XfdFree, XfdNew, fdFileno,
ufdOpen, NULL, fdGetFp, NULL, Mkdir, Chdir, Rmdir, Rename, Unlink
};
-FDIO_t fpio = /*@-compmempass@*/ &fpio_s /*@=compmempass@*/ ;
/*@=type@*/
+FDIO_t fpio = /*@-compmempass@*/ &fpio_s /*@=compmempass@*/ ;
diff --git a/rpmio/rpmio.h b/rpmio/rpmio.h
index c4e3ddc52..538fcf717 100644
--- a/rpmio/rpmio.h
+++ b/rpmio/rpmio.h
@@ -282,7 +282,7 @@ int Fclose( /*@killref@*/ FD_t fd)
*/
/*@null@*/ FD_t Fopen(/*@null@*/ const char * path,
/*@null@*/ const char * fmode)
- /*@globals fileSystem, internalState @*/
+ /*@globals h_errno, fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/;
@@ -325,28 +325,28 @@ int Fcntl(FD_t fd, int op, void *lip)
* mkdir(2) clone.
*/
int Mkdir(const char * path, mode_t mode)
- /*@globals errno, fileSystem, internalState @*/
+ /*@globals errno, h_errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/;
/**
* chdir(2) clone.
*/
int Chdir(const char * path)
- /*@globals errno, fileSystem, internalState @*/
+ /*@globals errno, h_errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/;
/**
* rmdir(2) clone.
*/
int Rmdir(const char * path)
- /*@globals errno, fileSystem, internalState @*/
+ /*@globals errno, h_errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/;
/**
* rename(2) clone.
*/
int Rename(const char * oldpath, const char * newpath)
- /*@globals errno, fileSystem, internalState @*/
+ /*@globals errno, h_errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/;
/**
@@ -360,7 +360,7 @@ int Link(const char * oldpath, const char * newpath)
* unlink(2) clone.
*/
int Unlink(const char * path)
- /*@globals errno, fileSystem, internalState @*/
+ /*@globals errno, h_errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/;
/**
@@ -368,7 +368,7 @@ int Unlink(const char * path)
*/
/*@-incondefs@*/
int Readlink(const char * path, /*@out@*/ char * buf, size_t bufsiz)
- /*@globals errno, fileSystem, internalState @*/
+ /*@globals errno, h_errno, fileSystem, internalState @*/
/*@modifies *buf, errno, fileSystem, internalState @*/
/*@requires maxSet(buf) >= (bufsiz - 1) @*/
/*@ensures maxRead(buf) <= bufsiz @*/;
@@ -378,14 +378,14 @@ int Readlink(const char * path, /*@out@*/ char * buf, size_t bufsiz)
* stat(2) clone.
*/
int Stat(const char * path, /*@out@*/ struct stat * st)
- /*@globals errno, fileSystem, internalState @*/
+ /*@globals errno, h_errno, fileSystem, internalState @*/
/*@modifies *st, errno, fileSystem, internalState @*/;
/**
* lstat(2) clone.
*/
int Lstat(const char * path, /*@out@*/ struct stat * st)
- /*@globals errno, fileSystem, internalState @*/
+ /*@globals errno, h_errno, fileSystem, internalState @*/
/*@modifies *st, errno, fileSystem, internalState @*/;
/**
@@ -418,7 +418,7 @@ void Globfree( /*@only@*/ glob_t * pglob)
*/
/*@null@*/
DIR * Opendir(const char * path)
- /*@globals errno, fileSystem, internalState @*/
+ /*@globals errno, h_errno, fileSystem, internalState @*/
/*@modifies errno, fileSystem, internalState @*/;
/**
@@ -552,7 +552,7 @@ int fdReadable(FD_t fd, int secs)
* @return 0 on success, errno (or -1) on error
*/
int rpmioMkpath(const char * path, mode_t mode, uid_t uid, gid_t gid)
- /*@globals fileSystem, internalState @*/
+ /*@globals h_errno, fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/;
/**
@@ -593,7 +593,7 @@ typedef enum ftperrCode_e {
/*@-redecl@*/
/*@unused@*/
/*@observer@*/ const char * urlStrerror(const char * url)
- /*@globals internalState @*/
+ /*@globals h_errno, internalState @*/
/*@modifies internalState @*/;
/*@=redecl@*/
diff --git a/rpmio/rpmio_internal.h b/rpmio/rpmio_internal.h
index b4ddb8c10..cb4f3edbb 100644
--- a/rpmio/rpmio_internal.h
+++ b/rpmio/rpmio_internal.h
@@ -96,6 +96,7 @@ struct pgpDig_s {
/** \ingroup rpmio
*/
typedef struct _FDSTACK_s {
+/*@exposed@*/
FDIO_t io;
/*@dependent@*/ void * fp;
int fdno;
@@ -180,7 +181,9 @@ extern int _ftp_debug;
/*@=redecl@*/
#define DBG(_f, _m, _x) \
- if ((_rpmio_debug | ((_f) ? ((FD_t)(_f))->flags : 0)) & (_m)) fprintf _x
+ /*@-modfilesys@*/ \
+ if ((_rpmio_debug | ((_f) ? ((FD_t)(_f))->flags : 0)) & (_m)) fprintf _x \
+ /*@=modfilesys@*/
#if defined(__LCLINT__XXX)
#define DBGIO(_f, _x)
@@ -204,7 +207,7 @@ int fdFgets(FD_t fd, char * buf, size_t len)
*/
/*@null@*/ FD_t ftpOpen(const char *url, /*@unused@*/ int flags,
/*@unused@*/ mode_t mode, /*@out@*/ urlinfo *uret)
- /*@globals fileSystem, internalState @*/
+ /*@globals h_errno, fileSystem, internalState @*/
/*@modifies *uret, fileSystem, internalState @*/;
/** \ingroup rpmio
@@ -216,7 +219,7 @@ int ftpReq(FD_t data, const char * ftpCmd, const char * ftpArg)
/** \ingroup rpmio
*/
int ftpCmd(const char * cmd, const char * url, const char * arg2)
- /*@globals fileSystem, internalState @*/
+ /*@globals h_errno, fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/;
/** \ingroup rpmio
@@ -596,7 +599,7 @@ int fdFileno(/*@null@*/ void * cookie)
*/
int rpmioSlurp(const char * fn,
/*@out@*/ const unsigned char ** bp, /*@out@*/ ssize_t * blenp)
- /*@globals fileSystem, internalState @*/
+ /*@globals h_errno, fileSystem, internalState @*/
/*@modifies *bp, *blenp, fileSystem, internalState @*/;
#ifdef __cplusplus
diff --git a/rpmio/rpmlog.h b/rpmio/rpmlog.h
index 6cbd01b39..d9d01a409 100644
--- a/rpmio/rpmlog.h
+++ b/rpmio/rpmlog.h
@@ -176,7 +176,7 @@ int rpmlogGetNrecs(void) /*@*/;
* Print all rpmError() messages.
* @param f file handle (NULL uses stderr)
*/
-void rpmlogPrint(FILE *f)
+void rpmlogPrint(/*@null@*/ FILE *f)
/*@modifies *f @*/;
/**
diff --git a/rpmio/rpmmacro.h b/rpmio/rpmmacro.h
index 97eae6a3b..aeac1dd8e 100644
--- a/rpmio/rpmmacro.h
+++ b/rpmio/rpmmacro.h
@@ -64,8 +64,7 @@ extern "C" {
*/
void rpmDumpMacroTable (/*@null@*/ MacroContext mc,
/*@null@*/ FILE * fp)
- /*@globals rpmGlobalMacroContext,
- fileSystem@*/
+ /*@globals rpmGlobalMacroContext, fileSystem @*/
/*@modifies *fp, fileSystem @*/;
/**
@@ -81,8 +80,7 @@ void rpmDumpMacroTable (/*@null@*/ MacroContext mc,
int expandMacros (/*@null@*/ void * spec, /*@null@*/ MacroContext mc,
/*@in@*/ /*@out@*/ char * sbuf,
size_t slen)
- /*@globals rpmGlobalMacroContext,
- fileSystem @*/
+ /*@globals rpmGlobalMacroContext, h_errno, fileSystem @*/
/*@modifies *sbuf, rpmGlobalMacroContext, fileSystem @*/;
/**
@@ -97,7 +95,7 @@ int expandMacros (/*@null@*/ void * spec, /*@null@*/ MacroContext mc,
void addMacro (/*@null@*/ MacroContext mc, const char * n,
/*@null@*/ const char * o,
/*@null@*/ const char * b, int level)
- /*@globals rpmGlobalMacroContext@*/
+ /*@globals rpmGlobalMacroContext @*/
/*@modifies mc, rpmGlobalMacroContext @*/;
/**
@@ -106,7 +104,7 @@ void addMacro (/*@null@*/ MacroContext mc, const char * n,
* @param n macro name
*/
void delMacro (/*@null@*/ MacroContext mc, const char * n)
- /*@globals rpmGlobalMacroContext@*/
+ /*@globals rpmGlobalMacroContext @*/
/*@modifies mc, rpmGlobalMacroContext @*/;
/**
@@ -118,7 +116,7 @@ void delMacro (/*@null@*/ MacroContext mc, const char * n)
*/
int rpmDefineMacro (/*@null@*/ MacroContext mc, const char * macro,
int level)
- /*@globals rpmGlobalMacroContext@*/
+ /*@globals rpmGlobalMacroContext, h_errno @*/
/*@modifies mc, rpmGlobalMacroContext @*/;
/**
@@ -127,7 +125,7 @@ int rpmDefineMacro (/*@null@*/ MacroContext mc, const char * macro,
* @param level macro recursion level (0 is entry API)
*/
void rpmLoadMacros (/*@null@*/ MacroContext mc, int level)
- /*@globals rpmGlobalMacroContext@*/
+ /*@globals rpmGlobalMacroContext @*/
/*@modifies rpmGlobalMacroContext @*/;
/**
@@ -137,7 +135,7 @@ void rpmLoadMacros (/*@null@*/ MacroContext mc, int level)
*/
void rpmInitMacros (/*@null@*/ MacroContext mc, const char * macrofiles)
/*@globals rpmGlobalMacroContext, rpmCLIMacroContext,
- fileSystem, internalState @*/
+ h_errno, fileSystem, internalState @*/
/*@modifies rpmGlobalMacroContext, fileSystem, internalState @*/;
/**
@@ -145,7 +143,7 @@ void rpmInitMacros (/*@null@*/ MacroContext mc, const char * macrofiles)
* @param mc macro context (NULL uses global context).
*/
void rpmFreeMacros (/*@null@*/ MacroContext mc)
- /*@globals rpmGlobalMacroContext@*/
+ /*@globals rpmGlobalMacroContext @*/
/*@modifies mc, rpmGlobalMacroContext @*/;
typedef enum rpmCompressedMagic_e {
@@ -163,7 +161,7 @@ typedef enum rpmCompressedMagic_e {
*/
int isCompressed (const char * file,
/*@out@*/ rpmCompressedMagic * compressed)
- /*@globals fileSystem, internalState @*/
+ /*@globals h_errno, fileSystem, internalState @*/
/*@modifies *compressed, fileSystem, internalState @*/;
/**
@@ -172,7 +170,7 @@ int isCompressed (const char * file,
* @return macro expansion (malloc'ed)
*/
char * rpmExpand (/*@null@*/ const char * arg, ...)
- /*@globals rpmGlobalMacroContext @*/
+ /*@globals rpmGlobalMacroContext, h_errno @*/
/*@modifies rpmGlobalMacroContext @*/;
/**
@@ -191,7 +189,7 @@ char * rpmCleanPath (/*@returned@*/ /*@null@*/ char * path)
*/
/*@-redecl@*/ /* LCL: shrug */
const char * rpmGetPath (/*@null@*/ const char * path, ...)
- /*@globals rpmGlobalMacroContext @*/
+ /*@globals rpmGlobalMacroContext, h_errno @*/
/*@modifies rpmGlobalMacroContext @*/;
/*@=redecl@*/
@@ -209,7 +207,7 @@ const char * rpmGetPath (/*@null@*/ const char * path, ...)
const char * rpmGenPath (/*@null@*/ const char * urlroot,
/*@null@*/ const char * urlmdir,
/*@null@*/ const char * urlfile)
- /*@globals rpmGlobalMacroContext @*/
+ /*@globals rpmGlobalMacroContext, h_errno @*/
/*@modifies rpmGlobalMacroContext @*/;
/*@=redecl@*/
@@ -221,7 +219,7 @@ const char * rpmGenPath (/*@null@*/ const char * urlroot,
* @return numeric value
*/
int rpmExpandNumeric (const char * arg)
- /*@globals rpmGlobalMacroContext @*/
+ /*@globals rpmGlobalMacroContext, h_errno @*/
/*@modifies rpmGlobalMacroContext @*/;
#ifdef __cplusplus
diff --git a/rpmio/rpmpgp.h b/rpmio/rpmpgp.h
index 3c9a097e9..32167f70a 100644
--- a/rpmio/rpmpgp.h
+++ b/rpmio/rpmpgp.h
@@ -1227,7 +1227,7 @@ int pgpPrtPkts(const byte *pkts, unsigned int pktlen, pgpDig dig, int printing)
*/
pgpArmor pgpReadPkts(const char * fn,
/*@out@*/ const byte ** pkt, /*@out@*/ size_t * pktlen)
- /*@globals fileSystem, internalState @*/
+ /*@globals h_errno, fileSystem, internalState @*/
/*@modifies *pkt, *pktlen, fileSystem, internalState @*/;
/**
diff --git a/rpmio/rpmrpc.c b/rpmio/rpmrpc.c
index 950638a35..ec434a14b 100644
--- a/rpmio/rpmrpc.c
+++ b/rpmio/rpmrpc.c
@@ -12,13 +12,13 @@
#include "ugid.h"
#include "debug.h"
-/*@access DIR@*/
-/*@access FD_t@*/
-/*@access urlinfo@*/
+/*@access DIR @*/
+/*@access FD_t @*/
+/*@access urlinfo @*/
/* =============================================================== */
static int ftpMkdir(const char * path, /*@unused@*/ mode_t mode)
- /*@globals fileSystem, internalState @*/
+ /*@globals h_errno, fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/
{
int rc;
@@ -34,21 +34,21 @@ static int ftpMkdir(const char * path, /*@unused@*/ mode_t mode)
}
static int ftpChdir(const char * path)
- /*@globals fileSystem, internalState @*/
+ /*@globals h_errno, fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/
{
return ftpCmd("CWD", path, NULL);
}
static int ftpRmdir(const char * path)
- /*@globals fileSystem, internalState @*/
+ /*@globals h_errno, fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/
{
return ftpCmd("RMD", path, NULL);
}
static int ftpRename(const char * oldpath, const char * newpath)
- /*@globals fileSystem, internalState @*/
+ /*@globals h_errno, fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/
{
int rc;
@@ -58,7 +58,7 @@ static int ftpRename(const char * oldpath, const char * newpath)
}
static int ftpUnlink(const char * path)
- /*@globals fileSystem, internalState @*/
+ /*@globals h_errno, fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/
{
return ftpCmd("DELE", path, NULL);
@@ -825,7 +825,7 @@ static int ftpNLST(const char * url, ftpSysCall_t ftpSysCall,
/*@out@*/ /*@null@*/ struct stat * st,
/*@out@*/ /*@null@*/ char * rlbuf, size_t rlbufsiz)
/*@globals ftpBufAlloced, ftpBuf,
- fileSystem, internalState @*/
+ h_errno, fileSystem, internalState @*/
/*@modifies *st, *rlbuf, ftpBufAlloced, ftpBuf,
fileSystem, internalState @*/
{
@@ -1035,7 +1035,7 @@ static const char * statstr(const struct stat * st,
static int ftp_st_ino = 0xdead0000;
static int ftpStat(const char * path, /*@out@*/ struct stat *st)
- /*@globals ftp_st_ino, fileSystem, internalState @*/
+ /*@globals ftp_st_ino, h_errno, fileSystem, internalState @*/
/*@modifies *st, ftp_st_ino, fileSystem, internalState @*/
{
char buf[1024];
@@ -1050,7 +1050,7 @@ fprintf(stderr, "*** ftpStat(%s) rc %d\n%s", path, rc, statstr(st, buf));
}
static int ftpLstat(const char * path, /*@out@*/ struct stat *st)
- /*@globals ftp_st_ino, fileSystem, internalState @*/
+ /*@globals ftp_st_ino, h_errno, fileSystem, internalState @*/
/*@modifies *st, ftp_st_ino, fileSystem, internalState @*/
{
char buf[1024];
@@ -1065,7 +1065,7 @@ fprintf(stderr, "*** ftpLstat(%s) rc %d\n%s\n", path, rc, statstr(st, buf));
}
static int ftpReadlink(const char * path, /*@out@*/ char * buf, size_t bufsiz)
- /*@globals fileSystem, internalState @*/
+ /*@globals h_errno, fileSystem, internalState @*/
/*@modifies *buf, fileSystem, internalState @*/
{
int rc;
@@ -1109,7 +1109,7 @@ static int ftpmagicdir = 0x8440291;
/*@-boundswrite@*/
/*@null@*/
static DIR * ftpOpendir(const char * path)
- /*@globals fileSystem, internalState @*/
+ /*@globals h_errno, fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/
{
FTPDIR mydir;
diff --git a/rpmio/rpmurl.h b/rpmio/rpmurl.h
index 770c610c3..09743f4d2 100644
--- a/rpmio/rpmurl.h
+++ b/rpmio/rpmurl.h
@@ -153,7 +153,7 @@ urltype urlPath(const char * url, /*@out@*/ const char ** pathp)
* @return 0 on success, -1 on error
*/
int urlSplit(const char * url, /*@out@*/ urlinfo * uret)
- /*@globals internalState @*/
+ /*@globals h_errno, internalState @*/
/*@modifies *uret, internalState @*/;
/**
@@ -163,7 +163,7 @@ int urlSplit(const char * url, /*@out@*/ urlinfo * uret)
* @return 0 on success, otherwise FTPERR_* code
*/
int urlGetFile(const char * url, /*@null@*/ const char * dest)
- /*@globals fileSystem, internalState @*/
+ /*@globals h_errno, fileSystem, internalState @*/
/*@modifies fileSystem, internalState @*/;
#ifdef __cplusplus
diff --git a/rpmio/url.c b/rpmio/url.c
index 685375c44..bc46e5e8b 100644
--- a/rpmio/url.c
+++ b/rpmio/url.c
@@ -193,7 +193,7 @@ static int urlStrcmp(/*@null@*/ const char * str1, /*@null@*/ const char * str2)
/*@-boundswrite@*/
/*@-mods@*/
static void urlFind(/*@null@*/ /*@in@*/ /*@out@*/ urlinfo * uret, int mustAsk)
- /*@globals rpmGlobalMacroContext, fileSystem, internalState @*/
+ /*@globals rpmGlobalMacroContext, h_errno, fileSystem, internalState @*/
/*@modifies *uret, rpmGlobalMacroContext, fileSystem, internalState @*/
{
urlinfo u;