diff mbox series

[3/5] remove irrelevant sd_booted values

Message ID 20231023022529.15081-4-felix.moessbauer@siemens.com
State Changes Requested
Headers show
Series Rework socket creation to better integrate with systemd | expand

Commit Message

Felix Moessbauer Oct. 23, 2023, 2:25 a.m. UTC
Explicit runtime checks if the system is booted with systemd are
discouraged by systemd. All sd_* functions also behave correctly when
not booted with systemd. Hence, remove these were not necessary.

Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
---
 core/swupdate.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Stefano Babic Oct. 23, 2023, 9:16 a.m. UTC | #1
On 23.10.23 04:25, 'Felix Moessbauer' via swupdate wrote:
> Explicit runtime checks if the system is booted with systemd are
> discouraged by systemd. All sd_* functions also behave correctly when
> not booted with systemd. Hence, remove these were not necessary.
> 
> Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com>
> ---
>   core/swupdate.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/core/swupdate.c b/core/swupdate.c
> index 45fa325..6f9938e 100644
> --- a/core/swupdate.c
> +++ b/core/swupdate.c
> @@ -970,9 +970,7 @@ int main(int argc, char **argv)
>   	}
>   
>   #ifdef CONFIG_SYSTEMD
> -	if (sd_booted()) {
> -		sd_notify(0, "READY=1");
> -	}
> +	sd_notify(0, "READY=1");
>   #endif
>   
>   	/*

Acked-by: Stefano Babic <stefano.babic@swupdate.org>

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/core/swupdate.c b/core/swupdate.c
index 45fa325..6f9938e 100644
--- a/core/swupdate.c
+++ b/core/swupdate.c
@@ -970,9 +970,7 @@  int main(int argc, char **argv)
 	}
 
 #ifdef CONFIG_SYSTEMD
-	if (sd_booted()) {
-		sd_notify(0, "READY=1");
-	}
+	sd_notify(0, "READY=1");
 #endif
 
 	/*