Coda File System

Re: Error compiling Coda - fsobj::LocalSetAttr definition

From: Jan Harkes <jaharkes_at_cs.cmu.edu>
Date: Mon, 16 May 2005 16:22:46 -0400
On Mon, May 16, 2005 at 03:38:16PM -0400, Samir Patel wrote:
> Looks like the definition of LocalSetAttr isn't right somewhere.  
> Looking at the source, this is what I see:
> 
> from fso.h:
>    void LocalSetAttr(Date_t, unsigned long, Date_t,
>               uid_t, unsigned short);
> 
> and from fso_cfscalls0.cc:
>    void fsobj::LocalSetAttr(Date_t Mtime, unsigned long NewLength,
>                             Date_t NewDate, cuid_t NewOwner,
>                             unsigned short NewMode)
> 
> Looks like the uid_t is an unsigned int, while the cuid_t is a long 
> unsigned int.

Looking at the source it probably should be uid_t, that seems to be the
type that is passed between SetAttr/ConnectedSetAttr/DisconnectedSetAttr.

> Everything appears to compile fine with this change.

It probably doesn't matter much whichever way this is changed, since it
is assigned to a 'uid_t Owner' field in the VenusStat structure.

So it comes in as an unsigned int which is cast to a unsigned long int
when passed to LocalSetAttr and finally back to an unsigned int when it
is assigned to the Owner field.

By defining the function as 'uid_t' we skip the unnecessary cast to long,
which doesn't actually do anything on a 32-bit CPU.

Jan
Received on 2005-05-16 16:23:42
Binary file ./codalist-2005/7513.html matches