OSSP CVS Repository

ossp - Difference in ossp-pkg/fsl/fsl.c versions 1.39 and 1.40
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

ossp-pkg/fsl/fsl.c 1.39 -> 1.40

--- fsl.c        2002/07/30 11:37:19     1.39
+++ fsl.c        2002/07/30 11:50:00     1.40
@@ -260,32 +260,6 @@
     return rc;
 }
 
-/* read a single file "fsl.xxx" into buffer */
-static fsl_rc_t readfile(buf_t *buffer, const char *ident)
-{
-    fsl_rc_t rc;
-    char *filename = NULL;
-
-    if (ident == NULL || buffer == NULL)
-        CU(FSL_ERR_ARG);
-    fsldebug(L2_LEVEL_TRACE, "readfile() ident=\"%s\")", ident);
-
-    if ((filename = (char *)malloc(strlen(FSL_CFGDIR) + 1 + 
-                                   strlen(FSL_PREFIX) + strlen(ident) + 1)) == NULL)
-        CU(FSL_ERR_MEM);
-    filename[0] = '\0';
-    strcat(filename, FSL_CFGDIR);
-    strcat(filename, "/");
-    strcat(filename, FSL_PREFIX);
-    strcat(filename, ident);
-
-    CU(appendfiletobuffer(buffer, filename));
-CUS:
-    if (filename != NULL)
-        free(filename);
-    return rc;
-}
-
 /* read all possible files "fsl.*" into buffer */
 static fsl_rc_t readallfiles(buf_t *buffer)
 {
@@ -328,25 +302,6 @@
     return rc;
 }
 
-/* read a single or all possible files */
-static fsl_rc_t readfileorallfiles(buf_t *buffer, const char *ident)
-{
-    fsl_rc_t rv;
-
-    if (ident == NULL)
-        return FSL_ERR_ARG;
-    fsldebug(L2_LEVEL_TRACE, "readfileorallfiles() ident=\"%s\")", ident);
-
-    if ((rv = readfile(buffer, ident)) == FSL_OK)
-        return FSL_OK;
-    if (rv != FSL_ERR_SYS || errno != ENOENT)
-        return rv;
-    fsldebug(L2_LEVEL_TRACE, "readfileorallfiles: specific file does not exist, trying all files from directory");
-    if ((rv = readallfiles(buffer)) != FSL_OK)
-        return rv;
-    return FSL_OK;
-}
-
 /* OSSP cfg node tree traversal function (recursive) */
 static void traverse(cfg_t *cfg, cfg_node_t *cfgnode)
 {
@@ -749,8 +704,8 @@
     strcat(cpISF, cpFacility);
 
     /* read configuration file(s) into buffer */
-    if ((rv = readfileorallfiles(&buf, ident)) != FSL_OK) {
-        fsldebug(L2_LEVEL_ERROR, "openlog: readfileorallfiles() for ident \"%s\" failed. Hint: last system error was \"%s\"(%d)", ident, strerror(errno), errno); CU(1); }
+    if ((rv = readallfiles(&buf)) != FSL_OK) {
+        fsldebug(L2_LEVEL_ERROR, "openlog: readallfiles() failed. Hint: last system error was \"%s\"(%d)", strerror(errno), errno); CU(1); }
 
     /* import configuration buffer into OSSP cfg node tree */
     if ((cfgrv = cfg_create(&cfg)) != CFG_OK) {

CVSTrac 2.0.1