From e8fd6336c1e837b2047f3b0ba2dd53056eeb13c5 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Fri, 30 Jun 2000 12:38:25 +0000 Subject: Patch from Chris Johns so the web server shuts down on error -- not exitting the system. --- cpukit/httpd/uemf.c | 7 +++++++ cpukit/httpd/webmain.c | 8 +++++--- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'cpukit') diff --git a/cpukit/httpd/uemf.c b/cpukit/httpd/uemf.c index a9302f989c..ef7c8f3135 100644 --- a/cpukit/httpd/uemf.c +++ b/cpukit/httpd/uemf.c @@ -30,6 +30,10 @@ int emfInst; /* Application instance handle */ void error(E_ARGS_DEC, int flags, char_t *fmt, ...) { + va_list arglist; + + va_start(arglist, fmt); + if (flags & E_LOG) { /* Log error message */ @@ -40,6 +44,9 @@ void error(E_ARGS_DEC, int flags, char_t *fmt, ...) /* Display message to the user */ } + + vprintf (fmt, arglist); + va_end(arglist); } /******************************************************************************/ diff --git a/cpukit/httpd/webmain.c b/cpukit/httpd/webmain.c index f61b649ced..9f467b5167 100644 --- a/cpukit/httpd/webmain.c +++ b/cpukit/httpd/webmain.c @@ -113,8 +113,10 @@ rtems_httpd_daemon() /* * Initialize the web server */ - if (initWebs() < 0) { - rtems_panic("Unable to initialize Web server !!\n"); + while (initWebs() < 0) { + printf("\nUnable to initialize Web server !!\n" + " Suspending the task. Resume to try again.\n"); + rtems_task_suspend( RTEMS_SELF); } /* @@ -137,7 +139,7 @@ rtems_httpd_daemon() memLeaks(); #endif bclose(); - rtems_task_delete( RTEMS_SELF ); + rtems_task_delete( RTEMS_SELF ); } /******************************************************************************/ -- cgit v1.2.3