Re: [systemd-devel] Antw: [EXT] D-bus connection Unknown error

2021-03-03 Thread Carlo Wood
On Wed, 03 Mar 2021 07:59:03 +0100
"Ulrich Windl"  wrote:
> > Failed to get D-bus connection: Unknown error -1  
> 
> I have no idea, but I think "unknown error" is bad programming style;
> it's like "something went wrong; go and figure...".

I can't agree more (I always go out of my way to have
excellent error reporting in my own code), but I think
that what is going on here is that -1 was interpreted
as an 'errno' - and strerror was used to print a human
readable description.

If you pass -1 to strerror it returns "Unknown error -1",
because -1 isn't a known errno. Ie if you pass 1
to it, it will say "Unknown error 1".

The real problem therefore seems a bug in the code where
the return value of a function that is either >= 0 on success
and -1 on error is interpreted as errno.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Antw: [EXT] D-bus connection Unknown error

2021-03-03 Thread Reindl Harald




Am 03.03.21 um 07:59 schrieb Ulrich Windl:

Shiju Email <994...@gmail.com> schrieb am 02.03.2021 um 22:27 in Nachricht

:

Hi, I am getting an error when any systemctl commands are issued.

Failed to get D-bus connection: Unknown error -1


I have no idea, but I think "unknown error" is bad programming style; it's
like "something went wrong; go and figure..."


it's the "you should never reach that" codepath and is at least a better 
programming style than crash when something you din't think of happens

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Antw: [EXT] D-bus connection Unknown error

2021-03-02 Thread Ulrich Windl
>>> Shiju Email <994...@gmail.com> schrieb am 02.03.2021 um 22:27 in Nachricht
:
> Hi, I am getting an error when any systemctl commands are issued.
> 
> Failed to get D-bus connection: Unknown error -1

I have no idea, but I think "unknown error" is bad programming style; it's
like "something went wrong; go and figure...".

> 
> OS Debian 8.8
> 
> I couldn’t find much traction on this in web. Appreciate your help.
> 
> Thanks
> Joe



___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/systemd-devel