[systemd-devel] [PATCH 4/5] fsckd: check if plymouth is running before attempting connection

Lennart Poettering lennart at poettering.net
Tue Mar 10 03:44:56 PDT 2015


On Tue, 10.03.15 11:34, Didier Roche (didrocks at ubuntu.com) wrote:

I think it would make more sense to return 0 when ply isn't running,
and 1 if it is, no?

> 

> >From fd28f24d9eaa16737cbc8f33b8fe1a806dc291b1 Mon Sep 17 00:00:00 2001
> From: Didier Roche <didrocks at ubuntu.com>
> Date: Tue, 10 Mar 2015 10:05:19 +0100
> Subject: [PATCH 4/5] fsckd: check if plymouth is running before attempting
>  connection
> 
> ---
>  src/fsckd/fsckd.c | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/src/fsckd/fsckd.c b/src/fsckd/fsckd.c
> index f73d23b..52d69cd 100644
> --- a/src/fsckd/fsckd.c
> +++ b/src/fsckd/fsckd.c
> @@ -231,6 +231,9 @@ static int manager_connect_plymouth(Manager *m) {
>          union sockaddr_union sa = PLYMOUTH_SOCKET;
>          int r;
>  
> +        if (!plymouth_running())
> +                return 1;
> +
>          /* try to connect or reconnect if sending a message */
>          if (m->plymouth_fd >= 0)
>                  return 0;
> @@ -278,6 +281,9 @@ static int manager_send_plymouth_message(Manager *m, const char *message) {
>          r = manager_connect_plymouth(m);
>          if (r < 0)
>                  return r;
> +        /* > 0 means that plymouth isn't running, do not send any message yet */
> +        else if (r > 0)
> +                return 0;
>  
>          if (!m->plymouth_cancel_sent) {
>  
> -- 
> 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