[PATCH] fix uid datatype in CallerInfo

David Zeuthen david at fubar.dk
Mon Mar 5 15:31:03 PST 2007


On Tue, 2007-03-06 at 00:11 +0100, Danny Kukawka wrote:
> Hi,
> 
> this patch fixes uid datatype in struct CallerInfo to avoid problems 
> on 64bit archs. dbus_bus_get_unix_user() returns 'unsigned long' and
> CallerInfo->uid is uid_t (unsigned int) which cause a compiler
> warning: 
>    'comparison is always false due to limited range of data type'. 
> 
> Btw. the following check:
> 
> if (ci->uid == ((unsigned long) -1) || dbus_error_is_set (&error))
> 
> can get changed to:
> 
> if (dbus_error_is_set (&error))
> 
> since the error is always set if the first check is true. There is no
> reason to check for DBUS_UID_UNSET (which is (unsigned long) -1).

Looks go to me. Please commit. Thanks!

     David




More information about the hal mailing list