list all available services with ListServices, not only already activated

Havoc Pennington hp at redhat.com
Fri Nov 19 10:59:00 PST 2004


Hi,

Some comments:

 - it looks like you're doing:
   - copy each string into a list
   - copy each string again from the list into an array
   - copy again into the message to be returned
   Maybe that can be sped up.

 - it would be good to avoid assignment and declaration on the same 
   line, so:
    int a = foo ()
   vs. 
    int a;
    a = foo()

 - bus_activation_get_activations() I would rename something 
   like get_activatable_services()

 - leaking memory in some cases, e.g.:
     activations_list = bus_activation_get_activations(activation);

     if (!activations_list)
       return FALSE;
  
     len = _dbus_list_get_length (&activations_list);
     retval = dbus_new (char *, len + 1);
 
     if (retval == NULL)
       return FALSE;
 
   "make check" should reveal this sort of bug, if you add a test to dispatch.c for your new 
   stuff.

Havoc




More information about the dbus mailing list