[syslinux:master] kontron_wdt: Adjusting exit path

syslinux-bot for Erwan Velu erwan.velu at zodiacaerospace.com
Mon Oct 22 12:51:10 PDT 2012


Commit-ID:  0d254b0e4d19cdac49348e34bfda3a358eee47f5
Gitweb:     http://www.syslinux.org/commit/0d254b0e4d19cdac49348e34bfda3a358eee47f5
Author:     Erwan Velu <erwan.velu at zodiacaerospace.com>
AuthorDate: Mon, 10 Sep 2012 17:35:13 +0200
Committer:  Erwan Velu <erwanaliasr1 at gmail.com>
CommitDate: Mon, 10 Sep 2012 20:20:25 +0200

kontron_wdt: Adjusting exit path

If we fail, at least let's boot the expected image

---
 com32/modules/kontron_wdt.c |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/com32/modules/kontron_wdt.c b/com32/modules/kontron_wdt.c
index 46d37d0..6d21d7c 100644
--- a/com32/modules/kontron_wdt.c
+++ b/com32/modules/kontron_wdt.c
@@ -380,28 +380,31 @@ int main(int argc, const char *argv[]) {
         if (status & KEMPLD_WDT_CFG_ENABLE) {
                 kempld_wdt_keepalive(&wdt);
         } else {
-                ret = kempld_wdt_settimeout(&wdt);
+		ret = kempld_wdt_settimeout(&wdt);
                 if (ret) {
 			printf("Unable to setup timeout !\n");
-        		kempld_release_mutex(&pld);
-			return -1;
+			goto booting;
 		}
-                ret = kempld_wdt_start(&wdt);
+
+		ret = kempld_wdt_start(&wdt);
                 if (ret) {
 			printf("Unable to start watchdog !\n");
-        		kempld_release_mutex(&pld);
-			return -1;
+			goto booting;
 		}
 
         }
 
+	printf("Watchog armed ! Rebooting in %d seconds if no feed occurs !\n",wdt.timeout);
+
+booting:
 	/* Release Mutex to let Linux's Driver taking control */
         kempld_release_mutex(&pld);
-	printf("Watchog armed ! Rebooting in %d seconds if no feed occurs !\n",wdt.timeout);
 
 	/* Let's boot the default entry if specified */
 	if (strlen(default_label)>0) {
 		printf("Executing default label = '%s'\n",default_label);
 		syslinux_run_command(default_label);
+	} else {
+		return ret;
 	}
 }


More information about the Syslinux-commits mailing list