RPM Package Manager, CVS Repository
  http://rpm5.org/cvs/
  ____________________________________________________________________________

  Server: rpm5.org                         Name:   Jeff Johnson
  Root:   /v/rpm/cvs                       Email:  j...@rpm5.org
  Module: rpm                              Date:   21-Mar-2009 22:54:10
  Branch: rpm-5_1                          Handle: 2009032121540901

  Modified files:           (Branch: rpm-5_1)
    rpm                     CHANGES
    rpm/lib                 librpm.vers rpmsx.c rpmsx.h rpmte.c rpmte.h

  Log:
    - yarn: wire up rpmteFini, eliminate rpmteFree.
    - yarn: wire up rpmsxFini, eliminate rpmsxFree.

  Summary:
    Revision    Changes     Path
    1.2288.2.232+2  -0      rpm/CHANGES
    1.39.2.17   +0  -2      rpm/lib/librpm.vers
    2.20.2.4    +19 -32     rpm/lib/rpmsx.c
    2.14.2.3    +2  -2      rpm/lib/rpmsx.h
    2.79.2.9    +19 -21     rpm/lib/rpmte.c
    2.47.2.6    +3  -1      rpm/lib/rpmte.h
  ____________________________________________________________________________

  patch -p0 <<'@@ .'
  Index: rpm/CHANGES
  ============================================================================
  $ cvs diff -u -r1.2288.2.231 -r1.2288.2.232 CHANGES
  --- rpm/CHANGES       21 Mar 2009 20:55:18 -0000      1.2288.2.231
  +++ rpm/CHANGES       21 Mar 2009 21:54:09 -0000      1.2288.2.232
  @@ -1,4 +1,6 @@
   5.1.7 -> 5.1.8:
  +    - jbj: yarn: wire up rpmteFini, eliminate rpmteFree.
  +    - jbj: yarn: wire up rpmsxFini, eliminate rpmsxFree.
       - jbj: yarn: wire up rpmfiFini, eliminate rpmfiFree.
       - jbj: yarn: wire up rpmgiFini, eliminate rpmgiFree.
       - jbj: rpmtsi: use __FUNCTION__ rather than adding a 2nd arg everywhere.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/librpm.vers
  ============================================================================
  $ cvs diff -u -r1.39.2.16 -r1.39.2.17 librpm.vers
  --- rpm/lib/librpm.vers       21 Mar 2009 20:55:19 -0000      1.39.2.16
  +++ rpm/lib/librpm.vers       21 Mar 2009 21:54:10 -0000      1.39.2.17
  @@ -259,7 +259,6 @@
       _rpmsx_debug;
       rpmsxFContext;
       rpmsxFMode;
  -    rpmsxFree;
       rpmsxFStem;
       rpmsxInit;
       rpmsxIx;
  @@ -288,7 +287,6 @@
       rpmteFd;
       rpmteFI;
       rpmteFlink;
  -    rpmteFree;
       rpmteFreeTSI;
       rpmteHdrid;
       rpmteHeader;
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmsx.c
  ============================================================================
  $ cvs diff -u -r2.20.2.3 -r2.20.2.4 rpmsx.c
  --- rpm/lib/rpmsx.c   20 Mar 2009 19:13:22 -0000      2.20.2.3
  +++ rpm/lib/rpmsx.c   21 Mar 2009 21:54:10 -0000      2.20.2.4
  @@ -18,23 +18,6 @@
   /*...@unchecked@*/
   int _rpmsx_debug = 0;
   
  -
  -/*...@unchecked@*/ /*...@null@*/
  -rpmioPool _rpmsxPool;
  -
  -static rpmsx rpmsxGetPool(/*...@null@*/ rpmioPool pool)
  -     /*...@modifies pool @*/
  -{
  -    rpmsx sx;
  -
  -    if (_rpmsxPool == NULL) {
  -     _rpmsxPool = rpmioNewPool("sx", sizeof(*sx), -1, _rpmsx_debug,
  -                     NULL, NULL, NULL);
  -     pool = _rpmsxPool;
  -    }
  -    return (rpmsx) rpmioGetPool(pool, sizeof(*sx));
  -}
  -
   /**
    * Stable sort for policy specifications, patterns before paths.
    * @param sx           security context patterns
  @@ -218,20 +201,12 @@
       return -1;
   }
   
  -rpmsx rpmsxFree(rpmsx sx)
  +static void rpmsxFini(void * _sx)
  +     /*...@modifies *_sx @*/
   {
  +    rpmsx sx = _sx;
       int i;
   
  -    if (sx == NULL)
  -     return NULL;
  -
  -    yarnPossess(sx->_item.use);
  -/*...@-modfilesys@*/
  -if (_rpmsx_debug)
  -fprintf(stderr, "--> sx %p -- %ld %s at %s:%u\n", sx, 
yarnPeekLock(sx->_item.use), "rpmsxFree", __FILE__, __LINE__);
  -/*...@=modfilesys@*/
  -
  -    if (yarnPeekLock(sx->_item.use) <= -1L) {
        if (sx->Count > 0)
        for (i = 0; i < sx->Count; i++) {
            rpmsxp sxp = sx->sxp + i;
  @@ -249,10 +224,22 @@
            sxs->stem = _free(sxs->stem);
        }
        sx->sxs = _free(sx->sxs);
  -     sx = (rpmsx) rpmioPutPool((rpmioItem)sx);
  -    } else
  -     yarnTwist(sx->_item.use, BY, -1);
  -    return NULL;
  +}
  +
  +/*...@unchecked@*/ /*...@null@*/
  +rpmioPool _rpmsxPool;
  +
  +static rpmsx rpmsxGetPool(/*...@null@*/ rpmioPool pool)
  +     /*...@modifies pool @*/
  +{
  +    rpmsx sx;
  +
  +    if (_rpmsxPool == NULL) {
  +     _rpmsxPool = rpmioNewPool("sx", sizeof(*sx), -1, _rpmsx_debug,
  +                     NULL, NULL, rpmsxFini);
  +     pool = _rpmsxPool;
  +    }
  +    return (rpmsx) rpmioGetPool(pool, sizeof(*sx));
   }
   
   /**
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmsx.h
  ============================================================================
  $ cvs diff -u -r2.14.2.2 -r2.14.2.3 rpmsx.h
  --- rpm/lib/rpmsx.h   20 Mar 2009 19:13:22 -0000      2.14.2.2
  +++ rpm/lib/rpmsx.h   21 Mar 2009 21:54:10 -0000      2.14.2.3
  @@ -109,11 +109,11 @@
    * @param sx         security context patterns
    * @return           NULL always
    */
  -/*...@-exportlocal@*/
   /*...@null@*/
   rpmsx rpmsxFree(/*...@killref@*/ /*...@only@*/ /*...@null@*/ rpmsx sx)
        /*...@modifies s...@*/;
  -/*...@=exportlocal@*/
  +#define      rpmsxFree(_sx)  \
  +    ((rpmsx)rpmioFreePoolItem((rpmioItem)(_sx), __FUNCTION__, __FILE__, 
__LINE__))
   
   /**
    * Parse selinux file security context patterns.
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmte.c
  ============================================================================
  $ cvs diff -u -r2.79.2.8 -r2.79.2.9 rpmte.c
  --- rpm/lib/rpmte.c   21 Mar 2009 17:33:38 -0000      2.79.2.8
  +++ rpm/lib/rpmte.c   21 Mar 2009 21:54:10 -0000      2.79.2.9
  @@ -23,22 +23,6 @@
   /*...@access alKey @*/
   /*...@access rpmtsi @*/
   
  -/*...@unchecked@*/ /*...@null@*/
  -rpmioPool _rpmtePool;
  -
  -static rpmte rpmteGetPool(/*...@null@*/ rpmioPool pool)
  -     /*...@modifies pool @*/
  -{
  -    rpmte te;
  -
  -    if (_rpmtePool == NULL) {
  -     _rpmtePool = rpmioNewPool("te", sizeof(*te), -1, _rpmte_debug,
  -                     NULL, NULL, NULL);
  -     pool = _rpmtePool;
  -    }
  -    return (rpmte) rpmioGetPool(pool, sizeof(*te));
  -}
  -
   void rpmteCleanDS(rpmte te)
   {
       te->PRCO = rpmdsFreePRCO(te->PRCO);
  @@ -220,14 +204,28 @@
   /*...@=compdef@*/
   }
   
  -rpmte rpmteFree(rpmte te)
  +static void rpmteFini(void * _te)
  +     /*...@modifies *_te @*/
   {
  -    if (te != NULL) {
  -     yarnPossess(te->_item.use); /* XXX no refcounts, rpioPutPool expects 
locked. */
  +    rpmte te = _te;
  +
        delTE(te);
  -     te = (rpmte)rpmioPutPool((rpmioItem)te);
       }
  -    return NULL;
  +
  +/*...@unchecked@*/ /*...@null@*/
  +rpmioPool _rpmtePool;
  +
  +static rpmte rpmteGetPool(/*...@null@*/ rpmioPool pool)
  +     /*...@modifies pool @*/
  +{
  +    rpmte te;
  +
  +    if (_rpmtePool == NULL) {
  +     _rpmtePool = rpmioNewPool("te", sizeof(*te), -1, _rpmte_debug,
  +                     NULL, NULL, rpmteFini);
  +     pool = _rpmtePool;
  +    }
  +    return (rpmte) rpmioGetPool(pool, sizeof(*te));
   }
   
   rpmte rpmteNew(const rpmts ts, Header h,
  @@ .
  patch -p0 <<'@@ .'
  Index: rpm/lib/rpmte.h
  ============================================================================
  $ cvs diff -u -r2.47.2.5 -r2.47.2.6 rpmte.h
  --- rpm/lib/rpmte.h   21 Mar 2009 20:16:26 -0000      2.47.2.5
  +++ rpm/lib/rpmte.h   21 Mar 2009 21:54:10 -0000      2.47.2.6
  @@ -191,10 +191,12 @@
    * @param te         transaction element
    * @return           NULL always
    */
  -/*...@null@*/
  +/*...@unused@*/ /*...@null@*/
   rpmte rpmteFree(/*...@only@*/ /*...@null@*/ rpmte te)
        /*...@globals fileSystem @*/
        /*...@modifies te, fileSystem @*/;
  +#define rpmteFree(_te)  \
  +    ((rpmte) rpmioFreePoolItem((rpmioItem)(_te), __FUNCTION__, __FILE__, 
__LINE__))
   
   /** \ingroup rpmte
    * Create a transaction element.
  @@ .
______________________________________________________________________
RPM Package Manager                                    http://rpm5.org
CVS Sources Repository                                rpm-cvs@rpm5.org

Reply via email to