[PATCH] fix uid datatype in CallerInfo

Danny Kukawka danny.kukawka at web.de
Mon Mar 5 15:11:31 PST 2007


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).

Danny

 hald_dbus.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: hal-fix-compiler_warning_UID_data_type.diff
Type: text/x-diff
Size: 1402 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20070306/a5b2d858/hal-fix-compiler_warning_UID_data_type.bin


More information about the hal mailing list