RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: rpm Date: 10-Jul-2007 19:18:13 Branch: HEAD Handle: 2007071018181201 Modified files: rpm/lib rpmfc.c transaction.c rpm/rpmdb legacy.c sqlite.c rpm/rpmio rpmhash.c rpmhash.h Log: rpmfc.c: insure that ftype is initialized (always ways, gcc is dense). rpmfc.c: indentation changes for UNSPECIFIED -magicfile behavior. transaction.c: fix void *** dereference. legacy.c: fix void ** dereference. sqlite.c: insure that umask is initialized. rpmhash.[ch]: take void ** references out of the API. Summary: Revision Changes Path 1.7 +6 -9 rpm/lib/rpmfc.c 1.325 +1 -2 rpm/lib/transaction.c 1.30 +1 -1 rpm/rpmdb/legacy.c 1.8 +1 -1 rpm/rpmdb/sqlite.c 1.3 +4 -4 rpm/rpmio/rpmhash.c 1.3 +7 -7 rpm/rpmio/rpmhash.h ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/lib/rpmfc.c ============================================================================ $ cvs diff -u -r1.6 -r1.7 rpmfc.c --- rpm/lib/rpmfc.c 3 Jul 2007 17:49:14 -0000 1.6 +++ rpm/lib/rpmfc.c 10 Jul 2007 17:18:12 -0000 1.7 @@ -1034,6 +1034,7 @@ int_16 mode = (fmode ? fmode[fc->ix] : 0); int urltype; + ftype = ""; urltype = urlPath(argv[fc->ix], &s); assert(s != NULL && *s == '/'); slen = strlen(s); @@ -1085,20 +1086,17 @@ /* XXX skip all files in /dev/ which are (or should be) %dev dummies. */ else if (slen >= fc->brlen+sizeof("/dev/") && !strncmp(s+fc->brlen, "/dev/", sizeof("/dev/")-1)) ftype = ""; - else #ifdef HAVE_MAGIC_H - if (magicfile) { + else if (magicfile) { ftype = magic_file(ms, s); - if (ftype == NULL) { - xx = RPMERR_EXEC; - rpmError(xx, _("magic_file(ms, \"%s\") failed: mode %06o %s\n"), + if (ftype == NULL) { + xx = RPMERR_EXEC; + rpmError(xx, _("magic_file(ms, \"%s\") failed: mode %06o %s\n"), s, mode, magic_error(ms)); assert(ftype != NULL); /* XXX figger a proper return path. */ + } } - } -#else - ftype = ""; #endif /[EMAIL PROTECTED]@*/ break; } @@ -1147,7 +1145,6 @@ #endif #ifdef HAVE_MAGIC_H -exit: magicfile = _free(magicfile); #endif @@ . patch -p0 <<'@@ .' Index: rpm/lib/transaction.c ============================================================================ $ cvs diff -u -r1.324 -r1.325 transaction.c --- rpm/lib/transaction.c 19 Jun 2007 02:32:42 -0000 1.324 +++ rpm/lib/transaction.c 10 Jul 2007 17:18:12 -0000 1.325 @@ -435,8 +435,7 @@ * will be installed and removed so the records for an overlapped * files will be sorted in exactly the same order. */ - (void) htGetEntry(ts->ht, fiFps, - (const void ***) &recs, &numRecs, NULL); + (void) htGetEntry(ts->ht, fiFps, &recs, &numRecs, NULL); /* * If this package is being added, look only at other packages @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/legacy.c ============================================================================ $ cvs diff -u -r1.29 -r1.30 legacy.c --- rpm/rpmdb/legacy.c 9 Jul 2007 22:31:57 -0000 1.29 +++ rpm/rpmdb/legacy.c 10 Jul 2007 17:18:12 -0000 1.30 @@ -203,7 +203,7 @@ ctx = rpmDigestInit(digestalgo, RPMDIGEST_NONE); if (fsize) xx = rpmDigestUpdate(ctx, mapped, fsize); - xx = rpmDigestFinal(ctx, (void **)&dsum, &dlen, asAscii); + xx = rpmDigestFinal(ctx, &dsum, &dlen, asAscii); if (fsize) xx = munmap(mapped, fsize); xx = close(fdno); @@ . patch -p0 <<'@@ .' Index: rpm/rpmdb/sqlite.c ============================================================================ $ cvs diff -u -r1.7 -r1.8 sqlite.c --- rpm/rpmdb/sqlite.c 30 Jun 2007 15:55:06 -0000 1.7 +++ rpm/rpmdb/sqlite.c 10 Jul 2007 17:18:12 -0000 1.8 @@ -893,7 +893,7 @@ const char * dbfile; const char * dbfname; const char * sql_errcode; - mode_t umask_safed; + mode_t umask_safed = 0002; dbiIndex dbi; SQL_DB * sqldb; size_t len; @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmhash.c ============================================================================ $ cvs diff -u -r1.2 -r1.3 rpmhash.c --- rpm/rpmio/rpmhash.c 25 May 2007 18:34:14 -0000 1.2 +++ rpm/rpmio/rpmhash.c 10 Jul 2007 17:18:13 -0000 1.3 @@ -207,8 +207,8 @@ if (!(b = findEntry(ht, key))) return 0; else return 1; } -int htGetEntry(hashTable ht, const void * key, const void *** data, - int * dataCount, const void ** tableKey) +int htGetEntry(hashTable ht, const void * key, const void * data, + int * dataCount, const void * tableKey) { hashBucket b; @@ -217,11 +217,11 @@ /[EMAIL PROTECTED]@*/ if (data) - *data = (const void **) b->data; + *(const void ***)data = (const void **) b->data; if (dataCount) *dataCount = b->dataCount; if (tableKey) - *tableKey = b->key; + *(const void **)tableKey = b->key; /[EMAIL PROTECTED]@*/ return 0; @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmhash.h ============================================================================ $ cvs diff -u -r1.2 -r1.3 rpmhash.h --- rpm/rpmio/rpmhash.h 25 May 2007 18:34:14 -0000 1.2 +++ rpm/rpmio/rpmhash.h 10 Jul 2007 17:18:13 -0000 1.3 @@ -69,17 +69,17 @@ /** * Retrieve item from hash table. - * @param ht pointer to hash table - * @param key pointer to key value - * @retval data address to store data value from bucket - * @retval dataCount address to store data value size from bucket - * @retval tableKey address to store key value from bucket (may be NULL) + * @param ht pointer to hash table + * @param key pointer to key value + * @retval *data data value from bucket + * @retval *dataCount data value size from bucket + * @retval *tableKey key value from bucket (may be NULL) * @return 0 on success, 1 if the item is not found. */ int htGetEntry(hashTable ht, const void * key, - /[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/ const void *** data, + /[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/ const void * data, /[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/ int * dataCount, - /[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/ const void ** tableKey) + /[EMAIL PROTECTED]@*/ /[EMAIL PROTECTED]@*/ const void * tableKey) /[EMAIL PROTECTED] *data, *dataCount, *tableKey @*/; /** @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org