xfs
[Top] [All Lists]

Re: xfsprogs 2.8.4 log_misc.c patch

To: Craig Rodrigues <rodrigc@xxxxxxxxxxxxxx>
Subject: Re: xfsprogs 2.8.4 log_misc.c patch
From: Timothy Shimmin <tes@xxxxxxx>
Date: Mon, 10 Jul 2006 16:47:23 +1000
Cc: xfs@xxxxxxxxxxx, nathans@xxxxxxx
In-reply-to: <20060707182936.GA65851@crodrigues.org>
References: <20060707182936.GA65851@crodrigues.org>
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Mozilla Thunderbird 1.0.8 (X11/20060411)
Hi Craig,

Craig Rodrigues wrote:
Hi,

I'm not sure what to do about other platforms,
but on FreeBSD, I could not compile this
file in xfsprogs 2.8.4 without this patch:

Looks good.
The difference seems to be the definition of the uuid as an array of 16 unsigned chars versus
a structure with the only field as the array.
Taking the address (&) as you did, should work in both cases.


(The other alternative, I guess, would be to define explicitly the type here instead of
using the system one, since this is an ondisk type; however, I don't think that is really
warranted as a uuid should be 128 bits)


Thanks.

--Tim
Index: log_misc.c
===================================================================
RCS file: /cvs/xfs-cmds/xfsprogs/logprint/log_misc.c,v
retrieving revision 1.21
diff -u -u -r1.21 log_misc.c
--- log_misc.c  16 Jun 2006 03:52:27 -0000      1.21
+++ log_misc.c  7 Jul 2006 18:28:07 -0000
@@ -1530,7 +1530,7 @@
                in_f->ilf_dsize = in_f32->ilf_dsize;
                in_f->ilf_ino = in_f32->ilf_ino;
                /* copy biggest */
-               memcpy(in_f->ilf_u.ilfu_uuid, in_f32->ilf_u.ilfu_uuid, 
sizeof(uuid_t));
+               memcpy(&in_f->ilf_u.ilfu_uuid, &in_f32->ilf_u.ilfu_uuid, 
sizeof(uuid_t));
                in_f->ilf_blkno = in_f32->ilf_blkno;
                in_f->ilf_len = in_f32->ilf_len;
                in_f->ilf_boffset = in_f32->ilf_boffset;
@@ -1546,7 +1546,7 @@
                in_f->ilf_dsize = in_f64->ilf_dsize;
                in_f->ilf_ino = in_f64->ilf_ino;
                /* copy biggest */
-               memcpy(in_f->ilf_u.ilfu_uuid, in_f64->ilf_u.ilfu_uuid, 
sizeof(uuid_t));
+               memcpy(&in_f->ilf_u.ilfu_uuid, &in_f64->ilf_u.ilfu_uuid, 
sizeof(uuid_t));
                in_f->ilf_blkno = in_f64->ilf_blkno;
                in_f->ilf_len = in_f64->ilf_len;
                in_f->ilf_boffset = in_f64->ilf_boffset;





<Prev in Thread] Current Thread [Next in Thread>