[prev in list] [next in list] [prev in thread] [next in thread] 

List:       enlightenment-devel
Subject:    [E-devel] [patch] Ecore_Config
From:       dan sinclair <zero () perplexity ! org>
Date:       2004-01-30 2:32:14
Message-ID: 1075429933.4104.62.camel () oberon
[Download RAW message or body]

Hello,

I managed to track down my ecore config problem (I was missing the
config.db file).

The attached patch adds some extra error checking to keep the system
from segfaulting.

(I created the patch with cvs diff -u if that isn't right please let me
know the correct way)

Thanks
dan


["ecore_config.diff" (ecore_config.diff)]

Index: ecore_config.c
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_config/ecore_config.c,v
retrieving revision 1.9
diff -u -r1.9 ecore_config.c
--- ecore_config.c	26 Jan 2004 15:27:11 -0000	1.9
+++ ecore_config.c	30 Jan 2004 02:30:36 -0000
@@ -594,14 +594,20 @@
   
   __app_name = strdup(name);
   __server_local = ecore_config_init_local(name);
+  if (!__server_local) 
+    return ECORE_CONFIG_ERR_FAIL;
+
   __server_global = ecore_config_init_global(ECORE_CONFIG_GLOBAL_ID);
-  
+  if (!__server_global)
+    return ECORE_CONFIG_ERR_FAIL;
+
   __bundle_local = ecore_config_bundle_new(__server_local, "config");
 
   if((p=getenv("HOME"))) {  /* debug-only ### FIXME */
     if ((buf=malloc(PATH_MAX*sizeof(char)))) {
       snprintf(buf,PATH_MAX,"%s/.e/config.db",p);
-      ecore_config_load_file(buf);
+      if (ecore_config_load_file(buf) != 0)
+        return ECORE_CONFIG_ERR_NOFILE;
     }
     free(buf);
   }

-------------------------------------------------------
The SF.Net email is sponsored by EclipseCon 2004
Premiere Conference on Open Tools Development and Integration
See the breadth of Eclipse activity. February 3-5 in Anaheim, CA.
http://www.eclipsecon.org/osdn
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic