[Initng-svn] r4331 - in initng/trunk: plugins/bash_parser plugins/cpout plugins/debug_commands plugins/logfile plugins/ngc4 plugins/ngcs plugins/reload plugins/rlparser plugins/stcmd src
svn at initng.thinktux.net
svn at initng.thinktux.net
Thu Jun 1 12:53:57 CEST 2006
Author: jimmy
Date: Thu Jun 1 12:53:55 2006
New Revision: 4331
Modified:
initng/trunk/plugins/bash_parser/gentoo_runscript.c
initng/trunk/plugins/bash_parser/initng_bash_parser.c
initng/trunk/plugins/cpout/initng_colorprint_out.c
initng/trunk/plugins/debug_commands/initng_debug_commands.c
initng/trunk/plugins/debug_commands/print_service.c
initng/trunk/plugins/fmon/initng_fmon.c
initng/trunk/plugins/logfile/initng_logfile.c
initng/trunk/plugins/ngc4/initng_ngc4.c
initng/trunk/plugins/ngcs/ngcs.c
initng/trunk/plugins/ngcs/ngcs_client.c
initng/trunk/plugins/reload/initng_reload.c
initng/trunk/plugins/rlparser/initng_rl_parser.c
initng/trunk/plugins/stcmd/initng_stcmd.c
initng/trunk/src/initng_active_db.h
initng/trunk/src/initng_depend.c
initng/trunk/src/initng_fd.c
initng/trunk/src/initng_fd.h
initng/trunk/src/initng_fork.c
initng/trunk/src/initng_handler.c
initng/trunk/src/initng_kill_handler.c
initng/trunk/src/initng_main.c
initng/trunk/src/initng_plugin.h
initng/trunk/src/initng_plugin_callers.c
initng/trunk/src/initng_process_db.c
initng/trunk/src/initng_process_db.h
initng/trunk/src/initng_struct_data.c
Log:
Run an indent_all.sh
Modified: initng/trunk/plugins/bash_parser/gentoo_runscript.c
==============================================================================
--- initng/trunk/plugins/bash_parser/gentoo_runscript.c (original)
+++ initng/trunk/plugins/bash_parser/gentoo_runscript.c Thu Jun 1 12:53:55 2006
@@ -43,15 +43,18 @@
}
#endif
- if((fd = open("/proc/1/cmdline",O_RDONLY)) >= 0) {
- if(read(fd, buf, 6) == 6) {
- if(strncmp(buf,"initng",6) == 0)
+ if ((fd = open("/proc/1/cmdline", O_RDONLY)) >= 0)
+ {
+ if (read(fd, buf, 6) == 6)
+ {
+ if (strncmp(buf, "initng", 6) == 0)
is_initng = 1;
}
close(fd);
}
- if(!is_initng) {
+ if (!is_initng)
+ {
execve("/sbin/runscript_orig", new_argv, environ);
fprintf(stderr, "Couldn't exec /sbin/runscript_orig\n");
exit(42);
@@ -64,7 +67,7 @@
exit(1);
}
-
+
/* replace startin '.' with full path */
if (argv[1][0] == '.')
@@ -90,7 +93,7 @@
/* cut service name from the last '/' found in service path */
servname = strdup(strrchr(path, '/') + 1);
- if(strncmp(servname, "net.", 4) == 0)
+ if (strncmp(servname, "net.", 4) == 0)
servname[3] = '/';
/*printf("servname: %s\n", servname); */
@@ -136,10 +139,10 @@
/* check if command is valid */
if (strncmp(argv[2], "internal_", 9) != 0)
{
- if(strcmp(argv[2]+9, "start") == 0 ||
- strcmp(argv[2]+9, "stop") == 0 ||
- strcmp(argv[2]+9, "daemon") == 0 ||
- strcmp(argv[2]+9, "kill") == 0)
+ if (strcmp(argv[2] + 9, "start") == 0 ||
+ strcmp(argv[2] + 9, "stop") == 0 ||
+ strcmp(argv[2] + 9, "daemon") == 0 ||
+ strcmp(argv[2] + 9, "kill") == 0)
{
printf("Bad command\n");
exit(3);
@@ -155,13 +158,13 @@
/* set up the bash script to run */
char script[1024]; /* plenty of space */
-
+
strcpy(script, "#/bin/bash\n");
- if(strcmp(argv[2],"internal_setup") == 0)
+ if (strcmp(argv[2], "internal_setup") == 0)
{
+ strcat(script, "export PATH=/lib/ibin:$PATH\n");
strcat(script,
- "export PATH=/lib/ibin:$PATH\n");
- strcat(script, "[[ ${RC_GOT_FUNCTIONS} != \"yes\" ]] && source /sbin/functions.sh\n");
+ "[[ ${RC_GOT_FUNCTIONS} != \"yes\" ]] && source /sbin/functions.sh\n");
strcat(script, "[ -f /etc/conf.d/");
strcat(script, servname);
strcat(script, " ] && source /etc/conf.d/");
@@ -170,11 +173,14 @@
strcat(script, path);
strcat(script, " || exit $?\n");
strcat(script, "iregister service $SERVICE || exit $?\n");
- strcat(script, "need() { iset $SERVICE need = \"$*\" || exit $?; }\n");
+ strcat(script,
+ "need() { iset $SERVICE need = \"$*\" || exit $?; }\n");
strcat(script, "use() { iset $SERVICE use = \"$*\"|| exit $?; }\n");
strcat(script, "depend\n");
- strcat(script, "iset $SERVICE exec start = \"$SERVICE_FILE internal_start\" || exit $?\n");
- strcat(script, "for i in stop $opts; do if typeset -F \"$i\" &>/dev/null ; then iset $SERVICE exec $i = \"$SERVICE_FILE internal_$i\" || exit $?; echo $i; fi; done\n");
+ strcat(script,
+ "iset $SERVICE exec start = \"$SERVICE_FILE internal_start\" || exit $?\n");
+ strcat(script,
+ "for i in stop $opts; do if typeset -F \"$i\" &>/dev/null ; then iset $SERVICE exec $i = \"$SERVICE_FILE internal_$i\" || exit $?; echo $i; fi; done\n");
strcat(script, "idone $SERVICE || exit $?\n");
}
else
@@ -185,8 +191,9 @@
strcat(script, " command ");
strcat(script, &argv[2][9]);
strcat(script,
- " not found.\"\nreturn 1\n}\nexport PATH=/lib/ibin:$PATH\n");
- strcat(script, "[[ ${RC_GOT_FUNCTIONS} != \"yes\" ]] && source /sbin/functions.sh\n");
+ " not found.\"\nreturn 1\n}\nexport PATH=/lib/ibin:$PATH\n");
+ strcat(script,
+ "[[ ${RC_GOT_FUNCTIONS} != \"yes\" ]] && source /sbin/functions.sh\n");
strcat(script, "[ -f /etc/conf.d/");
strcat(script, servname);
strcat(script, " ] && source /etc/conf.d/");
Modified: initng/trunk/plugins/bash_parser/initng_bash_parser.c
==============================================================================
--- initng/trunk/plugins/bash_parser/initng_bash_parser.c (original)
+++ initng/trunk/plugins/bash_parser/initng_bash_parser.c Thu Jun 1 12:53:55 2006
@@ -636,11 +636,11 @@
strncat(file, name, 1020 - strlen(SCRIPT_PATH));
if (stat(file, &fstat) != 0)
{
-#if 0 /* Gentoo support disabled for now - doesn't work properly yet */
+#if 0 /* Gentoo support disabled for now - doesn't work properly yet */
strcpy(file, "/etc/init.d/");
strncat(file, name, 1020 - strlen("/etc/init.d/"));
-
- if(stat(file, &fstat) != 0)
+
+ if (stat(file, &fstat) != 0)
{
/* file not found */
return (NULL);
Modified: initng/trunk/plugins/cpout/initng_colorprint_out.c
==============================================================================
--- initng/trunk/plugins/cpout/initng_colorprint_out.c (original)
+++ initng/trunk/plugins/cpout/initng_colorprint_out.c Thu Jun 1 12:53:55 2006
@@ -537,7 +537,7 @@
}
-/* user might fore that we dont use any color */
+ /* user might fore that we dont use any color */
#ifndef FORCE_NOCOLOR
/* enable color only on terminals */
if (isatty(fileno(output)))
Modified: initng/trunk/plugins/debug_commands/initng_debug_commands.c
==============================================================================
--- initng/trunk/plugins/debug_commands/initng_debug_commands.c (original)
+++ initng/trunk/plugins/debug_commands/initng_debug_commands.c Thu Jun 1 12:53:55 2006
@@ -105,7 +105,7 @@
active_db_h *currentA;
s_call *currentC;
process_h *currentP;
- pipe_h * current_pipe;
+ pipe_h *current_pipe;
int i;
for (i = 0; i < 1024; i++)
@@ -132,10 +132,12 @@
current_pipe = NULL;
while_pipes(current_pipe, currentP)
{
- if(current_pipe->pipe[0] == i || current_pipe->pipe[1] == i)
+ if (current_pipe->pipe[0] == i
+ || current_pipe->pipe[1] == i)
{
- mprintf(&string, " %i: Used service: %s, process: %s\n", i,
- currentA->name, currentP->pt->name);
+ mprintf(&string,
+ " %i: Used service: %s, process: %s\n", i,
+ currentA->name, currentP->pt->name);
}
}
}
Modified: initng/trunk/plugins/debug_commands/print_service.c
==============================================================================
--- initng/trunk/plugins/debug_commands/print_service.c (original)
+++ initng/trunk/plugins/debug_commands/print_service.c Thu Jun 1 12:53:55 2006
@@ -193,7 +193,8 @@
static void active_db_print_process(process_h * p, char **string)
{
- pipe_h * current_pipe = NULL;
+ pipe_h *current_pipe = NULL;
+
assert(p);
if (p->pst == P_FREE)
mprintf(string, "\tOLD Process: type %s\n", p->pt->name);
@@ -225,36 +226,38 @@
while_pipes(current_pipe, p)
{
int i;
- switch(current_pipe->dir)
+
+ switch (current_pipe->dir)
{
case IN_PIPE:
- mprintf(string, "\t\tINPUT_PIPE read: %i, write: %i remote:", current_pipe->pipe[0],
- current_pipe->pipe[1]);
+ mprintf(string, "\t\tINPUT_PIPE read: %i, write: %i remote:",
+ current_pipe->pipe[0], current_pipe->pipe[1]);
break;
case OUT_PIPE:
- mprintf(string, "\t\tOUTPUT_PIPE read: %i, write: %i remote:", current_pipe->pipe[1],
- current_pipe->pipe[0]);
+ mprintf(string, "\t\tOUTPUT_PIPE read: %i, write: %i remote:",
+ current_pipe->pipe[1], current_pipe->pipe[0]);
break;
case BUFFERED_OUT_PIPE:
- mprintf(string, "\t\tBUFFERED_OUTPUT_PIPE read: %i, write: %i remote:", current_pipe->pipe[1],
- current_pipe->pipe[0]);
+ mprintf(string,
+ "\t\tBUFFERED_OUTPUT_PIPE read: %i, write: %i remote:",
+ current_pipe->pipe[1], current_pipe->pipe[0]);
break;
default:
continue;
}
-
- for(i=0;current_pipe->targets[i] > 0 && i<10;i++)
+
+ for (i = 0; current_pipe->targets[i] > 0 && i < 10; i++)
mprintf(string, " %i", current_pipe->targets[i]);
-
+
mprintf(string, "\n");
if (current_pipe->buffer && current_pipe->buffer_allocated > 0)
{
mprintf(string,
- "\t\tBuffer (%i): \n########## BUFFER ##########\n%s\n##############################\n",
- current_pipe->buffer_allocated, current_pipe->buffer);
+ "\t\tBuffer (%i): \n########## BUFFER ##########\n%s\n##############################\n",
+ current_pipe->buffer_allocated, current_pipe->buffer);
}
}
-
+
}
Modified: initng/trunk/plugins/fmon/initng_fmon.c
==============================================================================
--- initng/trunk/plugins/fmon/initng_fmon.c (original)
+++ initng/trunk/plugins/fmon/initng_fmon.c Thu Jun 1 12:53:55 2006
@@ -127,7 +127,8 @@
if (event->wd == plugins_watch && event->len
&& strstr(event->name, ".so"))
{
- W_("Plugin %s/%s has been changed, reloading initng.\n", INITNG_PLUGIN_DIR, event->name);
+ W_("Plugin %s/%s has been changed, reloading initng.\n",
+ INITNG_PLUGIN_DIR, event->name);
/* sleep 1 seconds, maby more files will be modified in short */
sleep(1);
@@ -155,38 +156,41 @@
/* check if there are any data file updated */
- if(((tmp=strstr(event->name, ".i")) && tmp[2]=='\0') || strstr(event->name, ".runlevel") || strstr(event->name, ".virtual"))
+ if (((tmp = strstr(event->name, ".i")) && tmp[2] == '\0')
+ || strstr(event->name, ".runlevel")
+ || strstr(event->name, ".virtual"))
{
/* if cache is not cleared */
if (!list_empty(&g.service_cache.list))
{
-
- /* zap failing services using this file */
- {
- active_db_h *active = NULL;
- active_db_h *safe = NULL;
- const char *fn;
- while_active_db_safe(active, safe)
+
+ /* zap failing services using this file */
{
- /* if we got a string from FROM_FILE */
- if((fn=get_string(&FROM_FILE, active)) &&
- /* and we found the file in that string */
- strstr(fn, event->name) &&
- /* and the service is marked FAILED */
- IS_FAILED(active))
+ active_db_h *active = NULL;
+ active_db_h *safe = NULL;
+ const char *fn;
+
+ while_active_db_safe(active, safe)
{
- W_("Zapping %s becouse the source %s has changed, and it might work again.\n", active->name, event->name);
+ /* if we got a string from FROM_FILE */
+ if ((fn = get_string(&FROM_FILE, active)) &&
+ /* and we found the file in that string */
+ strstr(fn, event->name) &&
+ /* and the service is marked FAILED */
+ IS_FAILED(active))
+ {
+ W_("Zapping %s becouse the source %s has changed, and it might work again.\n", active->name, event->name);
initng_active_db_free(active);
+ }
}
}
- }
-
+
W_("Source file \"%s\" changed, flushing file cache.\n",
- event->len ? event->name : "unkown");
+ event->len ? event->name : "unkown");
initng_service_cache_free_all();
}
-
-
+
+
}
}
@@ -312,4 +316,3 @@
/* remove hooks */
initng_plugin_hook_unregister(&g.FDWATCHERS, &fdh);
}
-
Modified: initng/trunk/plugins/logfile/initng_logfile.c
==============================================================================
--- initng/trunk/plugins/logfile/initng_logfile.c (original)
+++ initng/trunk/plugins/logfile/initng_logfile.c Thu Jun 1 12:53:55 2006
@@ -51,7 +51,7 @@
assert(x);
/*D_("%s process fd: # %i, %i, service %s, have something to say\n",
- x->pt->name, x->out_pipe[0], x->out_pipe[1], service->name);*/
+ x->pt->name, x->out_pipe[0], x->out_pipe[1], service->name); */
/* get the filename */
filename = get_string(&LOGFILE, service);
Modified: initng/trunk/plugins/ngc4/initng_ngc4.c
==============================================================================
--- initng/trunk/plugins/ngc4/initng_ngc4.c (original)
+++ initng/trunk/plugins/ngc4/initng_ngc4.c Thu Jun 1 12:53:55 2006
@@ -1047,7 +1047,7 @@
payload->p = (option_row *) i_calloc(1, sizeof(option_row));
memset(payload->p, 0, sizeof(option_row));
option_row *row = payload->p;
-
+
row->dt = OPTION_ROW;
strncpy(row->n, arg, 100);
strcpy(row->d, "NOT_FOUND");
@@ -1082,7 +1082,7 @@
continue;
/* if the names starts with "internal" its no value here */
- if(strncasecmp(current->opt_name, "internal", 8) == 0)
+ if (strncasecmp(current->opt_name, "internal", 8) == 0)
continue;
row->dt = OPTION_ROW;
Modified: initng/trunk/plugins/ngcs/ngcs.c
==============================================================================
--- initng/trunk/plugins/ngcs/ngcs.c (original)
+++ initng/trunk/plugins/ngcs/ngcs.c Thu Jun 1 12:53:55 2006
@@ -274,7 +274,7 @@
if (strcmp(cmd, "--watch") == 0)
{
- res->d.svc_watch.in_present = 0;
+ res->d.svc_watch.in_present = 0;
res->d.svc_watch.got_svcs = 0;
res->d.svc_watch.mode = WATCH_NORMAL;
if (ngcs_watch_service(cconn, arg, NGCS_WATCH_OUTPUT |
Modified: initng/trunk/plugins/ngcs/ngcs_client.c
==============================================================================
--- initng/trunk/plugins/ngcs/ngcs_client.c (original)
+++ initng/trunk/plugins/ngcs/ngcs_client.c Thu Jun 1 12:53:55 2006
@@ -348,7 +348,7 @@
{
ngcs_cli_req *req, *next;
- if(cconn->conn != NULL)
+ if (cconn->conn != NULL)
ngcs_conn_dispatch(cconn->conn);
list_for_each_entry_safe(req, next, &cconn->resps.list, list)
Modified: initng/trunk/plugins/reload/initng_reload.c
==============================================================================
--- initng/trunk/plugins/reload/initng_reload.c (original)
+++ initng/trunk/plugins/reload/initng_reload.c Thu Jun 1 12:53:55 2006
@@ -72,22 +72,24 @@
while_active_db(service)
{
process_h *process = NULL;
-
+
while_processes(process, service)
{
- pipe_h * current_pipe = NULL;
+ pipe_h *current_pipe = NULL;
+
while_pipes(current_pipe, process)
{
- if((current_pipe->dir == OUT_PIPE || current_pipe->dir == BUFFERED_OUT_PIPE) && current_pipe->pipe[0] == fd)
+ if ((current_pipe->dir == OUT_PIPE
+ || current_pipe->dir == BUFFERED_OUT_PIPE)
+ && current_pipe->pipe[0] == fd)
{
- W_("Wont close output_pipe fd %i, used by service \"%s\"\n", fd,
- service->name);
+ W_("Wont close output_pipe fd %i, used by service \"%s\"\n", fd, service->name);
return (TRUE);
}
- else if (current_pipe->dir == IN_PIPE && current_pipe->pipe[1] == fd)
+ else if (current_pipe->dir == IN_PIPE
+ && current_pipe->pipe[1] == fd)
{
- W_("Wont close input_pipe fd %i, used by service \"%s\"\n", fd,
- service->name);
+ W_("Wont close input_pipe fd %i, used by service \"%s\"\n", fd, service->name);
return (TRUE);
}
}
@@ -218,21 +220,22 @@
/* fill the data */
process->pid = entry.process[pnr].pid;
-
+
{
pipe_h *op = i_calloc(1, sizeof(pipe_h));
- if(!op)
+
+ if (!op)
{
free(process);
continue;
}
-
+
op->pipe[0] = entry.process[pnr].stdout1;
op->pipe[1] = entry.process[pnr].stdout2;
op->dir = BUFFERED_OUT_PIPE;
op->pipet = PIPE_STDOUT;
- op->targets[0]=1;
- op->targets[1]=2;
+ op->targets[0] = 1;
+ op->targets[1] = 2;
add_pipe(op, process);
}
process->r_code = entry.process[pnr].rcode;
@@ -344,7 +347,7 @@
memset(&entry, 0, sizeof entry);
strncpy(entry.name, current->name, MAX_SERVICE_NAME_STRING_LEN);
strncpy(entry.state, current->current_state->state_name, 100);
- if(current->type)
+ if (current->type)
strncpy(entry.type, current->type->name, 100);
memcpy(&entry.time_current_state, ¤t->time_current_state,
sizeof(struct timeval));
@@ -357,17 +360,17 @@
strncpy(entry.process[pnr].ptype, process->pt->name,
MAX_PTYPE_STRING_LEN);
entry.process[pnr].pid = process->pid;
-
- current_pipe=NULL;
+
+ current_pipe = NULL;
while_pipes(current_pipe, process)
{
entry.process[pnr].stdout1 = current_pipe->pipe[0];
entry.process[pnr].stdout2 = current_pipe->pipe[1];
-
+
/* TODO, add them all! */
break;
}
-
+
entry.process[pnr].rcode = process->r_code;
pnr++;
if (pnr >= MAX_PROCESSES)
Modified: initng/trunk/plugins/rlparser/initng_rl_parser.c
==============================================================================
--- initng/trunk/plugins/rlparser/initng_rl_parser.c (original)
+++ initng/trunk/plugins/rlparser/initng_rl_parser.c Thu Jun 1 12:53:55 2006
@@ -57,6 +57,7 @@
char *w = NULL;
char *a = NULL;
char *w_depends = NULL;
+
D_("parse_file(%s, %s);\n", filetoparse, runlevel_name);
/* allocate a new service */
Modified: initng/trunk/plugins/stcmd/initng_stcmd.c
==============================================================================
--- initng/trunk/plugins/stcmd/initng_stcmd.c (original)
+++ initng/trunk/plugins/stcmd/initng_stcmd.c Thu Jun 1 12:53:55 2006
@@ -220,26 +220,28 @@
int ret = FALSE;
/* check if we got an service */
- if ( arg && (apt = initng_active_db_find_in_name(arg)))
+ if (arg && (apt = initng_active_db_find_in_name(arg)))
{
/* zap found */
initng_active_db_free(apt);
ret = TRUE;
- } else {
+ }
+ else
+ {
/* zap all that is marked FAIL */
while_active_db_safe(apt, safe)
{
- if(IS_FAILED(apt))
+ if (IS_FAILED(apt))
{
initng_active_db_free(apt);
- ret=TRUE;
+ ret = TRUE;
}
}
}
-
+
/* also flush file cache */
cmd_reload(arg);
- return(ret);
+ return (ret);
}
Modified: initng/trunk/src/initng_active_db.h
==============================================================================
--- initng/trunk/src/initng_active_db.h (original)
+++ initng/trunk/src/initng_active_db.h Thu Jun 1 12:53:55 2006
@@ -39,12 +39,13 @@
/* the active service struct */
struct active_type
{
+
/***** IDENTIFICATION ***********/
- char *name; /* the name of this service */
- stype_h *type; /* the service type */
+ char *name; /* the name of this service */
+ stype_h *type; /* the service type */
/******* STATE ******************/
-
+
/*
* current state.
* This pointer point to a a_state_h struct containing
@@ -70,7 +71,7 @@
* here is the last rough time, and a timepoint saved.
*/
e_is last_rought_state;
- struct timeval last_rought_time; /* the time got last rught state */
+ struct timeval last_rought_time; /* the time got last rught state */
/******** SUB_OBJECTS ***********/
/* list of system processes that are connected to this service */
@@ -78,7 +79,7 @@
/* a pointer to the entry in service_cache_db that matches our service */
service_cache_h *from_service;
-
+
/*
* list of data
* Storage for all dynamic variables that are set to this
Modified: initng/trunk/src/initng_depend.c
==============================================================================
--- initng/trunk/src/initng_depend.c (original)
+++ initng/trunk/src/initng_depend.c Thu Jun 1 12:53:55 2006
@@ -146,7 +146,7 @@
if (initng_depend_deep(current, service) == TRUE)
{
D_("Service %s depends on %s\n", current->name,
- service->name);
+ service->name);
return (TRUE);
}
}
@@ -167,24 +167,25 @@
assert(check->name);
/* walk all possible entrys, use get_next with NULL becouse we want both REQUIRE and NEED */
- while((current = get_next(NULL, service, current)))
+ while ((current = get_next(NULL, service, current)))
{
/* only intreseted in two types */
- if(current->type != &REQUIRE && current->type != &NEED && current->type != &USE)
+ if (current->type != &REQUIRE && current->type != &NEED
+ && current->type != &USE)
continue;
-
+
/* to be sure */
- if(!current->t.s)
+ if (!current->t.s)
continue;
-
+
/* fix the variables */
- if(!(str = fix_variables(current->t.s, service)))
+ if (!(str = fix_variables(current->t.s, service)))
continue;
-
- if(strcmp(str, check->name)==0)
+
+ if (strcmp(str, check->name) == 0)
{
fix_free(str, current->t.s);
- return(TRUE);
+ return (TRUE);
}
fix_free(str, current->t.s);
}
@@ -266,7 +267,7 @@
active_db_h *dep = NULL;
s_data *current = NULL;
char *str = NULL;
- int count=0;
+ int count = 0;
s_call *currentH, *s = NULL;
int ret;
@@ -274,62 +275,65 @@
assert(service->name);
/* walk all possible entrys, use get_next with NULL becouse we want both REQUIRE, NEED and USE */
- while((current = get_next(NULL, service, current)))
+ while ((current = get_next(NULL, service, current)))
{
/* only intreseted in two types */
- if(current->type != &REQUIRE && current->type != &NEED && current->type != &USE)
+ if (current->type != &REQUIRE && current->type != &NEED
+ && current->type != &USE)
continue;
-
+
/* to be sure */
- if(!current->t.s)
+ if (!current->t.s)
continue;
-
+
/* this is a cache, that meens that calling this function over and over again, we dont make
- * two checks on same entry */
+ * two checks on same entry */
count++;
- if(service->depend_cache >= count)
+ if (service->depend_cache >= count)
{
D_("Dep %s is ok allredy for %s.\n", current->t.s, service->name);
continue;
}
-
-
+
+
/* tell the user what we got */
#ifdef DEBUG
- if(current->type == &REQUIRE)
+ if (current->type == &REQUIRE)
D_(" %s requires %s\n", service->name, current->t.s);
- else if(current->type == &NEED)
+ else if (current->type == &NEED)
D_(" %s needs %s\n", service->name, current->t.s);
- else if(current->type == &USE)
+ else if (current->type == &USE)
D_(" %s uses %s\n", service->name, current->t.s);
#endif
-
+
/* fix the variables */
- if(!(str = fix_variables(current->t.s, service)))
+ if (!(str = fix_variables(current->t.s, service)))
continue;
-
+
/* look if it exits already */
- if(!(dep = initng_active_db_find_by_exact_name(str)))
+ if (!(dep = initng_active_db_find_by_exact_name(str)))
{
- if(current->type == &USE)
+ if (current->type == &USE)
{
/* if its not yet found, and i dont care */
fix_free(str, current->t.s);
continue;
}
else if (current->type == &REQUIRE)
- {
+ {
F_("%s required dep \"%s\" could not start!\n", service->name,
- str);
+ str);
initng_common_mark_service(service, &REQ_NOT_FOUND);
/* if its not yet found, this dep is not reached */
fix_free(str, current->t.s);
- return(FAIL);
- } else { /* NEED */
+ return (FAIL);
+ }
+ else
+ { /* NEED */
/* if its not yet found, this dep is not reached */
fix_free(str, current->t.s);
- return(FALSE);
- }
+ return (FALSE);
+ }
}
/* if service dep on is starting, wait a bit */
@@ -356,11 +360,11 @@
/* if its marked down, and not starting, start it */
/*if (IS_DOWN(dep))
- {
+ {
initng_handler_start_service(dep);
- fix_free(str, current->t.s);
+ fix_free(str, current->t.s);
return (FALSE);
- } */
+ } */
/* if its not starting or up, return FAIL */
if (!IS_UP(dep))
@@ -371,11 +375,11 @@
}
/* GOT HERE MEENS THAT ITS OK */
- service->depend_cache=count;
+ service->depend_cache = count;
D_("Dep %s is ok for %s.\n", current->t.s, service->name);
/* continue; */
}
-
+
/* run the global plugin dep check */
while_list_safe(currentH, &g.START_DEP_MET, s)
{
@@ -396,7 +400,7 @@
}
/* if this succeds, count up one, so test wont be run again */
- service->depend_cache=count;
+ service->depend_cache = count;
}
D_("dep met for %s\n", service->name);
@@ -418,65 +422,65 @@
int ret;
int count = 0;
- /*
- * Check so all deps, that needs service, is down.
- * if there are services depending on this one still running, return false and still try
- */
- while_active_db(currentA)
- {
- count++;
- if(service->depend_cache >= count)
- continue;
-
- /* temporary increase depend_cache - will degrese before reutrn (FALSE)*/
- service->depend_cache++;
-
- if (currentA == service)
- continue;
+ /*
+ * Check so all deps, that needs service, is down.
+ * if there are services depending on this one still running, return false and still try
+ */
+ while_active_db(currentA)
+ {
+ count++;
+ if (service->depend_cache >= count)
+ continue;
- /* Does service depends on current ?? */
- if (initng_depend(currentA, service) == FALSE)
- continue;
+ /* temporary increase depend_cache - will degrese before reutrn (FALSE) */
+ service->depend_cache++;
- /* if its done, this is perfect */
- if (IS_DOWN(currentA))
- continue;
+ if (currentA == service)
+ continue;
- /* If the dep is failed, continue */
- if (IS_FAILED(currentA))
- continue;
+ /* Does service depends on current ?? */
+ if (initng_depend(currentA, service) == FALSE)
+ continue;
- /* BIG TODO.
- * This is not correct, but if we wait for a service that is
- * starting to stop, and that service is waiting for this service
- * to start, until it starts, makes a deadlock.
- *
- * Asuming that STARTING services WAITING_FOR_START_DEP are down for now.
- */
- if (IS_STARTING(currentA)
- && strstr(currentA->current_state->state_name,
- "WAITING_FOR_START_DEP"))
- continue;
+ /* if its done, this is perfect */
+ if (IS_DOWN(currentA))
+ continue;
+
+ /* If the dep is failed, continue */
+ if (IS_FAILED(currentA))
+ continue;
+
+ /* BIG TODO.
+ * This is not correct, but if we wait for a service that is
+ * starting to stop, and that service is waiting for this service
+ * to start, until it starts, makes a deadlock.
+ *
+ * Asuming that STARTING services WAITING_FOR_START_DEP are down for now.
+ */
+ if (IS_STARTING(currentA)
+ && strstr(currentA->current_state->state_name,
+ "WAITING_FOR_START_DEP"))
+ continue;
#ifdef DEBUG
- /* else RETURN */
- if (verbose)
- D_("still waiting for service %s state %s\n", currentA->name,
- currentA->current_state->state_name);
- else
- D_("still waiting for service %s state %s\n", currentA->name,
- currentA->current_state->state_name);
+ /* else RETURN */
+ if (verbose)
+ D_("still waiting for service %s state %s\n", currentA->name,
+ currentA->current_state->state_name);
+ else
+ D_("still waiting for service %s state %s\n", currentA->name,
+ currentA->current_state->state_name);
#endif
- /* if its still marked as UP and not stopping, tell the service AGAIN nice to stop */
- /*if (IS_UP(currentA))
- initng_handler_stop_service(currentA); */
+ /* if its still marked as UP and not stopping, tell the service AGAIN nice to stop */
+ /*if (IS_UP(currentA))
+ initng_handler_stop_service(currentA); */
+
+ /* no, the dependency are not met YET */
+ service->depend_cache--;
+ return (FALSE);
+ }
- /* no, the dependency are not met YET */
- service->depend_cache--;
- return (FALSE);
- }
-
/* run the global plugin dep check */
while_list_safe(current, &g.STOP_DEP_MET, s)
@@ -496,7 +500,7 @@
}
/* count this check so it wont be run again */
- service->depend_cache=count;
+ service->depend_cache = count;
}
service->depend_cache = 0;
@@ -517,28 +521,29 @@
assert(service->name);
#ifdef DEBUG
D_("initng_depend_start_deps(%s);\n", service->name);
- if(!service->from_service)
+ if (!service->from_service)
D_(" ** Data not loaded for %s!\n", service->name);
#endif
/* walk all possible entrys, use get_next with NULL becouse we want both REQUIRE and NEED */
- while((current = get_next(NULL, service, current)))
+ while ((current = get_next(NULL, service, current)))
{
/* only intreseted in two types */
- if(current->type != &REQUIRE && current->type != &NEED)
+ if (current->type != &REQUIRE && current->type != &NEED)
continue;
-
+
/* to be sure */
- if(!current->t.s)
+ if (!current->t.s)
continue;
-
+
/* tell the user what we got */
- D_(" %s %s %s\n", service->name, current->type == &REQUIRE ? "requires" : "needs", current->t.s);
-
+ D_(" %s %s %s\n", service->name,
+ current->type == &REQUIRE ? "requires" : "needs", current->t.s);
+
/* fix the variables */
- if(!(str = fix_variables(current->t.s, service)))
+ if (!(str = fix_variables(current->t.s, service)))
continue;
-
+
/* look if it exits already */
if ((dep = initng_active_db_find_by_exact_name(str)))
{
@@ -549,7 +554,7 @@
D_("Service %s is down, starting.\n", dep->name);
initng_handler_start_service(dep);
}
-
+
fix_free(str, current->t.s);
continue;
}
@@ -559,16 +564,18 @@
if (!initng_handler_start_new_service_named(str))
{
/* if its NEED */
- if(current->type == &NEED)
+ if (current->type == &NEED)
{
D_("service \"%s\" needs service \"%s\", that could not be found!\n", service->name, str);
fix_free(str, current->t.s);
continue;
- /* else its REQUIRE */
- } else {
-
+ /* else its REQUIRE */
+ }
+ else
+ {
+
F_("%s required dep \"%s\" could not start!\n", service->name,
- str);
+ str);
initng_common_mark_service(service, &REQ_NOT_FOUND);
fix_free(str, current->t.s);
return (FALSE);
Modified: initng/trunk/src/initng_fd.c
==============================================================================
--- initng/trunk/src/initng_fd.c (original)
+++ initng/trunk/src/initng_fd.c Thu Jun 1 12:53:55 2006
@@ -93,7 +93,8 @@
* This function is called when data is polled below,
* or when a process is freed ( with flush_buffer set)
*/
-void initng_fd_process_read_input(active_db_h * service, process_h * p, pipe_h * pi)
+void initng_fd_process_read_input(active_db_h * service, process_h * p,
+ pipe_h * pi)
{
int old_content_offset = pi->buffer_len;
int read_ret = 0;
@@ -182,7 +183,8 @@
if (pi->buffer_len > old_content_offset)
{
/* let all plugin take part of data */
- initng_fd_plugin_readpipe(service, p, pi->buffer + old_content_offset);
+ initng_fd_plugin_readpipe(service, p,
+ pi->buffer + old_content_offset);
}
/*if empty, dont waist memory */
@@ -245,7 +247,7 @@
/* Even if realloc failed, the buffer is still valid
and we've still reduced the length of its contents */
pi->buffer_len = 9000; /* shortened by 1000 chars */
- pi->buffer[9000] = '\0'; /* shortened by 1000 chars */
+ pi->buffer[9000] = '\0'; /* shortened by 1000 chars */
}
}
@@ -277,7 +279,7 @@
active_db_h *currentA, *qA;
s_call *currentC, *qC;
process_h *currentP, *qP;
- pipe_h * current_pipe;
+ pipe_h *current_pipe;
/* initialization */
S_;
@@ -325,8 +327,8 @@
current_pipe = NULL;
while_pipes(current_pipe, currentP)
{
- if ((current_pipe->dir == OUT_PIPE ||
- current_pipe->dir == BUFFERED_OUT_PIPE) &&
+ if ((current_pipe->dir == OUT_PIPE ||
+ current_pipe->dir == BUFFERED_OUT_PIPE) &&
current_pipe->pipe[0] > 2)
{
FD_SET(current_pipe->pipe[0], &readset);
@@ -424,21 +426,24 @@
while_processes_safe(currentP, qP, currentA)
{
current_pipe = NULL;
-
+
/* check if this fd is a pipe bound to a process */
while_pipes(current_pipe, currentP)
{
/* if this pipe is a process output pipe, and the pipe are opend, and if
* there is data on it */
- if((current_pipe->dir == OUT_PIPE || current_pipe->dir == BUFFERED_OUT_PIPE)&& current_pipe->pipe[0] > 2 &&
- FD_ISSET(current_pipe->pipe[0], &readset))
+ if ((current_pipe->dir == OUT_PIPE
+ || current_pipe->dir == BUFFERED_OUT_PIPE)
+ && current_pipe->pipe[0] > 2
+ && FD_ISSET(current_pipe->pipe[0], &readset))
{
D_("Will read from %s->start_process on fd #%i\n",
- currentA->name, current_pipe->pipe[0]);
-
+ currentA->name, current_pipe->pipe[0]);
+
/* Do the actual read from pipe */
- initng_fd_process_read_input(currentA, currentP, current_pipe);
-
+ initng_fd_process_read_input(currentA, currentP,
+ current_pipe);
+
/* Found match, that means we need to look for one less, if we've found all we should then return */
retval--;
if (retval == 0)
Modified: initng/trunk/src/initng_fd.h
==============================================================================
--- initng/trunk/src/initng_fd.h (original)
+++ initng/trunk/src/initng_fd.h Thu Jun 1 12:53:55 2006
@@ -17,7 +17,7 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-void initng_fd_process_read_input(active_db_h * service, process_h * p, pipe_h * pipe);
+void initng_fd_process_read_input(active_db_h * service, process_h * p,
+ pipe_h * pipe);
void initng_fd_close_all(void);
void initng_fd_plugin_poll(int timeout);
-
Modified: initng/trunk/src/initng_fork.c
==============================================================================
--- initng/trunk/src/initng_fork.c (original)
+++ initng/trunk/src/initng_fork.c Thu Jun 1 12:53:55 2006
@@ -47,25 +47,26 @@
* This function creates a new pipe, and creates a new
* pipe struct entry.
*/
-static pipe_h * pipe_new(e_pipet type, e_dir dir)
+static pipe_h *pipe_new(e_pipet type, e_dir dir)
{
- pipe_h * pipe_struct = i_calloc(1, sizeof(pipe_h));
- if(!pipe_struct)
- return(NULL);
-
- if(pipe(pipe_struct->pipe) != 0)
+ pipe_h *pipe_struct = i_calloc(1, sizeof(pipe_h));
+
+ if (!pipe_struct)
+ return (NULL);
+
+ if (pipe(pipe_struct->pipe) != 0)
{
F_("Failed adding pipe ! %s\n", strerror(errno));
free(pipe_struct);
- return(NULL);
+ return (NULL);
}
-
+
/* set the type */
pipe_struct->pipet = type;
pipe_struct->dir = dir;
-
+
/* return the pointer */
- return(pipe_struct);
+ return (pipe_struct);
}
pid_t initng_fork(active_db_h * service, process_h * process)
@@ -74,49 +75,49 @@
pid_t pid_fork; /* pid got from fork() */
int try_count = 0; /* Count tryings */
s_call *current = NULL;
- pipe_h * current_pipe = NULL; /* used while walking */
- pipe_h * safe = NULL;
+ pipe_h *current_pipe = NULL; /* used while walking */
+ pipe_h *safe = NULL;
assert(service);
assert(process);
-
+
/* close all existing pipes first */
while_pipes_safe(current_pipe, process, safe)
{
list_del(¤t_pipe->list);
- if(current_pipe->buffer)
+ if (current_pipe->buffer)
free(current_pipe->buffer);
free(current_pipe);
}
-
+
/* create the output pipe */
current_pipe = pipe_new(PIPE_STDOUT, BUFFERED_OUT_PIPE);
- if(current_pipe)
+ if (current_pipe)
{
/* we want this pipe to get fd 1 and 2 in the fork */
- current_pipe->targets[0]=STDOUT_FILENO;
- current_pipe->targets[1]=STDERR_FILENO;
+ current_pipe->targets[0] = STDOUT_FILENO;
+ current_pipe->targets[1] = STDERR_FILENO;
add_pipe(current_pipe, process);
}
-
+
/* create the control in pipe */
current_pipe = pipe_new(PIPE_CTRL_IN, IN_PIPE);
- if(current_pipe)
+ if (current_pipe)
{
/* we want this pipe to get fd 3, in the fork */
- current_pipe->targets[0]=3;
+ current_pipe->targets[0] = 3;
add_pipe(current_pipe, process);
}
-
+
/* create the control out pipe */
current_pipe = pipe_new(PIPE_CTRL_OUT, BUFFERED_OUT_PIPE);
- if(current_pipe)
+ if (current_pipe)
{
/* we want this pipe to get fd 4, in the fork */
- current_pipe->targets[0]=4;
+ current_pipe->targets[0] = 4;
add_pipe(current_pipe, process);
}
-
+
/* reset, used for walking later */
current_pipe = NULL;
@@ -166,14 +167,15 @@
while_pipes(current_pipe, process)
{
int i;
-
+
/* for every target */
- for(i=0; current_pipe->targets[i]>0 && i<10;i++)
+ for (i = 0; current_pipe->targets[i] > 0 && i < 10; i++)
{
/* close any conflicting one */
close(current_pipe->targets[i]);
-
- if(current_pipe->dir == OUT_PIPE || current_pipe->dir == BUFFERED_OUT_PIPE)
+
+ if (current_pipe->dir == OUT_PIPE
+ || current_pipe->dir == BUFFERED_OUT_PIPE)
{
/* duplicate the new target right */
dup2(current_pipe->pipe[1], current_pipe->targets[i]);
@@ -182,8 +184,8 @@
{
/* duplicate the input pipe instead */
dup2(current_pipe->pipe[0], current_pipe->targets[i]);
- }
-
+ }
+
/* IMPORTANT Tell the os not to close the new target on execve */
fcntl(current_pipe->targets[i], F_SETFD, 0);
}
@@ -213,22 +215,23 @@
}
else
{
-
+
/* walk all pipes and close all remote sides of pipes */
while_pipes(current_pipe, process)
{
- if(current_pipe->dir == OUT_PIPE || current_pipe->dir == BUFFERED_OUT_PIPE)
+ if (current_pipe->dir == OUT_PIPE
+ || current_pipe->dir == BUFFERED_OUT_PIPE)
{
- if(current_pipe->pipe[1] > 0)
+ if (current_pipe->pipe[1] > 0)
close(current_pipe->pipe[1]);
- current_pipe->pipe[1]=-1;
+ current_pipe->pipe[1] = -1;
}
/* close the OUTPUT end */
- else if(current_pipe->dir == IN_PIPE)
+ else if (current_pipe->dir == IN_PIPE)
{
- if(current_pipe->pipe[0] > 0)
+ if (current_pipe->pipe[0] > 0)
close(current_pipe->pipe[0]);
- current_pipe->pipe[0]=-1;
+ current_pipe->pipe[0] = -1;
}
}
Modified: initng/trunk/src/initng_handler.c
==============================================================================
--- initng/trunk/src/initng_handler.c (original)
+++ initng/trunk/src/initng_handler.c Thu Jun 1 12:53:55 2006
@@ -321,15 +321,15 @@
to_load->name);
return (to_load);
}
-
+
/* okay, now start it */
initng_handler_start_service(to_load);
return (to_load);
-
+
}
- /* get from hook */
+ /* get from hook */
if ((to_load = initng_plugin_create_new_active(service)))
{
return (to_load);
Modified: initng/trunk/src/initng_kill_handler.c
==============================================================================
--- initng/trunk/src/initng_kill_handler.c (original)
+++ initng/trunk/src/initng_kill_handler.c Thu Jun 1 12:53:55 2006
@@ -90,7 +90,9 @@
/* close all pipes */
while_pipes(current_pipe, process)
{
- if((current_pipe->dir == OUT_PIPE || current_pipe->dir == BUFFERED_OUT_PIPE)&& current_pipe->pipe[0] > 0)
+ if ((current_pipe->dir == OUT_PIPE
+ || current_pipe->dir == BUFFERED_OUT_PIPE)
+ && current_pipe->pipe[0] > 0)
{
/*
* calling initng_process_read_input, Make sure all buffers read, before closing them.
@@ -101,13 +103,13 @@
close(current_pipe->pipe[0]);
current_pipe->pipe[0] = -1;
}
-
- else if(current_pipe->dir == IN_PIPE && current_pipe->pipe[1] > 0)
+
+ else if (current_pipe->dir == IN_PIPE && current_pipe->pipe[1] > 0)
{
close(current_pipe->pipe[1]);
- current_pipe->pipe[1]= -1;
+ current_pipe->pipe[1] = -1;
}
- }
+ }
/* Check if a plugin wants to override handle_killed behavior */
if (initng_plugin_callers_handle_killed(service, process))
Modified: initng/trunk/src/initng_main.c
==============================================================================
--- initng/trunk/src/initng_main.c (original)
+++ initng/trunk/src/initng_main.c Thu Jun 1 12:53:55 2006
@@ -544,8 +544,9 @@
emergency_output = open("/dev/console", O_WRONLY);
if (emergency_output > 0)
{
- if(write(emergency_output, MESSAGE, sizeof(char) * strlen(MESSAGE)))
- ;
+ if (write
+ (emergency_output, MESSAGE, sizeof(char) * strlen(MESSAGE)))
+ ;
close(emergency_output);
}
sleep(4); /* 5 times 4 is 20 seconds */
@@ -557,9 +558,9 @@
emergency_output = open("/dev/console", O_WRONLY);
if (emergency_output > 0)
{
- if(write(emergency_output, LMESSAGE,
- sizeof(char) * strlen(LMESSAGE)))
- ;
+ if (write(emergency_output, LMESSAGE,
+ sizeof(char) * strlen(LMESSAGE)))
+ ;
close(emergency_output);
}
Modified: initng/trunk/src/initng_plugin.h
==============================================================================
--- initng/trunk/src/initng_plugin.h (original)
+++ initng/trunk/src/initng_plugin.h Thu Jun 1 12:53:55 2006
@@ -67,7 +67,7 @@
int (*start_dep_met) (active_db_h * service);
int (*stop_dep_met) (active_db_h * service);
int (*up_met) (active_db_h * service);
- active_db_h *(*new_active) (const char * name);
+ active_db_h *(*new_active) (const char *name);
} uc __attribute__ ((__transparent_union__));
Modified: initng/trunk/src/initng_plugin_callers.c
==============================================================================
--- initng/trunk/src/initng_plugin_callers.c (original)
+++ initng/trunk/src/initng_plugin_callers.c Thu Jun 1 12:53:55 2006
@@ -37,18 +37,18 @@
#include "initng_plugin.h"
-active_db_h *initng_plugin_create_new_active(const char * name)
+active_db_h *initng_plugin_create_new_active(const char *name)
{
s_call *current, *q = NULL;
- active_db_h * ret = NULL;
+ active_db_h *ret = NULL;
while_list_safe(current, &g.NEW_ACTIVE, q)
{
- ret=(*current->c.new_active) (name);
- if(ret)
- return(ret);
+ ret = (*current->c.new_active) (name);
+ if (ret)
+ return (ret);
}
- return(NULL);
+ return (NULL);
}
Modified: initng/trunk/src/initng_process_db.c
==============================================================================
--- initng/trunk/src/initng_process_db.c (original)
+++ initng/trunk/src/initng_process_db.c Thu Jun 1 12:53:55 2006
@@ -153,8 +153,9 @@
/* function to free a process_h struct */
void initng_process_db_real_free(process_h * free_this)
{
- pipe_h * current_pipe = NULL;
- pipe_h * current_pipe_safe = NULL;
+ pipe_h *current_pipe = NULL;
+ pipe_h *current_pipe_safe = NULL;
+
assert(free_this);
/* Make sure this entry are not on any list */
@@ -166,15 +167,15 @@
list_del(¤t_pipe->list);
/* close all pipes */
- if(current_pipe->pipe[0] > 0)
+ if (current_pipe->pipe[0] > 0)
close(current_pipe->pipe[0]);
- if(current_pipe->pipe[1] > 0)
- close(current_pipe->pipe[1]);
-
+ if (current_pipe->pipe[1] > 0)
+ close(current_pipe->pipe[1]);
+
/* free buffer */
- if(current_pipe->buffer)
+ if (current_pipe->buffer)
free(current_pipe->buffer);
-
+
/* free it */
free(current_pipe);
}
Modified: initng/trunk/src/initng_process_db.h
==============================================================================
--- initng/trunk/src/initng_process_db.h (original)
+++ initng/trunk/src/initng_process_db.h Thu Jun 1 12:53:55 2006
@@ -67,21 +67,21 @@
{
/* this array contains the pipe fds */
int pipe[2];
-
+
/* Whats this type?, this will be a pointer to a struct in the future */
e_pipet pipet;
-
+
/* The direction of the stream, an OUTPUT or INPUT ?? */
e_dir dir;
-
+
/* If targets set (max 10) the fd are duped after fork to match targets */
int targets[10];
-
+
/* If this pipe is a BUFFERED_OUT_PIPE stor a buffer here */
char *buffer; /* stdout buffer ## THE BEGINNING ## */
int buffer_allocated; /* chars right now allocated for this buffer */
- int buffer_len; /* the count of chars from the beginning in buffer right now */
-
+ int buffer_len; /* the count of chars from the beginning in buffer right now */
+
/* The list entry */
struct list_head list;
} pipe_h;
@@ -97,10 +97,10 @@
* example exit_code = WEXITSTATUS(process->r_code);
*/
int r_code;
-
+
/* This is a list of pipes open to this process */
pipe_h pipes;
-
+
/* small mark, this process are not freed directly this will be set to P_FREE */
e_pst pst;
Modified: initng/trunk/src/initng_struct_data.c
==============================================================================
--- initng/trunk/src/initng_struct_data.c (original)
+++ initng/trunk/src/initng_struct_data.c Thu Jun 1 12:53:55 2006
@@ -110,7 +110,8 @@
}
/* Make sure the string variable name matches if set */
- if ((!type || current->type == type ) && (!current->vn || !vn || strcasecmp(current->vn, vn)==0))
+ if ((!type || current->type == type)
+ && (!current->vn || !vn || strcasecmp(current->vn, vn) == 0))
{
return (current);
}
More information about the Initng-svn
mailing list