[systemd-devel] [PATCH 2/3] [RFC]sd-bus: remove some dead code

Philippe De Swert philippedeswert at gmail.com
Tue Sep 16 14:53:03 PDT 2014


Hi,

On 17/09/14 00:49, David Herrmann wrote:
> Hi
> 
> On Tue, Sep 16, 2014 at 11:27 PM,  <philippedeswert at gmail.com> wrote:
>> From: Philippe De Swert <philippedeswert at gmail.com>
>>
>> The r < 0 test has been done before we reach it in the loop, and we returned
>> out of the function. So this cannot be reached. But it could actually be that
>> something is missing.
>> ---
>>  src/libsystemd/sd-bus/bus-objects.c | 2 --
>>  1 file changed, 2 deletions(-)
>>
>> diff --git a/src/libsystemd/sd-bus/bus-objects.c b/src/libsystemd/sd-bus/bus-objects.c
>> index 81c840f..48054da 100644
>> --- a/src/libsystemd/sd-bus/bus-objects.c
>> +++ b/src/libsystemd/sd-bus/bus-objects.c
>> @@ -1180,8 +1180,6 @@ static int process_get_managed_objects(
>>                          if (require_fallback && !c->is_fallback)
>>                                  continue;
>>
>> -                        if (r < 0)
>> -                                return r;
> 
> Ugh, no, there is something seriously wrong. I looks like there used
> to be a method call just before the "if (r < 0)". Or at least there
> was supposed to be a method call, otherwise this really doesn't make
> any sense.

Indeed, that's why I put it as a RFC and mentioned that it seems
something is missing ;)

> I tracked it down to:
> 
> commit 29ddb38fea134c6132e4f2dd608e9da3871eaebe
> Author: Lennart Poettering <lennart at poettering.net>
> Date:   Wed Oct 9 02:37:10 2013 +0200
> 
>     libsystemd-bus: add lightweight object vtable implementation for
> exposing objects on the bus
> 
> 
> However, there never seemed to be any method call. I'm putting Lennart
> on CC as I have no idea what that things was supposed to do. He's on
> vacation, though, so it may take a while to resolve.

Not a problem. My intention was to get some eyes on this that might know
what the intention might have been. So it already has had the result I
wanted.

Cheers,

Philippe



More information about the systemd-devel mailing list