[Initng-svn] r4030 - in initng/trunk: . src

svn at initng.thinktux.net svn at initng.thinktux.net
Sun May 7 11:56:22 CEST 2006


Author: jimmy
Date: Sun May  7 11:56:21 2006
New Revision: 4030

Modified:
   initng/trunk/TODO
   initng/trunk/plugins/provide/initng_provide.c
   initng/trunk/src/initng_global.c
   initng/trunk/src/initng_service_cache.c
   initng/trunk/src/initng_service_cache.h

Log:
Somewhat experimental variable NO_CHACHE that can be set to an active entry to mark that there is no file data to parse for this service.


Modified: initng/trunk/TODO
==============================================================================
--- initng/trunk/TODO	(original)
+++ initng/trunk/TODO	Sun May  7 11:56:21 2006
@@ -1,4 +1,5 @@
 
+service_cache_find_in_name, not using service_match ???!!!??
 
 UP_CHECK hook is not ever checked or called, fix.
 

Modified: initng/trunk/plugins/provide/initng_provide.c
==============================================================================
--- initng/trunk/plugins/provide/initng_provide.c	(original)
+++ initng/trunk/plugins/provide/initng_provide.c	Sun May  7 11:56:21 2006
@@ -95,6 +95,9 @@
 		/* set type */
 		vserv->type = &PROVIDED;
 		
+		/* make sure it wont try to parse this entry */
+		vserv->from_service = &NO_CACHE;
+		
 		/* register it */
 		if (!initng_active_db_register(vserv))
 		{

Modified: initng/trunk/src/initng_global.c
==============================================================================
--- initng/trunk/src/initng_global.c	(original)
+++ initng/trunk/src/initng_global.c	Sun May  7 11:56:21 2006
@@ -46,6 +46,9 @@
 
 	assert(argv);
 	assert(env);
+	
+	/* INITZIATE NO_CACHE_TYPE, to make sure it wont segfault when locking up data */
+	DATA_HEAD_INIT(&NO_CACHE.data);
 
 	/* zero the complete s_global */
 	memset(&g, 0, sizeof(s_global));

Modified: initng/trunk/src/initng_service_cache.c
==============================================================================
--- initng/trunk/src/initng_service_cache.c	(original)
+++ initng/trunk/src/initng_service_cache.c	Sun May  7 11:56:21 2006
@@ -40,6 +40,8 @@
 #include "initng_service_data_types.h"
 #include "initng_struct_data.h"
 
+service_cache_h NO_CACHE = { (char *) "NO_CACHE", NULL };
+
 /*
  * This is a simple list_add(&service->list), but
  * will first check for duplicates.
@@ -210,6 +212,8 @@
  * This will search and find the best possible.
  * Search for "eth" will get you "net/eth0"
  */
+ 
+ /* TODO, why not use service_match in this */
 service_cache_h *initng_service_cache_find_in_name(const char *service)
 {
 	service_cache_h *current = NULL;
@@ -293,6 +297,10 @@
 {
 	assert(to_free);
 	D_("service_db_free(%s);\n", to_free->name);
+	
+	/* obious this one cant be free */
+	if(to_free == &NO_CACHE)
+		return(TRUE);
 
 	/* change other database relations to this service to null */
 	initng_active_db_change_service_h(to_free, NULL);

Modified: initng/trunk/src/initng_service_cache.h
==============================================================================
--- initng/trunk/src/initng_service_cache.h	(original)
+++ initng/trunk/src/initng_service_cache.h	Sun May  7 11:56:21 2006
@@ -42,6 +42,9 @@
 	struct list_head list;
 };
 
+/* set, services that is virtually created not from a file to NO_CACHE */
+extern service_cache_h NO_CACHE;
+
 /* service handling functions */
 int initng_service_cache_register(service_cache_h * s);
 service_cache_h *initng_service_cache_copy(char *name, service_cache_h * s);


More information about the Initng-svn mailing list