[systemd-devel] [systemd-commits] 2 commits - man/standard-conf.xml src/vconsole
Zbigniew Jędrzejewski-Szmek
zbyszek at in.waw.pl
Thu Apr 9 06:39:25 PDT 2015
On Thu, Apr 09, 2015 at 01:13:23PM +0200, Lennart Poettering wrote:
> On Sun, 15.03.15 17:42, Zbigniew Jędrzejewski-Szmek (zbyszek at kemper.freedesktop.org) wrote:
>
> > diff --git a/src/vconsole/vconsole-setup.c b/src/vconsole/vconsole-setup.c
> > index bf681d9..fe8573f 100644
> > --- a/src/vconsole/vconsole-setup.c
> > +++ b/src/vconsole/vconsole-setup.c
> > @@ -96,16 +96,14 @@ static int enable_utf8(int fd) {
> > return r;
> > }
> >
> > -static int keymap_load(const char *vc, const char *map, const char *map_toggle, bool utf8, pid_t *_pid) {
> > +static bool keyboard_load_and_wait(const char *vc, const char *map,
> > const char *map_toggle, bool utf8) {
>
> No! Please don't!
>
> We follow kernel-style error handling, and that means returning "int"
> as return value, and negative errno values for errors.
>
> Please do not turn error cases into "bool". This is simply confusing,
> and different from all our other code.
>
> If you want to return some boolean value, you then you can also do
> that with an "int": return negative on error, 0 on false and 1 on
> true...
OK. In this case this removed some boilerplate error handling, but I
agree it's nice to be consistent with the rest of the error code.
> Will undo the part now that changes the return values of the functions
> to bool.
Thanks.
Zbyszek
More information about the systemd-devel
mailing list