OSSP CVS Repository

ossp - Check-in [3385]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 3385
Date: 2003-May-26 18:03:56 (local)
2003-May-26 16:03:56 (UTC)
User:ms
Branch:
Comment: Preliminary exception handling repairs.
Tickets:
Inspections:
Files:
ossp-pkg/rc/rc_anal.c      1.14 -> 1.15     4 inserted, 8 deleted
ossp-pkg/rc/rc_cliopt.c      1.14 -> 1.15     5 inserted, 8 deleted
ossp-pkg/rc/rc_config.c      1.28 -> 1.29     27 inserted, 43 deleted
ossp-pkg/rc/rc_opt.c      1.6 -> 1.7     1 inserted, 2 deleted
ossp-pkg/rc/rc_proc.c      1.35 -> 1.36     0 inserted, 11 deleted

ossp-pkg/rc/rc_anal.c 1.14 -> 1.15

--- rc_anal.c    2003/05/20 15:06:41     1.14
+++ rc_anal.c    2003/05/26 16:03:56     1.15
@@ -72,10 +72,8 @@
             try {
                 analGloblocs(ppInst);
             }
-            catch(Except) {
-fprintf(stderr, "Placeholder until ex_ looping bug is fixed.\n");
-/*                rethrow;*/ /* FIXME: Ralf! Looping problem with ex_ hier! */
-            }
+            catch(Except)
+                rethrow;
         }
     }
 
@@ -157,10 +155,8 @@
         (*ppInst)->m_pszSecs = vectorCopy(pkszVector);
         (*ppInst)->m_nSecs   = vectorCount(pkszVector);
     }
-    ex_catch(Except) {
-TRACE("VectorCopy broke");
-/*        rethrow;*/
-    }
+    ex_catch(Except)
+        rethrow;
 
     return(RC_THROW(RC_OK));
 }


ossp-pkg/rc/rc_cliopt.c 1.14 -> 1.15

--- rc_cliopt.c  2002/08/01 15:22:58     1.14
+++ rc_cliopt.c  2003/05/26 16:03:57     1.15
@@ -178,9 +178,8 @@
     try {
         m_pszSecs = vectorCopy(pkszSecs);
     }
-    catch(Except) {
+    catch(Except)
         rethrow;
-    }
 
     return(RC_THROW(RC_OK));
 }
@@ -286,9 +285,8 @@
         try {                                          /* eating a new option */
             clioptProcess(cliOpt, popt_getoptarg(m_Optcon));
         }
-        catch(Except) { /* Error condition probably deserves attention */
+        catch(Except) /* Error condition probably deserves attention */
             rethrow;
-        }
     }
 
     if (cliOpt < -1) { /* The option given was not found in the index */
@@ -314,9 +312,8 @@
         clioptSetrcfile(popt_getarg(m_Optcon));
         clioptSetsecs(popt_getargs(m_Optcon));
     }
-    catch(Except) {
+    catch(Except)
         rethrow; /* Our generic response */
-    }
 
     return(RC_THROW(RC_OK));
 }
@@ -338,9 +335,9 @@
 /*        free(s_pBintab);*/              /* Deallocate cliopt and    */
 /*        s_pBintab = NULL;*/             /* clear its reference      */
 /*    }
-    catch(Except) {
+    catch(Except)
         rethrow;
-    }*/
+    */
 
     popt_freecontext(m_Optcon);         /* Free the popt context      */
     for (i = 0; i < RC_NUMOPTS; i++) {  /* Free the tuples themselves */


ossp-pkg/rc/rc_config.c 1.28 -> 1.29

--- rc_config.c  2003/05/26 08:36:40     1.28
+++ rc_config.c  2003/05/26 16:03:57     1.29
@@ -50,9 +50,8 @@
         try {                               /* then construct a new one */
             clioptNew();                    /* Member cliopt instance   */
         }
-        catch(Except) {
+        catch(Except)
             rethrow;
-        }
     }
     m_nLocks++;                             /* FIXME not threadsafe     */
 
@@ -94,9 +93,8 @@
         }
     }
 
-    catch(Except) {
+    catch(Except)
         rethrow;
-    }
 
     return(RC_THROW(RC_OK));
 }
