From e47f66c661e9ff136ef2089242388c272cc75038 Mon Sep 17 00:00:00 2001 From: "leaf%mozilla.org" Date: Tue, 18 May 1999 18:55:34 +0000 Subject: [PATCH] backing out dveditz's changes (seems to be breaking mac) --- modules/libreg/include/NSReg.h | 3 --- modules/libreg/src/reg.c | 33 ++++++++++----------------------- 2 files changed, 10 insertions(+), 26 deletions(-) diff --git a/modules/libreg/include/NSReg.h b/modules/libreg/include/NSReg.h index 5d71652a9e6d..abe5ca29c0c5 100644 --- a/modules/libreg/include/NSReg.h +++ b/modules/libreg/include/NSReg.h @@ -165,9 +165,6 @@ VR_INTERFACE(REGERR) NR_RegClose( * * Parameters: * hReg - handle of open registry to query - * Returns: - * REGERR_OK if writable, REGERR_READONLY if not, possibly - * other errors for an invalid hReg * --------------------------------------------------------------------- */ VR_INTERFACE(REGERR) NR_RegIsWritable( diff --git a/modules/libreg/src/reg.c b/modules/libreg/src/reg.c index faf7ccc7b1a2..21759d06fa2e 100644 --- a/modules/libreg/src/reg.c +++ b/modules/libreg/src/reg.c @@ -1449,7 +1449,7 @@ static REGERR nr_RemoveName(char *path) * -------------------------------------------------------------------- */ static REGERR nr_Find(REGFILE *reg, REGOFF offParent, char *pPath, - REGDESC *pDesc, REGOFF *pPrev, REGOFF *pParent, XP_Bool raw); + REGDESC *pDesc, REGOFF *pPrev, REGOFF *pParent, Bool raw); static REGERR nr_FindAtLevel(REGFILE *reg, REGOFF offFirst, char *pName, REGDESC *pDesc, REGOFF *pOffPrev); @@ -1469,7 +1469,7 @@ static REGERR nr_Find(REGFILE *reg, REGDESC *pDesc, REGOFF *pPrev, REGOFF *pParent, - XP_Bool raw) + Bool raw) { REGERR err; @@ -2237,43 +2237,30 @@ static REGERR nr_RegClose( HREG hReg ) { REGERR err = REGERR_OK; REGHANDLE* reghnd = (REGHANDLE*)hReg; - REGFILE* reg; - XP_Bool needDelete = FALSE; XP_ASSERT( regStartCount > 0 ); /* verify handle */ err = VERIFY_HREG( hReg ); - if ( err != REGERR_OK ) - return err; - - reg = reghnd->pReg; - - err = nr_Lock( reg ); if ( err == REGERR_OK ) { - XP_ASSERT( VALID_FILEHANDLE(reg->fh) ); + XP_ASSERT( VALID_FILEHANDLE(reghnd->pReg->fh) ); /* lower REGFILE user count */ - reg->refCount--; + reghnd->pReg->refCount--; /* if registry is no longer in use */ - if ( reg->refCount < 1 ) - { + if ( reghnd->pReg->refCount < 1 ) { /* ...then close the file */ - if ( reg->hdrDirty ) { - nr_WriteHdr( reg ); + if ( reghnd->pReg->hdrDirty ) { + nr_WriteHdr( reghnd->pReg ); } - nr_CloseFile( &(reg->fh) ); - needDelete = TRUE; + nr_CloseFile( &(reghnd->pReg->fh) ); + /* ...and delete REGFILE node from list */ + nr_DeleteNode( reghnd->pReg ); } reghnd->magic = 0; /* prevent accidental re-use */ - nr_Unlock( reg ); - - if ( needDelete ) - nr_DeleteNode( reg ); - XP_FREE( reghnd ); }