From: Panu Matilainen Date: Wed, 14 Oct 2009 14:14:38 +0000 (+0300) Subject: Eliminate last remaining FD_t struct privacy violation X-Git-Tag: rpm-4.8.0-beta1~97 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e5be860abb675dff7f5488073f8f836cb5c908c5;p=platform%2Fupstream%2Frpm.git Eliminate last remaining FD_t struct privacy violation - add getter for fd digest bundle, uninline the setter --- diff --git a/lib/package.c b/lib/package.c index 3bb53e7..d1c73bd 100644 --- a/lib/package.c +++ b/lib/package.c @@ -15,7 +15,7 @@ #include "lib/rpmlead.h" #include "lib/signature.h" #include "rpmio/digest.h" -#include "rpmio/rpmio_internal.h" /* fd*Digest(), fd stats */ +#include "rpmio/rpmio_internal.h" /* fd digest bits */ #include "lib/header_internal.h" /* XXX headerCheck */ #include "debug.h" @@ -689,7 +689,7 @@ static rpmRC rpmpkgRead(rpmKeyring keyring, rpmVSFlags vsflags, goto exit; } - ctx = rpmDigestBundleDupCtx(fd->digests, (sigtag == RPMSIGTAG_MD5) ? + ctx = rpmDigestBundleDupCtx(fdGetBundle(fd), (sigtag == RPMSIGTAG_MD5) ? PGPHASHALGO_MD5 : dig->signature.hash_algo); break; default: diff --git a/rpmio/rpmio.c b/rpmio/rpmio.c index 2e3e4ec..93253ee 100644 --- a/rpmio/rpmio.c +++ b/rpmio/rpmio.c @@ -94,6 +94,18 @@ static FD_t c2f(void * cookie) return fd; } +void fdSetBundle(FD_t fd, rpmDigestBundle bundle) +{ + FDSANE(fd); + fd->digests = bundle; +} + +rpmDigestBundle fdGetBundle(FD_t fd) +{ + FDSANE(fd); + return fd->digests; +} + #define FDNREFS(fd) (fd ? ((FD_t)fd)->nrefs : -9) #define FDTO(fd) (fd ? ((FD_t)fd)->rd_timeoutsecs : -99) diff --git a/rpmio/rpmio_internal.h b/rpmio/rpmio_internal.h index 313f968..31455fb 100644 --- a/rpmio/rpmio_internal.h +++ b/rpmio/rpmio_internal.h @@ -59,12 +59,8 @@ struct _FD_s { extern "C" { #endif -static inline -void fdSetBundle(FD_t fd, rpmDigestBundle bundle) -{ - FDSANE(fd); - fd->digests = bundle; -} +void fdSetBundle(FD_t fd, rpmDigestBundle bundle); +rpmDigestBundle fdGetBundle(FD_t fd); /** \ingroup rpmio * Attach digest to fd.