@@ -108,22 +106,17 @@
 const char *configGetval(rc_opt_t Optname)
 {
     ex_t Except;
-    char *szTemp = NULL;
+    volatile char *oszTemp = NULL;
 
     if (m_nLocks) {                         /* Make sure config exists      */
         try {
-            if ((szTemp = (char *)clioptGetval(Optname)))
-                return((const char *)szTemp);
-/*            else if (szTemp = envoptGetval(Optname))
-                return((const char *)szTemp);
-            else if (szTemp = cnfoptGetval(Optname))
-                return((const char *)szTemp);*/
-            else
-                return(NULL);               /* Special case when not found  */
+            if ((oszTemp = (char *)clioptGetval(Optname)));
+/*            else if (oszTemp = envoptGetval(Optname));
+            else if (oszTemp = cnfoptGetval(Optname));*/
         }
-        catch(Except) {
+        catch(Except)
             rethrow;
-        }
+        return((const char *)oszTemp);
     }
     else {
         RC_THROW(RC_ERR_USE);
@@ -156,6 +149,7 @@
 const char *configGetrcfile(void)
 {
     ex_t Except;
+    volatile char *oszRcname = NULL;
 
     if (m_nLocks) {                     /* Make sure config exists   */
         try {
@@ -163,35 +157,32 @@
             /*         (2) it must be specified on the command line, */
             /* we don't bother checking the environment or conf file */
             /* contrary to the behaviour of Getval earlier           */
-            return(clioptGetrcfile());
+            oszRcname = (char *)clioptGetrcfile();
         }
-        catch(Except) {
+        catch(Except)
             rethrow;
-        }
+        return((const char *)oszRcname);
     }
-    else {
+    else
         RC_THROW(RC_ERR_USE);
-    }
-
     return(NULL);   /* Not reached */
 }
 
 const char **configGetsecs(void)
 {
     ex_t Except;
+    volatile char **opszSecname = NULL;
 
-    if (m_nLocks) {                             /* Make sure config exists   */
-        try {                                   /* FIXME Might need to check */
-            return(clioptGetsecs());            /* FIXME env, conf, configs  */
+    if (m_nLocks) {                                 /* Make sure config exists   */
+        try {                                       /* FIXME Might need to check */
+            opszSecname = (char **)clioptGetsecs(); /* FIXME env, conf, configs  */
         }
-        catch(Except) {
+        catch(Except)
             rethrow;
-        }
+        return((const char **)opszSecname);
     }
-    else {
+    else
         RC_THROW(RC_ERR_USE);
-    }
-
     return(NULL);   /* Not reached  */
 }
 
@@ -210,9 +201,8 @@
 /*        envoptParse(m_nLocks->pOpt);*/    /* Environment options   */
 /*        cnfoptParse(m_nLocks->pOpt);*/    /* Configfile options    */
     }
-    catch(Except) {
+    catch(Except)
         rethrow;
-    }
 
     return(RC_THROW(RC_OK));
 }
@@ -249,9 +239,9 @@
             bStop = TRUE;
         }
     }
-    catch(Except) {
+    catch(Except)
         rethrow;
-    }
+
     if (bStop) {                        /* Did user blow an option rule? */
         clioptPrintusage();             /* Yes, so announce it as SUE.   */
         return(RC_THROW(RC_ERR_TRM));
@@ -271,16 +261,12 @@
             bStop = TRUE;
         }
         else if (configGetval(RC_INF_VAL)) {
-/* FIXME: Ralf! If an exception is thrown (or rethrown) into this context, */
-/*        then the local handler (in five lines) either segfaults or hangs */
-fprintf(stderr, "Hello user, OSSP rc is broken if you use --info. Thanks.\n\n                                - The management\n");
-/*            configInfo();*/
+            configInfo();
             bStop = TRUE;
         }
     }
-    catch(Except) {
+    catch(Except)
         rethrow;
-    }
 
     if (bStop)                          /* Did user request a non-operation?  */
         return(RC_THROW(RC_ERR_TRM));   /* Yes, so terminate after handling.  */
@@ -360,9 +346,8 @@
         if (!configGetval(RC_DFL_VAL))
         if (!configGetval(RC_ERR_VAL))*/
     }
-    catch(Except) {
+    catch(Except)
         rethrow;
-    }
 
     return(RC_THROW(RC_OK));    /* Normal response */
 }
@@ -379,9 +364,8 @@
         try {                       /* FIXME, not thread-safe       */
             clioptDelete();
         }
-        catch(Except) {
+        catch(Except)
             rethrow;
-        }
     }
     else
         return(RC_THROW(RC_ERR_USE));


ossp-pkg/rc/rc_opt.c 1.6 -> 1.7

--- rc_opt.c     2003/05/19 19:03:41     1.6
+++ rc_opt.c     2003/05/26 16:03:57     1.7
@@ -114,9 +114,8 @@
         free(*ppOption);                /* Deallocate option and    */
         *ppOption = NULL;               /* clear its reference      */
     }
-    catch(Except) {
+    catch(Except)
         rethrow;
-    }
 
     return(RC_THROW(RC_OK));
 }


ossp-pkg/rc/rc_proc.c 1.35 -> 1.36

--- rc_proc.c    2003/05/26 11:36:16     1.35
+++ rc_proc.c    2003/05/26 16:03:57     1.36
@@ -134,17 +134,6 @@
             RC_THROW(RC_ERR_IO);
 
         try {
-
-/* SEGFAULT SEGFAULT SEGFAULT SEGFAULT SEGFAULT SEGFAULT SEGFAULT SEGFAULT */
-/*                                                                         */
-/*                      CVS TAG OSSP_RC_EXBROKEN                           */
-/*                                                                         */
-/* FIXME: Move this throw macro inside the following if block to see magic */
-/*                                                                         */
-/* SEGFAULT SEGFAULT SEGFAULT SEGFAULT SEGFAULT SEGFAULT SEGFAULT SEGFAULT */
-
-/* RC_THROW(RC_ERR_USE); */
-
             /* Append config section if it exists */
             pSec = scriptSection(pTempscript, configGetval(RC_NCF_VAL));
             if (pSec) { /* Only operate if the section lookup succeeds */

CVSTrac 2.0.1