Re: Reading little endian RPM db files on big endian machine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2005-04-29 at 09:30 -0400, Paul Gortmaker wrote:
> [Cross posted to devel list since I think this is a bugfix]
> 
> On 4/28/05, Paul Gortmaker <paul.gortmaker@xxxxxxxxx> wrote:
> I
> > I tried using dbiByteSwapped(dbi)  as an indicator as to when to
> > swap, but found it didn't think things were swapped even when they
> > were. 
> 
> Okay, well we found this, which looks a bit suspect:
> 
> dbconfig.c  in db3New:
> dbi->dbi_byteswapped = 0;   /* -1 unknown, 0 native order, 1 alien order */

> I've set the initialization to -1 in dbconfig and that, combined with
> Paul Nasrat's patch (tweaked to go against rpm-4.2.1) and it seems to
> pass basic testing.  By the way, is there anon CVS for rpm HEAD?  I
> noted the dbconfig.c init value was the same in rpm-4.3.3 and was
> interested if it was also the same in HEAD.

Oops, sorry I missed that it is also in HEAD.

http://rpm.org/cvs_help/

===================================================================
RCS file: /cvs/devel/rpm/rpmdb/dbconfig.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- dbconfig.c  23 Nov 2003 19:52:39 -0000      1.35
+++ dbconfig.c  18 Mar 2004 15:29:23 -0000      1.36
@@ -437,7 +437,7 @@
     }
     /*@=sizeoftype@*/

-    dbi->dbi_byteswapped = 0;  /* -1 unknown, 0 native order, 1 alien
order */
+    dbi->dbi_byteswapped = -1; /* -1 unknown, 0 native order, 1 alien
order */

     if (!dbi->dbi_use_dbenv) {         /* db3 dbenv is always used now.
*/
        dbi->dbi_use_dbenv = 1;

Paul

_______________________________________________
Rpm-list mailing list
Rpm-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/rpm-list

[Index of Archives]     [RPM Ecosystem]     [Linux Kernel]     [Red Hat Install]     [PAM]     [Red Hat Watch]     [Red Hat Development]     [Red Hat]     [Gimp]     [Yosemite News]     [IETF Discussion]

  Powered by Linux