[Initng-svn] r2682 - initng/src

svn at initng.thinktux.net svn at initng.thinktux.net
Tue Jan 3 00:34:09 CET 2006


Author: jimmy
Date: Tue Jan  3 00:34:09 2006
New Revision: 2682

Modified:
   initng/src/initng_execute.c
Log:
use initng_process_db_get instead of process_walk.


Modified: initng/src/initng_execute.c
==============================================================================
--- initng/src/initng_execute.c	(original)
+++ initng/src/initng_execute.c	Tue Jan  3 00:34:09 2006
@@ -51,23 +51,24 @@
     int ret = 0;
 
     assert(service);
-    D_("start_launch(%s);\n", service->name);
-
-    /* check so there don't exists any duplents of this one */
-    while_processes(process, service)
+    assert(type);
+    
+    D_("start_launch(%s, %s);\n", service->name, type->name);
+
+    /* Try to get the current one */
+    process=initng_process_db_get(type, service);
+    if(process!=NULL)
     {
-        if (process->pt == type)
-        {
-            F_("service %s, there exists a %i process already!\n",
-               service->name, type);
-            return (FAIL);
-        }
+	F_("There exists an \"%s\" process in \"%s\" allready.\n", process->pt->name, service->name);
+	/*assert(NULL);*/
+	return (FALSE);
     }
 
+    /* Try to create a new one */
     process = initng_process_db_new(type);
     if (!process)
     {
-        F_("start_launch(%s): unable to allocate start_process!\n",
+        F_("(%s): unable to allocate start_process!\n",
            service->name);
         return (FALSE);
     }
@@ -95,11 +96,11 @@
             break;
     }
 
-    if (ret < FALSE)
+    if (ret < FALSE) /* ret == FAIL */
         F_("initng_execute(%s): FAILED LAUNCHING, returned FAIL\n",
            service->name);
     else
-        D_("initng_execute(%s): FAILED LAUNCHING, returned FALSE\n",
+        D_("initng_execute(%s): FAILED LAUNCHING, noting font to launch.\n",
            service->name);
 
     /* on failure remove the process from list, and free it */


More information about the Initng-svn mailing list