OSSP CVS Repository

ossp - Difference in ossp-pkg/rc/rc_config.c versions 1.28 and 1.29
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

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));

CVSTrac 2.0.1