[PATCH 4/5] initd: Don't search the environment list if the watchdog, fd is initialized

John Crispin john at phrozen.org
Tue Sep 29 14:47:44 EDT 2020


On 29.09.20 18:22, Michael Jones wrote:
> Signed-off-by: Michael Jones <mike at meshplusplus.com>
> ---
>   watchdog.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/watchdog.c b/watchdog.c
> index 20830c3..ac5b656 100644
> --- a/watchdog.c
> +++ b/watchdog.c
> @@ -49,11 +49,11 @@ static void watchdog_timeout_cb(struct uloop_timeout *t)
>   
>   static int watchdog_open(bool cloexec)
>   {
> -    char *env = getenv("WDTFD");
> -
>       if (wdt_fd >= 0)
>           return wdt_fd;
>   
> +    char *env = getenv("WDTFD");
> +
>       if (env) {
>           DEBUG(2, "Watchdog handover: fd=%s\n", env);
>           wdt_fd = atoi(env);

this breaks c99 compliance

     John




More information about the openwrt-devel mailing list