[systemd-devel] [PATCH] Fix hostnamectl exit code

David Herrmann dh.herrmann at gmail.com
Fri Nov 28 06:49:05 PST 2014


Hi

On Fri, Nov 28, 2014 at 3:43 PM, Martin Pitt <martin.pitt at ubuntu.com> wrote:
> Hello all,
>
> while packaging 217 my integration tests for hostnamed yelled at me
> that hostnamectl fails. Indeed it exits with 1 now even though it
> succeeds.
>
> Trivial patch attached. OK to push?

Why not fix all those other occurrences with one fix by changing
hostnamectl_main() the last line from:
    return r < 0 ? EXIT_FAILURE : r;
to
    return r < 0 ? EXIT_FAILURE : 0;

Usually, >=0 means success, <0 failure, in systemd. We should not
return !=0 from main() if the return value wasn't negative.

Thanks
David


More information about the systemd-devel mailing list