OSSP CVS Repository

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

Check-in Number: 3383
Date: 2003-May-26 10:36:40 (local)
2003-May-26 08:36:40 (UTC)
User:ms
Branch:
Comment: Fix eval mode by replacing empty tempdir parameters.
Tickets:
Inspections:
Files:
ossp-pkg/rc/rc_config.c      1.27 -> 1.28     8 inserted, 8 deleted
ossp-pkg/rc/rc_const.h      1.16 -> 1.17     1 inserted, 0 deleted

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

--- rc_config.c  2002/08/01 15:54:45     1.27
+++ rc_config.c  2003/05/26 08:36:40     1.28
@@ -29,12 +29,13 @@
 
 #include <stdlib.h>
 #include <string.h>
+#include <dirent.h>         /* For opendir(3) */
 
 #include "rc.h"
 #include "rc_config.h"
-#include "rc_const.h"               /* String constants                     */
+#include "rc_const.h"       /* String constants                     */
 
-static int m_nLocks = 0;            /* Server locks, not thread-safe FIXME  */
+static int m_nLocks = 0;    /* Server locks, not thread-safe FIXME  */
 
 
 /***************************************
@@ -294,6 +295,7 @@
 rc_return_t configDefaults(void)
 {
     ex_t Except;
+    DIR *pTmpdir = NULL; /* For detecting our temp dir with opendir(3) */
 
     try { /* Test members for empty attributes */
         if (!configGetval(RC_EVL_VAL) && !configGetval(RC_EXC_VAL) \
@@ -332,14 +334,12 @@
 
 /*        if (!configGetval(RC_QRY_VAL))*/
 
-/*
         if (!configGetval(RC_TMP_VAL)) {
-            If exists '/tmp'
-                clioptSetval(RC_TMP_VAL, "/tmp");
-            Else
-                RC_NOP;
+            pTmpdir = opendir(RC_DEF_TMP);
+            if (pTmpdir)
+                clioptSetval(RC_TMP_VAL, RC_DEF_TMP);
+            closedir(pTmpdir);
         }
-*/
 
 /*        if (!configGetval(RC_OWN_VAL))
         if (!configGetval(RC_GRP_VAL))


ossp-pkg/rc/rc_const.h 1.16 -> 1.17

--- rc_const.h   2003/05/23 14:14:09     1.16
+++ rc_const.h   2003/05/26 08:36:40     1.17
@@ -124,6 +124,7 @@
 /* Default values, do not include newlines and special chars must be escaped */
 #define RC_DEF_ON     "1"                       /* Digital switch */
 #define RC_DEF_OFF    "0"                       /* Digital switch */
+#define RC_DEF_TMP    "/tmp"                    /* Temporary directory name */
 #define RC_DEF_DEF    "^%(\\w+)[ \t]*(.*?)\\n(.*?)^$" /* Section definition */
 #define RC_DEF_NCF    "config"                  /* Config section name */
 #define RC_DEF_UIG    "-u"                      /* Section user string */

CVSTrac 2.0.1