[systemd-devel] [PATCH] systemctl: don't update the reboot parameter if none is given

Lennart Poettering lennart at poettering.net
Wed Feb 11 11:37:32 PST 2015


On Sun, 08.02.15 20:29, Michael Olbrich (m.olbrich at pengutronix.de) wrote:

> Otherwise systemd-reboot.service will remove the parameter that was set
> before. This was broken in commit "b986229efe2cc96157aa14c37bab7843311bbef1
> systemctl: bugfix for systemctl reboot command with argument"
> ---
> 
> This is more a hack than anything else, but I'm not sure who to fix this
> otherwise.

Looks OK to me actually. Committed.

> 
> Michael
> 
>  src/systemctl/systemctl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
> index 2d70ff1de69e..7b81a9c98592 100644
> --- a/src/systemctl/systemctl.c
> +++ b/src/systemctl/systemctl.c
> @@ -2993,7 +2993,7 @@ static int start_special(sd_bus *bus, char **args) {
>                  return -EPERM;
>          }
>  
> -        if (a == ACTION_REBOOT) {
> +        if (a == ACTION_REBOOT && args[1]) {
>                  r = update_reboot_param_file(args[1]);
>                  if (r < 0)
>                          return r;
> -- 
> 2.1.4
> 
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list