[Initng-svn] r3694 - in initng/trunk: devtool plugins/also plugins/bash_launcher plugins/chdir plugins/chroot plugins/conflict plugins/cpout plugins/critical plugins/ctrlaltdel plugins/daemon plugins/daemon/test plugins/daemon_clean plugins/dbus_event plugins/debug_commands plugins/envparser plugins/find plugins/fstat plugins/history plugins/idleprobe plugins/initctl plugins/interactive plugins/iparser plugins/last plugins/limit plugins/lockfile plugins/logfile plugins/netprobe plugins/ngc4 plugins/ngcs plugins/nge plugins/pause plugins/reload plugins/renice plugins/rlparser plugins/runlevel plugins/service plugins/simple_launcher plugins/stcmd plugins/stdout plugins/suid plugins/syncron plugins/syslog plugins/unneeded plugins/usplash src tools

svn at initng.thinktux.net svn at initng.thinktux.net
Wed Apr 5 22:57:19 CEST 2006


Author: jimmy
Date: Wed Apr  5 22:57:12 2006
New Revision: 3694

Modified:
   initng/trunk/devtool/indent.sh
   initng/trunk/devtool/indent_all.sh
   initng/trunk/devtool/test_parser.c
   initng/trunk/plugins/also/initng_also.c
   initng/trunk/plugins/bash_launcher/initng_bash_launcher.c
   initng/trunk/plugins/chdir/initng_chdir.c
   initng/trunk/plugins/chroot/initng_chroot.c
   initng/trunk/plugins/conflict/initng_conflict.c
   initng/trunk/plugins/cpout/initng_colorprint_out.c
   initng/trunk/plugins/critical/initng_critical.c
   initng/trunk/plugins/ctrlaltdel/initng_ctrlaltdel.c
   initng/trunk/plugins/daemon/initng_daemon.c
   initng/trunk/plugins/daemon/test/test_pidfile.c
   initng/trunk/plugins/daemon_clean/initng_daemon_clean.c
   initng/trunk/plugins/dbus_event/dbus_nge.c
   initng/trunk/plugins/dbus_event/initng_dbusevent.c
   initng/trunk/plugins/debug_commands/initng_debug_commands.c
   initng/trunk/plugins/debug_commands/print_service.c
   initng/trunk/plugins/envparser/initng_envparser.c
   initng/trunk/plugins/find/initng_find.c
   initng/trunk/plugins/fstat/initng_fstat.c
   initng/trunk/plugins/history/initng_history.c
   initng/trunk/plugins/idleprobe/initng_idleprobe.c
   initng/trunk/plugins/initctl/initng_initctl.c
   initng/trunk/plugins/initctl/initreq.h
   initng/trunk/plugins/interactive/initng_interactive.c
   initng/trunk/plugins/iparser/initng_i_parser.c
   initng/trunk/plugins/last/initng_last.c
   initng/trunk/plugins/limit/initng_limit.c
   initng/trunk/plugins/lockfile/initng_lockfile.c
   initng/trunk/plugins/logfile/initng_logfile.c
   initng/trunk/plugins/netprobe/initng_netprobe.c
   initng/trunk/plugins/ngc4/initng_ngc4.c
   initng/trunk/plugins/ngc4/initng_ngc4.h
   initng/trunk/plugins/ngc4/libngcclient.c
   initng/trunk/plugins/ngc4/libngcclient.h
   initng/trunk/plugins/ngc4/ngc4.c
   initng/trunk/plugins/ngcs/initng_ngcs.c
   initng/trunk/plugins/ngcs/initng_ngcs.h
   initng/trunk/plugins/ngcs/initng_ngcs_cmds.c
   initng/trunk/plugins/ngcs/ngcs_common.c
   initng/trunk/plugins/ngcs/ngcs_common.h
   initng/trunk/plugins/nge/initng_nge.c
   initng/trunk/plugins/nge/libngeclient.c
   initng/trunk/plugins/nge/libngeclient.h
   initng/trunk/plugins/nge/nge.c
   initng/trunk/plugins/nge/nge_raw.c
   initng/trunk/plugins/pause/initng_pause.c
   initng/trunk/plugins/reload/initng_reload.c
   initng/trunk/plugins/reload/initng_reload.h
   initng/trunk/plugins/renice/initng_renice.c
   initng/trunk/plugins/rlparser/initng_rl_parser.c
   initng/trunk/plugins/runlevel/initng_runlevel.c
   initng/trunk/plugins/service/initng_service.c
   initng/trunk/plugins/simple_launcher/initng_simple_launcher.c
   initng/trunk/plugins/stcmd/initng_stcmd.c
   initng/trunk/plugins/stdout/initng_stdout.c
   initng/trunk/plugins/suid/initng_suid.c
   initng/trunk/plugins/syncron/initng_syncron.c
   initng/trunk/plugins/syslog/initng_syslog.c
   initng/trunk/plugins/unneeded/initng_unneeded.c
   initng/trunk/plugins/usplash/initng_usplash.c
   initng/trunk/src/initng.h
   initng/trunk/src/initng_active_db.c
   initng/trunk/src/initng_active_db.h
   initng/trunk/src/initng_active_state.c
   initng/trunk/src/initng_common.c
   initng/trunk/src/initng_control_command.c
   initng/trunk/src/initng_control_command.h
   initng/trunk/src/initng_depend.c
   initng/trunk/src/initng_env_variable.c
   initng/trunk/src/initng_env_variable.h
   initng/trunk/src/initng_error.c
   initng/trunk/src/initng_error.h
   initng/trunk/src/initng_execute.c
   initng/trunk/src/initng_fd.c
   initng/trunk/src/initng_fork.c
   initng/trunk/src/initng_fork.h
   initng/trunk/src/initng_global.c
   initng/trunk/src/initng_global.h
   initng/trunk/src/initng_handler.c
   initng/trunk/src/initng_kill_handler.c
   initng/trunk/src/initng_list.h
   initng/trunk/src/initng_load_module.c
   initng/trunk/src/initng_load_module.h
   initng/trunk/src/initng_main.c
   initng/trunk/src/initng_open_read_close.c
   initng/trunk/src/initng_plugin.h
   initng/trunk/src/initng_plugin_callers.c
   initng/trunk/src/initng_plugin_hook.c
   initng/trunk/src/initng_plugin_hook.h
   initng/trunk/src/initng_process_db.c
   initng/trunk/src/initng_process_db.h
   initng/trunk/src/initng_service_cache.c
   initng/trunk/src/initng_service_cache.h
   initng/trunk/src/initng_service_data_types.c
   initng/trunk/src/initng_service_data_types.h
   initng/trunk/src/initng_service_types.c
   initng/trunk/src/initng_signal.c
   initng/trunk/src/initng_signal.h
   initng/trunk/src/initng_static_service_types.c
   initng/trunk/src/initng_static_states.c
   initng/trunk/src/initng_string_tools.c
   initng/trunk/src/initng_struct_data.c
   initng/trunk/src/initng_struct_data.h
   initng/trunk/src/initng_system_states.h
   initng/trunk/src/initng_toolbox.c
   initng/trunk/src/main.c
   initng/trunk/tools/killall5.c
   initng/trunk/tools/mountpoint.c
   initng/trunk/tools/sulogin.c
Log:
Big patch, reindent with tabs.


Modified: initng/trunk/devtool/indent.sh
==============================================================================
--- initng/trunk/devtool/indent.sh	(original)
+++ initng/trunk/devtool/indent.sh	Wed Apr  5 22:57:12 2006
@@ -1,2 +1,2 @@
 #/bin/bash
-exec indent -ut -sob -bad -bap -bbb -bl -bli0 -nce -cli4 -cbi4 -ss -npcs -nprs -npsl -i4 -lp -nut -fc1 -c45 -nsob $*
+exec indent -ut -sob -bad -bap -bbb -bl -bli0 -nce -cli4 -cbi4 -ss -npcs -nprs -npsl -i4 -lp -fc1 -c45 -nsob $*

Modified: initng/trunk/devtool/indent_all.sh
==============================================================================
--- initng/trunk/devtool/indent_all.sh	(original)
+++ initng/trunk/devtool/indent_all.sh	Wed Apr  5 22:57:12 2006
@@ -8,14 +8,14 @@
 for file in `find . -name "*.c" -printf "%h/%f "`
 do
     echo "Indenting file: $file"
-    indent -ut -ci100 -cli0 -sob -bad -bap -bbb -bl -bli0 -nce -cli4 -cbi4 -ss -npcs -nprs -npsl -i4 -lp -nut -fc1 -c45 -nsob $file
+    indent -ut -ci100 -cli0 -sob -bad -bap -bbb -bl -bli0 -nce -cli4 -cbi4 -ss -npcs -nprs -npsl -i4 -lp -fc1 -c45 -nsob $file
 done
 
 echo "scan for headers to indent."
 for file in `find . -name "*.h" -printf "%h/%f "`
 do
     echo "Indenting file: $file"
-    indent -ut -ci100 -cli0 -sob -bad -bap -bbb -bl -bli0 -nce -cli4 -cbi4 -ss -npcs -nprs -npsl -i4 -lp -nut -fc1 -c45 -nsob $file
+    indent -ut -ci100 -cli0 -sob -bad -bap -bbb -bl -bli0 -nce -cli4 -cbi4 -ss -npcs -nprs -npsl -i4 -lp -fc1 -c45 -nsob $file
 done
 
 echo "Clean up."

Modified: initng/trunk/devtool/test_parser.c
==============================================================================
--- initng/trunk/devtool/test_parser.c	(original)
+++ initng/trunk/devtool/test_parser.c	Wed Apr  5 22:57:12 2006
@@ -20,14 +20,14 @@
 
 #include <initng.h>
 
-#include <time.h>                           /* time() */
-#include <fcntl.h>                          /* fcntl() */
-#include <sys/un.h>                         /* memmove() strcmp() */
-#include <sys/wait.h>                       /* waitpid() sa */
-#include <linux/kd.h>                       /* KDSIGACCEPT */
-#include <sys/ioctl.h>                      /* ioctl() */
-#include <stdlib.h>                         /* free() exit() */
-#include <sys/reboot.h>                     /* reboot() RB_DISABLE_CAD */
+#include <time.h>			    /* time() */
+#include <fcntl.h>			    /* fcntl() */
+#include <sys/un.h>			    /* memmove() strcmp() */
+#include <sys/wait.h>			    /* waitpid() sa */
+#include <linux/kd.h>			    /* KDSIGACCEPT */
+#include <sys/ioctl.h>			    /* ioctl() */
+#include <stdlib.h>			    /* free() exit() */
+#include <sys/reboot.h>			    /* reboot() RB_DISABLE_CAD */
 #include <termios.h>
 #include <stdio.h>
 #include <sys/klog.h>
@@ -41,7 +41,7 @@
 #include <main.h>
 #include <initng_signal.h>
 #include <initng_handler.h>
-#include <initng_execute.h>                 /* new_environ() */
+#include <initng_execute.h>		    /* new_environ() */
 #include <initng_active_db.h>
 #include <initng_load_module.h>
 #include <initng_plugin_callers.h>
@@ -95,8 +95,8 @@
 
     if (!initng_load_module_load_all())
     {
-        printf("could not load all modules\n");
-        goto exit;
+	printf("could not load all modules\n");
+	goto exit;
     }
 
     /* enable verbose mode */
@@ -109,118 +109,118 @@
 
     for (i = 1; i < argc; i++)
     {
-        int opt_type = 0;
-        char *opt = argv[i];
+	int opt_type = 0;
+	char *opt = argv[i];
 
-        if (strlen(opt) <= 1)
-            continue;
+	if (strlen(opt) <= 1)
+	    continue;
 
-        if (opt[0] == '-' && opt[1] == '-')
-        {
-            if (strlen(opt) == 2)
-                continue;
-
-            opt_type = 1;
-            opt += 2;
-        }
-        else if (opt[0] == '-')
-        {
-            opt_type = 2;
-            opt++;
-        }
-
-        if (opt_type == 1)
-        {
-            if (strcmp(opt, "verbose") == 0)
-                verbose = 1;
-
-            if (strcmp(opt, "all") == 0)
-                parse_all_files = 1;
-
-            if (strcmp(opt, "no_summary") == 0)
-                summary = 0;
-
-            if (strcmp(opt, "check_circular") == 0)
-                check_circular = 1;
-
-            if (strcmp(opt, "print_each") == 0)
-                print_each = 1;
-
-            if (strcmp(opt, "print_dep_err") == 0)
-                print_dep_err = 1;
-        }
-        else if (opt_type == 2)
-        {
-            if (strcmp(opt, "v") == 0)
-                verbose = 1;
-
-            if (strcmp(opt, "a") == 0)
-                parse_all_files = 1;
-
-            if (strcmp(opt, "s") == 0)
-                summary = 0;
-
-            if (strcmp(opt, "c") == 0)
-                check_circular = 1;
-
-            if (strcmp(opt, "p") == 0)
-                print_each = 1;
-
-            if (strcmp(opt, "d") == 0)
-                print_dep_err = 1;
-
-        }
-        else
-        {
-            free(srv_name);
-            srv_name = opt;
-        }
+	if (opt[0] == '-' && opt[1] == '-')
+	{
+	    if (strlen(opt) == 2)
+		continue;
+
+	    opt_type = 1;
+	    opt += 2;
+	}
+	else if (opt[0] == '-')
+	{
+	    opt_type = 2;
+	    opt++;
+	}
+
+	if (opt_type == 1)
+	{
+	    if (strcmp(opt, "verbose") == 0)
+		verbose = 1;
+
+	    if (strcmp(opt, "all") == 0)
+		parse_all_files = 1;
+
+	    if (strcmp(opt, "no_summary") == 0)
+		summary = 0;
+
+	    if (strcmp(opt, "check_circular") == 0)
+		check_circular = 1;
+
+	    if (strcmp(opt, "print_each") == 0)
+		print_each = 1;
+
+	    if (strcmp(opt, "print_dep_err") == 0)
+		print_dep_err = 1;
+	}
+	else if (opt_type == 2)
+	{
+	    if (strcmp(opt, "v") == 0)
+		verbose = 1;
+
+	    if (strcmp(opt, "a") == 0)
+		parse_all_files = 1;
+
+	    if (strcmp(opt, "s") == 0)
+		summary = 0;
+
+	    if (strcmp(opt, "c") == 0)
+		check_circular = 1;
+
+	    if (strcmp(opt, "p") == 0)
+		print_each = 1;
+
+	    if (strcmp(opt, "d") == 0)
+		print_dep_err = 1;
+
+	}
+	else
+	{
+	    free(srv_name);
+	    srv_name = opt;
+	}
     }
 
     if (parse_all_files == 1)
     {
-        result = parse_all("system");
-        result &= parse_all("daemon");
-        result &= parse_all("net");
-        //parse_all("debug");
-        result &= parse_all("daemon/bluetooth");
+	result = parse_all("system");
+	result &= parse_all("daemon");
+	result &= parse_all("net");
+	//parse_all("debug");
+	result &= parse_all("daemon/bluetooth");
     }
     else
     {
-        result = load_service(srv_name, 0);
-        if (check_circular == 1)
-            result &= check_deps(NULL, srv_name, 0);
-
-        if (summary == 1)
-        {
-            if (result == NOT_OK)
-            {
-                printf("Service %s is failed because:\n", srv_name);
-                while_service_cache(current)
-                {
-                    switch (get_int(&STATUS, current))
-                    {
-                        case PARSE_ERR:
-                            printf("%s has parsing errors or service file was not found\n", current->name);
-                            break;
-                        case CIRCULAR_ERR:
-                            printf("%s has circular dependency with %s\n",
-                                   current->name,
-                                   get_string(&CIRCULAR, current));
-                            break;
-                        case DEPEND_ERR:
-                            if (print_dep_err == 1)
-                                printf("%s has one of its depends failed\n",
-                                       current->name);
-                            break;
-                        default:
-                            break;
-                    };
-                }
-            }
-            else
-                printf("Service %s is ok.\n", srv_name);
-        }
+	result = load_service(srv_name, 0);
+	if (check_circular == 1)
+	    result &= check_deps(NULL, srv_name, 0);
+
+	if (summary == 1)
+	{
+	    if (result == NOT_OK)
+	    {
+		printf("Service %s is failed because:\n", srv_name);
+		while_service_cache(current)
+		{
+		    switch (get_int(&STATUS, current))
+		    {
+			case PARSE_ERR:
+			    printf("%s has parsing errors or service file was not found\n", current->name);
+			    break;
+			case CIRCULAR_ERR:
+			    printf("%s has circular dependency with %s\n",
+				   current->name,
+				   get_string(&CIRCULAR, current));
+			    break;
+			case DEPEND_ERR:
+			    if (print_dep_err == 1)
+				printf("%s has one of its depends failed\n",
+				       current->name);
+			    break;
+			default:
+			    break;
+		    };
+		}
+	    }
+	    else
+		printf("Service %s is ok.\n", srv_name);
+	}
 
     }
 
@@ -245,28 +245,28 @@
 
     d = opendir(tmp);
     if (!d)
-        return result;
+	return result;
 
     result = OK;
 
     while ((e = readdir(d)))
     {
-        if (e->d_name[0] == '.')
-            continue;
+	if (e->d_name[0] == '.')
+	    continue;
 
-        /* get string length */
-        i = strlen(e->d_name);
+	/* get string length */
+	i = strlen(e->d_name);
 
-        /* Check that is it a .i file */
-        if (e->d_name[i - 1] != 'i' && e->d_name[i - 2] != '.')
-            continue;
-
-        strncpy(tmp, e->d_name, i - 2);
-        tmp[i - 2] = '\0';
-        sprintf(tmp2, "%s/%s", dirname, tmp);
-        result &= load_service(tmp2, 0);
-        if (check_circular == 1)
-            result &= check_deps(NULL, tmp2, 0);
+	/* Check that is it a .i file */
+	if (e->d_name[i - 1] != 'i' && e->d_name[i - 2] != '.')
+	    continue;
+
+	strncpy(tmp, e->d_name, i - 2);
+	tmp[i - 2] = '\0';
+	sprintf(tmp2, "%s/%s", dirname, tmp);
+	result &= load_service(tmp2, 0);
+	if (check_circular == 1)
+	    result &= check_deps(NULL, tmp2, 0);
     }
 
     closedir(d);
@@ -284,40 +284,40 @@
 
     if (verbose == 1)
     {
-        SPACE;
-        printf("Probeparsing: %s\n", name);
+	SPACE;
+	printf("Probeparsing: %s\n", name);
     }
 
     service = initng_common_parse_service(name);
     if (!service)
     {
-        /* unload all modules 
-           initng_unload_all_modules();
-           initng_free();
-           exit(2);
-         */
-        if (verbose == 1)
-        {
-            SPACE;
-            printf("%s - failed\n", name);
-        }
-        service = initng_service_cache_new(name,
-                                           initng_service_types_get
-                                           ("service"));
-        if (service)
-        {
-            initng_service_cache_add(service);
-            set_int(&STATUS, service, PARSE_ERR);
-        }
-        return result;
+	/* unload all modules 
+	   initng_unload_all_modules();
+	   initng_free();
+	   exit(2);
+	 */
+	if (verbose == 1)
+	{
+	    SPACE;
+	    printf("%s - failed\n", name);
+	}
+	service = initng_service_cache_new(name,
+					   initng_service_types_get
+					   ("service"));
+	if (service)
+	{
+	    initng_service_cache_add(service);
+	    set_int(&STATUS, service, PARSE_ERR);
+	}
+	return result;
     }
 
     if (print_each == 1)
     {
-        char *string = service_db_print(service);
+	char *string = service_db_print(service);
 
-        printf("%s\n", string);
-        free(string);
+	printf("%s\n", string);
+	free(string);
     }
 
     result = OK;
@@ -327,21 +327,21 @@
 
     while ((string = get_next_string(&NEED, service, &itt)))
     {
-        tmp_service = initng_service_cache_find_by_name(string);
-        if (!tmp_service || (srv_status = get_int(&STATUS, tmp_service)) == 0)
-            result &= load_service(string, level + 1);
-        else
-            result &= (srv_status > NOT_OK) ? OK : NOT_OK;
+	tmp_service = initng_service_cache_find_by_name(string);
+	if (!tmp_service || (srv_status = get_int(&STATUS, tmp_service)) == 0)
+	    result &= load_service(string, level + 1);
+	else
+	    result &= (srv_status > NOT_OK) ? OK : NOT_OK;
     }
 
 
     if (verbose == 1)
     {
-        SPACE;
-        if (result == NOT_OK)
-            printf("%s - failed\n", name);
-        else
-            printf("%s - ok\n", name);
+	SPACE;
+	if (result == NOT_OK)
+	    printf("%s - failed\n", name);
+	else
+	    printf("%s - ok\n", name);
     }
 
     set_int(&STATUS, service, (result == NOT_OK) ? DEPEND_ERR : OK);
@@ -361,76 +361,76 @@
 
     if (verbose == 1)
     {
-        SPACE;
-        printf("Checking: %s\n", dep);
+	SPACE;
+	printf("Checking: %s\n", dep);
     }
 
     if (!service)
-        status = NOT_OK;
+	status = NOT_OK;
     else
-        status = get_int(&STATUS, service);
+	status = get_int(&STATUS, service);
 
     if (status == CHECKED)
-        result = OK;
+	result = OK;
 
     if (status == OK)
     {
-        s_data *itt = NULL;
+	s_data *itt = NULL;
 
-        result = OK;
+	result = OK;
 
-        my_list = (const char **) i_calloc(level + 2, sizeof(char *));
-        my_list[level + 1] = NULL;
+	my_list = (const char **) i_calloc(level + 2, sizeof(char *));
+	my_list[level + 1] = NULL;
 
-        while ((string = get_next_string(&NEED, service, &itt)))
-        {
-            tmp_result = OK;
-
-            for (j = 0; dep_list && dep_list[j]; j++)
-            {
-                if (strcmp(string, dep_list[j]) == 0)
-                {
-                    status = CIRCULAR_ERR;
-                    set_int(&STATUS, service, status);
-                    set_string(&CIRCULAR, service, i_strdup(string));
-                    if (verbose == 1)
-                    {
-                        SPACE;
-                        printf("Service %s has circular dependency with %s\n",
-                               dep, string);
-                    }
-                    tmp_result = NOT_OK;
-                    break;
-                }
-                my_list[j] = dep_list[j];
-            }
-
-            if (tmp_result == OK)
-            {
-                my_list[j] = dep;
-                tmp_result = check_deps(my_list, string, level + 1);
-            }
-
-            result &= tmp_result;
-        }
-        free(my_list);
+	while ((string = get_next_string(&NEED, service, &itt)))
+	{
+	    tmp_result = OK;
+
+	    for (j = 0; dep_list && dep_list[j]; j++)
+	    {
+		if (strcmp(string, dep_list[j]) == 0)
+		{
+		    status = CIRCULAR_ERR;
+		    set_int(&STATUS, service, status);
+		    set_string(&CIRCULAR, service, i_strdup(string));
+		    if (verbose == 1)
+		    {
+			SPACE;
+			printf("Service %s has circular dependency with %s\n",
+			       dep, string);
+		    }
+		    tmp_result = NOT_OK;
+		    break;
+		}
+		my_list[j] = dep_list[j];
+	    }
+
+	    if (tmp_result == OK)
+	    {
+		my_list[j] = dep;
+		tmp_result = check_deps(my_list, string, level + 1);
+	    }
+
+	    result &= tmp_result;
+	}
+	free(my_list);
     }
 
     if (verbose == 1)
     {
-        SPACE;
-        if (result == NOT_OK)
-            printf("%s - failed\n", dep);
-        else
-            printf("%s - ok\n", dep);
+	SPACE;
+	if (result == NOT_OK)
+	    printf("%s - failed\n", dep);
+	else
+	    printf("%s - ok\n", dep);
     }
 
     status = (result ==
-              OK) ? CHECKED : ((status !=
-                                CIRCULAR_ERR) ? DEPEND_ERR : CIRCULAR_ERR);
+	      OK) ? CHECKED : ((status !=
+				CIRCULAR_ERR) ? DEPEND_ERR : CIRCULAR_ERR);
 
     if (service)
-        set_int(&STATUS, service, status);
+	set_int(&STATUS, service, status);
 
     return result;
 }

Modified: initng/trunk/plugins/also/initng_also.c
==============================================================================
--- initng/trunk/plugins/also/initng_also.c	(original)
+++ initng/trunk/plugins/also/initng_also.c	Wed Apr  5 22:57:12 2006
@@ -21,7 +21,7 @@
 
 
 #include <stdio.h>
-#include <stdlib.h>                         /* free() exit() */
+#include <stdlib.h>			    /* free() exit() */
 #include <string.h>
 #include <assert.h>
 
@@ -52,65 +52,65 @@
     /* if service is loading, start all in ALSO_START */
     if (IS_STARTING(service))
     {
-        tmp = NULL;
-        s_data *itt = NULL;
+	tmp = NULL;
+	s_data *itt = NULL;
 
-        while ((tmp = get_next_string(&ALSO_START, service, &itt)))
-        {
-            char *fixed = NULL;
-
-            fixed = fix_variables(tmp, service);
-            if ((current = initng_active_db_find_by_name(fixed)))
-            {
-                if (!initng_handler_start_service(current))
-                {
-                    F_("Failed to also_start %s.\n", fixed);
-                    free(fixed);
-                    continue;
-                }
-                D_("Service also_start %s already running.\n", fixed);
-                free(fixed);
-                continue;
-            }
-
-            if (!initng_handler_start_new_service_named(fixed))
-            {
-                F_("%s also_start %s could not start!\n", service->name,
-                   fixed);
-                initng_handler_stop_service(service);
-                free(fixed);
-                return (FALSE);
-            }
-        }
-        return (TRUE);
+	while ((tmp = get_next_string(&ALSO_START, service, &itt)))
+	{
+	    char *fixed = NULL;
+
+	    fixed = fix_variables(tmp, service);
+	    if ((current = initng_active_db_find_by_name(fixed)))
+	    {
+		if (!initng_handler_start_service(current))
+		{
+		    F_("Failed to also_start %s.\n", fixed);
+		    free(fixed);
+		    continue;
+		}
+		D_("Service also_start %s already running.\n", fixed);
+		free(fixed);
+		continue;
+	    }
+
+	    if (!initng_handler_start_new_service_named(fixed))
+	    {
+		F_("%s also_start %s could not start!\n", service->name,
+		   fixed);
+		initng_handler_stop_service(service);
+		free(fixed);
+		return (FALSE);
+	    }
+	}
+	return (TRUE);
     }
 
     /* if this service is stopping, stop all in ALSO_STOP */
     if (IS_STOPPING(service))
     {
-        /* Handle ALSO_STOP */
-        tmp = NULL;
-        s_data *itt = NULL;
-
-        while ((tmp = get_next_string(&ALSO_STOP, service, &itt)))
-        {
-            char *fixed = NULL;
-
-            fixed = fix_variables(tmp, service);
-            if ((current = initng_active_db_find_by_name(fixed)))
-            {
-                /* Tell this verbose */
-                D_("service %s also stops %s\n", service->name, fixed);
-
-                if (!initng_handler_stop_service(current))
-                {
-                    F_("Could not stop also_stop service %s\n",
-                       current->name);
-                }
-            }
-            free(fixed);
-        }
-        return (TRUE);
+	/* Handle ALSO_STOP */
+	tmp = NULL;
+	s_data *itt = NULL;
+
+	while ((tmp = get_next_string(&ALSO_STOP, service, &itt)))
+	{
+	    char *fixed = NULL;
+
+	    fixed = fix_variables(tmp, service);
+	    if ((current = initng_active_db_find_by_name(fixed)))
+	    {
+		/* Tell this verbose */
+		D_("service %s also stops %s\n", service->name, fixed);
+
+		if (!initng_handler_stop_service(current))
+		{
+		    F_("Could not stop also_stop service %s\n",
+		       current->name);
+		}
+	    }
+	    free(fixed);
+	}
+	return (TRUE);
     }
 
     return (TRUE);
@@ -122,8 +122,8 @@
     D_("module_init();\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     initng_service_data_types_add(&ALSO_START);

Modified: initng/trunk/plugins/bash_launcher/initng_bash_launcher.c
==============================================================================
--- initng/trunk/plugins/bash_launcher/initng_bash_launcher.c	(original)
+++ initng/trunk/plugins/bash_launcher/initng_bash_launcher.c	Wed Apr  5 22:57:12 2006
@@ -20,12 +20,12 @@
 
 #include <initng.h>
 
-#include <time.h>                           /* time() */
-#include <fcntl.h>                          /* fcntl() */
-#include <unistd.h>                         /* execv() pipe() usleep() pause() chown() */
-#include <sys/wait.h>                       /* waitpid() sa */
-#include <sys/ioctl.h>                      /* ioctl() */
-#include <stdlib.h>                         /* free() exit() */
+#include <time.h>			    /* time() */
+#include <fcntl.h>			    /* fcntl() */
+#include <unistd.h>			    /* execv() pipe() usleep() pause() chown() */
+#include <sys/wait.h>			    /* waitpid() sa */
+#include <sys/ioctl.h>			    /* ioctl() */
+#include <stdlib.h>			    /* free() exit() */
 #include <stdio.h>
 #include <string.h>
 #include <assert.h>
@@ -58,9 +58,9 @@
 };
 
 static void bash_this(const char *bash_code, active_db_h * s,
-                      const char *args);
+		      const char *args);
 static int bash_exec(process_h * process_to_exec, active_db_h * s,
-                     const char *script, const char *args);
+		     const char *script, const char *args);
 
 
 static int initng_bash(active_db_h * service, process_h * process)
@@ -73,7 +73,7 @@
 
     /* WE ARE EXECUTING A START MULTILINE_STRING */
     if (!(e = get_string_var(&SCRIPT, process->pt->name, service)))
-        return (FALSE);
+	return (FALSE);
 
     /* get the arguments if any */
     args = get_string_var(&SCRIPT_OPT, process->pt->name, service);
@@ -84,7 +84,7 @@
 
 
 static void bash_this(const char *bash_code, active_db_h * s,
-                      const char *args)
+		      const char *args)
 {
     /* temporary argv */
     char **argtmp;
@@ -106,7 +106,7 @@
      */
 
     if (args)
-        argtmp[3] = i_strdup(args);
+	argtmp[3] = i_strdup(args);
     argtmp[4] = NULL;
 
     /* execute */
@@ -114,14 +114,14 @@
 
     /* free them all */
     {
-        int i = 0;
+	int i = 0;
 
-        while (argtmp[i])
-        {
-            free(argtmp[i]);
-            argtmp[i] = NULL;
-            i++;
-        }
+	while (argtmp[i])
+	{
+	    free(argtmp[i]);
+	    argtmp[i] = NULL;
+	    i++;
+	}
     }
     free(argtmp);
 
@@ -133,36 +133,36 @@
 
     /* exit 1, to emit an false signal */
     _exit(1);
-}                                           /* end fork_and_exec() */
+}					    /* end fork_and_exec() */
 
 
 
 static int bash_exec(process_h * process_to_exec, active_db_h * s,
-                     const char *script, const char *args)
+		     const char *script, const char *args)
 {
 
     /* called from inside the service directory, return the PID or 0 on error */
 
     /* This is the real service kicker */
-    pid_t pid_fork;             /* pid got from fork() */
+    pid_t pid_fork;		/* pid got from fork() */
 
     assert(process_to_exec);
     assert(script);
 
     if ((pid_fork = initng_fork(s, process_to_exec)) == 0)
     {
-        /* execute code */
-        bash_this(script, s, args);
+	/* execute code */
+	bash_this(script, s, args);
 
-        /* Bash This should NOT return! */
-        _exit(33);
+	/* Bash This should NOT return! */
+	_exit(33);
     }
 
     /* save pid of fork */
     D_("FROM_FORK Forkstarted pid %i.\n", pid_fork);
 
     if (pid_fork > 1)
-        return (TRUE);
+	return (TRUE);
 
     F_("bash_exec, did not get a pid!\n");
     process_to_exec->pid = 0;
@@ -174,8 +174,8 @@
     D_("initng_simple_plugin: module_init();\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     initng_service_data_types_add(&SCRIPT);

Modified: initng/trunk/plugins/chdir/initng_chdir.c
==============================================================================
--- initng/trunk/plugins/chdir/initng_chdir.c	(original)
+++ initng/trunk/plugins/chdir/initng_chdir.c	Wed Apr  5 22:57:12 2006
@@ -49,16 +49,16 @@
     D_("do_chdir!\n");
     if (!(tmp = get_string(&CHDIR, s)))
     {
-        D_("CHDIR not set!\n");
-        return (TRUE);
+	D_("CHDIR not set!\n");
+	return (TRUE);
     }
     tmp_fixed = fix_variables(tmp, s);
     D_("CHDIR TO %s\n", tmp_fixed);
     if (chdir(tmp_fixed) == -1)
     {
-        F_("Chdir failed with %s\n", strerror(errno));
-        free(tmp_fixed);
-        return (FALSE);
+	F_("Chdir failed with %s\n", strerror(errno));
+	free(tmp_fixed);
+	return (FALSE);
     }
     free(tmp_fixed);
     return (TRUE);
@@ -70,8 +70,8 @@
     D_("module_init(CHDIR);\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     initng_service_data_types_add(&CHDIR);

Modified: initng/trunk/plugins/chroot/initng_chroot.c
==============================================================================
--- initng/trunk/plugins/chroot/initng_chroot.c	(original)
+++ initng/trunk/plugins/chroot/initng_chroot.c	Wed Apr  5 22:57:12 2006
@@ -49,8 +49,8 @@
     D_("do_suid!\n");
     if (!(tmp = get_string(&CHROOT, s)))
     {
-        D_("SUID not set!\n");
-        return (TRUE);
+	D_("SUID not set!\n");
+	return (TRUE);
     }
 
     /* fix ev.${VARIABLES} */
@@ -58,15 +58,15 @@
 
     if (chdir(tmp_fixed) == -1)
     {
-        F_("Chdir %s failed with %s\n", tmp_fixed, strerror(errno));
-        free(tmp_fixed);
-        return (FALSE);
+	F_("Chdir %s failed with %s\n", tmp_fixed, strerror(errno));
+	free(tmp_fixed);
+	return (FALSE);
     }
     if (chroot(tmp_fixed) == -1)
     {
-        F_("Chroot %s failed with %s\n", tmp_fixed, strerror(errno));
-        free(tmp_fixed);
-        return (FALSE);
+	F_("Chroot %s failed with %s\n", tmp_fixed, strerror(errno));
+	free(tmp_fixed);
+	return (FALSE);
     }
     free(tmp_fixed);
     return (TRUE);
@@ -77,8 +77,8 @@
     D_("module_init();\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     initng_service_data_types_add(&CHROOT);

Modified: initng/trunk/plugins/conflict/initng_conflict.c
==============================================================================
--- initng/trunk/plugins/conflict/initng_conflict.c	(original)
+++ initng/trunk/plugins/conflict/initng_conflict.c	Wed Apr  5 22:57:12 2006
@@ -21,8 +21,8 @@
 
 
 #include <stdio.h>
-#include <string.h>                         /* strstr() */
-#include <stdlib.h>                         /* free() exit() */
+#include <string.h>			    /* strstr() */
+#include <stdlib.h>			    /* free() exit() */
 #include <assert.h>
 
 #include <initng_handler.h>
@@ -49,33 +49,33 @@
 
     /* Do this check when this service is put in a STARTING state */
     if (!IS_STARTING(service))
-        return (TRUE);
+	return (TRUE);
 
     /* make sure the conflict entry is set */
     while ((conflict_entry = get_next_string(&CONFLICT, service, &itt)))
     {
-        active_db_h *s = NULL;
+	active_db_h *s = NULL;
 
-        /*D_("Making sure that %s is not running.\n", conflict_entry); */
-        char *fixed = fix_variables(conflict_entry, service);
+	/*D_("Making sure that %s is not running.\n", conflict_entry); */
+	char *fixed = fix_variables(conflict_entry, service);
 
-        s = initng_active_db_find_by_name(fixed);
+	s = initng_active_db_find_by_name(fixed);
 
-        free(fixed);
-        /* this is actually good */
-        if (!s)
-        {
-            /*D_("Conflict not found!\n"); */
-            continue;
-        }
-
-        if (IS_UP(s) || IS_STARTING(s))
-        {
-            initng_common_mark_service(service, &CONFLICTING);
-            F_("Service \"%s\" is conflicting with service \"%s\"!\n",
-               service->name, s->name);
-            return (FALSE);
-        }
+	free(fixed);
+	/* this is actually good */
+	if (!s)
+	{
+	    /*D_("Conflict not found!\n"); */
+	    continue;
+	}
+
+	if (IS_UP(s) || IS_STARTING(s))
+	{
+	    initng_common_mark_service(service, &CONFLICTING);
+	    F_("Service \"%s\" is conflicting with service \"%s\"!\n",
+	       service->name, s->name);
+	    return (FALSE);
+	}
     }
     return (TRUE);
 }
@@ -85,8 +85,8 @@
     D_("module_init();\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     initng_service_data_types_add(&CONFLICT);

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	Wed Apr  5 22:57:12 2006
@@ -51,7 +51,7 @@
 static void clear_lastserv(void)
 {
     if (lastservice)
-        printf("\n");
+	printf("\n");
     lastservice = NULL;
     last_ptype = NULL;
 }
@@ -69,20 +69,20 @@
     clear_lastserv();
     if (t > 1)
     {
-        if (g.sys_state == STATE_STARTING)
-            printf(PE "\t[" C_GREEN "done" C_OFF "]  \t( done in %ims )\n",
-                   initng_active_db_percent_started(), s->name, t);
-        else
-            printf(P "\t[" C_GREEN "done" C_OFF "]  \t( done in %ims )\n",
-                   s->name, t);
+	if (g.sys_state == STATE_STARTING)
+	    printf(PE "\t[" C_GREEN "done" C_OFF "]  \t( done in %ims )\n",
+		   initng_active_db_percent_started(), s->name, t);
+	else
+	    printf(P "\t[" C_GREEN "done" C_OFF "]  \t( done in %ims )\n",
+		   s->name, t);
     }
     else
     {
-        if (g.sys_state == STATE_STARTING)
-            printf(PE "\t[" C_GREEN "done" C_OFF "]\n",
-                   initng_active_db_percent_started(), s->name);
-        else
-            printf(P "\t[" C_GREEN "done" C_OFF "]\n", s->name);
+	if (g.sys_state == STATE_STARTING)
+	    printf(PE "\t[" C_GREEN "done" C_OFF "]\n",
+		   initng_active_db_percent_started(), s->name);
+	else
+	    printf(P "\t[" C_GREEN "done" C_OFF "]\n", s->name);
     }
 }
 
@@ -98,21 +98,21 @@
     clear_lastserv();
     if (t > 1)
     {
-        if (g.sys_state == STATE_STOPPING)
-            printf(PE "\t[" C_GREEN "%s" C_OFF
-                   "]\t( %s in %ims )\n", initng_active_db_percent_stopped(),
-                   s->name, is, is, t);
-        else
-            printf(P "\t[" C_GREEN "%s" C_OFF
-                   "]\t( %s in %ims )\n", s->name, is, is, t);
+	if (g.sys_state == STATE_STOPPING)
+	    printf(PE "\t[" C_GREEN "%s" C_OFF
+		   "]\t( %s in %ims )\n", initng_active_db_percent_stopped(),
+		   s->name, is, is, t);
+	else
+	    printf(P "\t[" C_GREEN "%s" C_OFF
+		   "]\t( %s in %ims )\n", s->name, is, is, t);
     }
     else
     {
-        if (g.sys_state == STATE_STOPPING)
-            printf(PE "\t[" C_GREEN "%s" C_OFF "]\n",
-                   initng_active_db_percent_stopped(), s->name, is);
-        else
-            printf(P "\t[" C_GREEN "%s" C_OFF "]\n", s->name, is);
+	if (g.sys_state == STATE_STOPPING)
+	    printf(PE "\t[" C_GREEN "%s" C_OFF "]\n",
+		   initng_active_db_percent_stopped(), s->name, is);
+	else
+	    printf(P "\t[" C_GREEN "%s" C_OFF "]\n", s->name, is);
     }
 }
 
@@ -124,68 +124,68 @@
 
     /* if quiet_when_up and system up, dont print anything */
     if (quiet_when_up && g.sys_state == STATE_UP)
-        return (TRUE);
+	return (TRUE);
 
     if (IS_DOWN(service))
     {
-        opt_service_stop_p(service, "stopped");
-        return (TRUE);
+	opt_service_stop_p(service, "stopped");
+	return (TRUE);
     }
 
     if (IS_STARTING(service))
     {
-        /* if we print this on boot, we clutter up the screen too much */
-        if (g.sys_state == STATE_STARTING)
-            return (TRUE);
-        clear_lastserv();
-        printf(P "\t[" C_GREEN "starting" C_OFF "]\n", service->name);
-        return (TRUE);
+	/* if we print this on boot, we clutter up the screen too much */
+	if (g.sys_state == STATE_STARTING)
+	    return (TRUE);
+	clear_lastserv();
+	printf(P "\t[" C_GREEN "starting" C_OFF "]\n", service->name);
+	return (TRUE);
     }
 
     if (IS_UP(service))
     {
-        int t;
-        process_h *process = initng_process_db_get_by_name("daemon", service);
+	int t;
+	process_h *process = initng_process_db_get_by_name("daemon", service);
 
-        if (!process)
-        {
-            out_service_done(service);
-            return (TRUE);
-        }
-        clear_lastserv();
-        t = initng_active_db_percent_started();
-
-        if (t > 1 && g.sys_state == STATE_STARTING)
-            printf(PE "\t[" C_GREEN "started" C_OFF "]\t( pid: %i )\n",
-                   t, service->name, process->pid);
-        else
-            printf(P "\t[" C_GREEN "started" C_OFF "]\t( pid: %i )\n",
-                   service->name, process->pid);
+	if (!process)
+	{
+	    out_service_done(service);
+	    return (TRUE);
+	}
+	clear_lastserv();
+	t = initng_active_db_percent_started();
+
+	if (t > 1 && g.sys_state == STATE_STARTING)
+	    printf(PE "\t[" C_GREEN "started" C_OFF "]\t( pid: %i )\n",
+		   t, service->name, process->pid);
+	else
+	    printf(P "\t[" C_GREEN "started" C_OFF "]\t( pid: %i )\n",
+		   service->name, process->pid);
 
-        return (TRUE);
+	return (TRUE);
     }
 
     if (IS_STOPPING(service))
     {
-        /*
-         * don't prompt that we are stopping a service, if system is shutting down, i 
-         * do think that the user is aware about this.
-         */
-        if (g.sys_state == STATE_STOPPING)
-            return (TRUE);
+	/*
+	 * don't prompt that we are stopping a service, if system is shutting down, i 
+	 * do think that the user is aware about this.
+	 */
+	if (g.sys_state == STATE_STOPPING)
+	    return (TRUE);
 
-        clear_lastserv();
-        printf(P "\t[" C_GREEN "stopping" C_OFF "]\n", service->name);
+	clear_lastserv();
+	printf(P "\t[" C_GREEN "stopping" C_OFF "]\n", service->name);
 
-        return (TRUE);
+	return (TRUE);
     }
 
     /* Print all states, that is a failure state */
     if (IS_FAILED(service))
     {
-        clear_lastserv();
-        printf(P "\t[" C_RED "%s" C_OFF "]\n", service->name,
-               service->current_state->state_name);
+	clear_lastserv();
+	printf(P "\t[" C_RED "%s" C_OFF "]\n", service->name,
+	       service->current_state->state_name);
     }
     return (TRUE);
 }
@@ -195,71 +195,71 @@
 
     switch (state)
     {
-        case STATE_STARTING:
-            clear_lastserv();
-            printf("\tSystem is starting up!\n\n");
-            break;
-        case STATE_STOPPING:
-            clear_lastserv();
-            printf("\tSystem is going down!\n\n");
-            break;
-        case STATE_ASE:
-            clear_lastserv();
-            printf("\tLast process exited!\n\n");
-            break;
-        case STATE_EXIT:
-            clear_lastserv();
-            printf("\tInitng exiting!\n\n");
-            break;
-        case STATE_RESTART:
-            clear_lastserv();
-            printf("\tInitng restarting!\n\n");
-            break;
-        case STATE_REBOOT:
-            clear_lastserv();
-            printf("\n\tYour system will now REBOOT!\n");
-            break;
-        case STATE_HALT:
-            clear_lastserv();
-            printf("\n\tYour system will now HALT!\n");
-            break;
-        case STATE_POWEROFF:
-            clear_lastserv();
-            printf("\n\tYour system will now POWER_OFF!\n");
-            break;
-        case STATE_UP:
-            {
-                struct timeval now;
-
-                /* Dont print this */
-                if (quiet_when_up)
-                    return;
-
-                /* get runlevel */
-                active_db_h *runl = initng_active_db_find_by_name(g.runlevel);
-
-                if (!runl)
-                {
-                    W_("Runlevel not found.\n");
-                    return;
-                }
-
-                gettimeofday(&now, NULL);
-
-                clear_lastserv();
-                printf("\n\n\trunlevel \"%s\" up in, %ims.\n\n",
-                       g.runlevel, MS_DIFF(now, runl->last_rought_time));
-
-                break;
-            }
-        default:
-            break;
+	case STATE_STARTING:
+	    clear_lastserv();
+	    printf("\tSystem is starting up!\n\n");
+	    break;
+	case STATE_STOPPING:
+	    clear_lastserv();
+	    printf("\tSystem is going down!\n\n");
+	    break;
+	case STATE_ASE:
+	    clear_lastserv();
+	    printf("\tLast process exited!\n\n");
+	    break;
+	case STATE_EXIT:
+	    clear_lastserv();
+	    printf("\tInitng exiting!\n\n");
+	    break;
+	case STATE_RESTART:
+	    clear_lastserv();
+	    printf("\tInitng restarting!\n\n");
+	    break;
+	case STATE_REBOOT:
+	    clear_lastserv();
+	    printf("\n\tYour system will now REBOOT!\n");
+	    break;
+	case STATE_HALT:
+	    clear_lastserv();
+	    printf("\n\tYour system will now HALT!\n");
+	    break;
+	case STATE_POWEROFF:
+	    clear_lastserv();
+	    printf("\n\tYour system will now POWER_OFF!\n");
+	    break;
+	case STATE_UP:
+	    {
+		struct timeval now;
+
+		/* Dont print this */
+		if (quiet_when_up)
+		    return;
+
+		/* get runlevel */
+		active_db_h *runl = initng_active_db_find_by_name(g.runlevel);
+
+		if (!runl)
+		{
+		    W_("Runlevel not found.\n");
+		    return;
+		}
+
+		gettimeofday(&now, NULL);
+
+		clear_lastserv();
+		printf("\n\n\trunlevel \"%s\" up in, %ims.\n\n",
+		       g.runlevel, MS_DIFF(now, runl->last_rought_time));
+
+		break;
+	    }
+	default:
+	    break;
     }
     D_("print_system_state(): new system state: %i\n", state);
 }
 
 static int print_program_output(active_db_h * service, process_h * x,
-                                char *buffer_pos)
+				char *buffer_pos)
 {
     /*
        TODO here:
@@ -277,7 +277,7 @@
 
     /* if quiet_when_up and system up, dont print anything */
     if (quiet_when_up && g.sys_state == STATE_UP)
-        return (TRUE);
+	return (TRUE);
 
     D_(" from service \"%s\"\n", service->name);
     /*
@@ -288,47 +288,47 @@
     /* a first while loop that sorts out crap */
     while (buffer_pos[i] != '\0')
     {
-        /*  remove lines with " [2]  Done " that bash generates. */
-        if (buffer_pos[i] == '[' && buffer_pos[i + 2] == ']')
-        {
-            /* jump to next line */
-            while (buffer_pos[i] && buffer_pos[i] != '\n')
-                i++;
-        }
-
-        /* if there are stupid tokens, go to next char, and run while again. */
-        if (buffer_pos[i] == ' ' || buffer_pos[i] == '\n'
-            || buffer_pos[i] == '\t')
-        {
-            i++;
-            continue;
-        }
+	/*  remove lines with " [2]  Done " that bash generates. */
+	if (buffer_pos[i] == '[' && buffer_pos[i + 2] == ']')
+	{
+	    /* jump to next line */
+	    while (buffer_pos[i] && buffer_pos[i] != '\n')
+		i++;
+	}
+
+	/* if there are stupid tokens, go to next char, and run while again. */
+	if (buffer_pos[i] == ' ' || buffer_pos[i] == '\n'
+	    || buffer_pos[i] == '\t')
+	{
+	    i++;
+	    continue;
+	}
 
-        /* else break */
-        break;
+	/* else break */
+	break;
     }
 
     /* Make sure that there is anything left to write */
     if (strlen(&buffer_pos[i]) < 2)
     {
-        /* its okay anyway */
-        return (TRUE);
+	/* its okay anyway */
+	return (TRUE);
     }
 
     if (lastservice != service && last_ptype != x->pt)
     {
-        clear_lastserv();
-        printf("\n" C_CYAN " %s %s:" C_OFF, service->name, x->pt->name);
-        /* print our special indented newline */
-        putchar('\n');
-        putchar(' ');
-        putchar(' ');
-        lastservice = service;
-        last_ptype = x->pt;
+	clear_lastserv();
+	printf("\n" C_CYAN " %s %s:" C_OFF, service->name, x->pt->name);
+	/* print our special indented newline */
+	putchar('\n');
+	putchar(' ');
+	putchar(' ');
+	lastservice = service;
+	last_ptype = x->pt;
     }
     else
     {
-        D_("Lastservice == service, won't print header.\n");
+	D_("Lastservice == service, won't print header.\n");
     }
 
 
@@ -336,31 +336,31 @@
     /* while buffer lasts */
     while (buffer_pos[i] != '\0')
     {
-        /*  remove lines with " [2]  Done " that bash generates. */
-        if (buffer_pos[i] == '[' && buffer_pos[i + 2] == ']')
-        {
-            while (buffer_pos[i] && buffer_pos[i] != '\n')
-                i++;
-        }
-
-        /* if this are a newline */
-        if (buffer_pos[i] == '\n')
-        {
-            /* print our special indented newline instead */
-            putchar('\n');
-            putchar(' ');
-            putchar(' ');
-            i++;
-            /* skip spaces, on newline. */
-            while (buffer_pos[i]
-                   && (buffer_pos[i] == ' ' || buffer_pos[i] == '\t'))
-                i++;
-            continue;
-        }
-
-        /* ok, now put the char, and go to next. */
-        putchar(buffer_pos[i]);
-        i++;
+	/*  remove lines with " [2]  Done " that bash generates. */
+	if (buffer_pos[i] == '[' && buffer_pos[i + 2] == ']')
+	{
+	    while (buffer_pos[i] && buffer_pos[i] != '\n')
+		i++;
+	}
+
+	/* if this are a newline */
+	if (buffer_pos[i] == '\n')
+	{
+	    /* print our special indented newline instead */
+	    putchar('\n');
+	    putchar(' ');
+	    putchar(' ');
+	    i++;
+	    /* skip spaces, on newline. */
+	    while (buffer_pos[i]
+		   && (buffer_pos[i] == ' ' || buffer_pos[i] == '\t'))
+		i++;
+	    continue;
+	}
+
+	/* ok, now put the char, and go to next. */
+	putchar(buffer_pos[i]);
+	i++;
     }
 
     /* flush any buffered output to the screen */
@@ -370,28 +370,28 @@
 
 
 static int cp_print_error(e_mt mt, const char *file, const char *func,
-                          int line, const char *format, va_list arg)
+			  int line, const char *format, va_list arg)
 {
     struct tm *ts;
     time_t t;
 
     switch (mt)
     {
-        case MSG_FAIL:
-        case MSG_WARN:
-            t = time(0);
-            ts = localtime(&t);
+	case MSG_FAIL:
+	case MSG_WARN:
+	    t = time(0);
+	    ts = localtime(&t);
 #ifdef DEBUG
-            fprintf(stderr, "\n\n ** \"%s\", %s()  line:%i:\n", file, func,
-                    line);
+	    fprintf(stderr, "\n\n ** \"%s\", %s()  line:%i:\n", file, func,
+		    line);
 #endif
-            fprintf(stderr, " %.2i:%.2i:%.2i -- %s:\t", ts->tm_hour,
-                    ts->tm_min, ts->tm_sec, mt == MSG_FAIL ? "FAIL" : "WARN");
-            vfprintf(stderr, format, arg);
-            break;
-        default:
-            vfprintf(stderr, format, arg);
-            break;
+	    fprintf(stderr, " %.2i:%.2i:%.2i -- %s:\t", ts->tm_hour,
+		    ts->tm_min, ts->tm_sec, mt == MSG_FAIL ? "FAIL" : "WARN");
+	    vfprintf(stderr, format, arg);
+	    break;
+	default:
+	    vfprintf(stderr, format, arg);
+	    break;
     }
     return (TRUE);
 }
@@ -402,18 +402,18 @@
 
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
     for (i = 0; g.Argv[i]; i++)
     {
-        if (strstr(g.Argv[i], "quiet_when_up"))
-            quiet_when_up = TRUE;
+	if (strstr(g.Argv[i], "quiet_when_up"))
+	    quiet_when_up = TRUE;
     }
 
 
     printf("\n" C_BLUE "\tNext Generation Init version ( %s )" C_OFF,
-           INITNG_VERSION);
+	   INITNG_VERSION);
     printf("\n" C_GREEN "\thttp://initng.thinktux.net\n" C_OFF);
     printf("\tAuthor: Jimmy Wennlund <jimmy.wennlund at gmail.com>\n");
     printf("\tIf you find initng useful, please consider a small donation.\n\n");

Modified: initng/trunk/plugins/critical/initng_critical.c
==============================================================================
--- initng/trunk/plugins/critical/initng_critical.c	(original)
+++ initng/trunk/plugins/critical/initng_critical.c	Wed Apr  5 22:57:12 2006
@@ -20,7 +20,7 @@
 #include <initng.h>
 #define _GNU_SOURCE
 #include <stdio.h>
-#include <stdlib.h>                         /* free() exit() */
+#include <stdlib.h>			    /* free() exit() */
 #include <string.h>
 #include <assert.h>
 
@@ -45,10 +45,10 @@
     assert(service->name);
 
     if (!IS_FAILED(service))
-        return (TRUE);
+	return (TRUE);
 
     if (!is(&CRITICAL, service))
-        return (TRUE);
+	return (TRUE);
 
     F_("Service %s failed, this is critical, going su_login!!\n",
        service->name);
@@ -58,9 +58,9 @@
 
     if (service->from_service)
     {
-        list_del(&(service->from_service->list));
-        initng_service_cache_free(service->from_service);
-        service->from_service = NULL;
+	list_del(&(service->from_service->list));
+	initng_service_cache_free(service->from_service);
+	service->from_service = NULL;
     }
 
     /* Reset the service state */
@@ -71,8 +71,8 @@
 
     /* Make sure full runlevel starting fine */
     if (!initng_active_db_find_by_exact_name(g.runlevel))
-        if (!initng_handler_start_new_service_named(g.runlevel))
-            F_("runlevel \"%s\" could not be executed!\n", g.runlevel);
+	if (!initng_handler_start_new_service_named(g.runlevel))
+	    F_("runlevel \"%s\" could not be executed!\n", g.runlevel);
 
     return (FALSE);
 }
@@ -82,8 +82,8 @@
     D_("module_init();\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     initng_service_data_types_add(&CRITICAL);

Modified: initng/trunk/plugins/ctrlaltdel/initng_ctrlaltdel.c
==============================================================================
--- initng/trunk/plugins/ctrlaltdel/initng_ctrlaltdel.c	(original)
+++ initng/trunk/plugins/ctrlaltdel/initng_ctrlaltdel.c	Wed Apr  5 22:57:12 2006
@@ -21,7 +21,7 @@
 
 
 #include <stdio.h>
-#include <stdlib.h>                         /* free() exit() */
+#include <stdlib.h>			    /* free() exit() */
 #include <string.h>
 #include <assert.h>
 #include <signal.h>
@@ -41,13 +41,13 @@
 static void ctrlaltdel(int signal)
 {
     if (signal != SIGINT)
-        return;
+	return;
 
     /* what to do when there is no services left */
     if (g.i_am_init)
-        g.when_out = THEN_REBOOT;
+	g.when_out = THEN_REBOOT;
     else
-        g.when_out = THEN_QUIT;
+	g.when_out = THEN_QUIT;
 
     /* stop all services */
     initng_handler_stop_all();
@@ -58,8 +58,8 @@
     D_("module_init();\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     initng_plugin_hook_add(&g.SIGNAL, 50, &ctrlaltdel);

Modified: initng/trunk/plugins/daemon/initng_daemon.c
==============================================================================
--- initng/trunk/plugins/daemon/initng_daemon.c	(original)
+++ initng/trunk/plugins/daemon/initng_daemon.c	Wed Apr  5 22:57:12 2006
@@ -23,15 +23,15 @@
 
 
 
-#include <time.h>                           /* time() */
-#include <fcntl.h>                          /* fcntl() */
-#include <sys/un.h>                         /* memmove() strcmp() */
-#include <sys/wait.h>                       /* waitpid() sa */
-#include <linux/kd.h>                       /* KDSIGACCEPT */
-#include <sys/ioctl.h>                      /* ioctl() */
-#include <stdio.h>                          /* printf() */
-#include <stdlib.h>                         /* free() exit() */
-#include <sys/reboot.h>                     /* reboot() RB_DISABLE_CAD */
+#include <time.h>			    /* time() */
+#include <fcntl.h>			    /* fcntl() */
+#include <sys/un.h>			    /* memmove() strcmp() */
+#include <sys/wait.h>			    /* waitpid() sa */
+#include <linux/kd.h>			    /* KDSIGACCEPT */
+#include <sys/ioctl.h>			    /* ioctl() */
+#include <stdio.h>			    /* printf() */
+#include <stdlib.h>			    /* free() exit() */
+#include <sys/reboot.h>			    /* reboot() RB_DISABLE_CAD */
 #include <assert.h>
 #include <errno.h>
 #include <fcntl.h>
@@ -40,7 +40,7 @@
 #include <string.h>
 #include <sys/types.h>
 #include <dirent.h>
-#include <ctype.h>                          /* isdigit */
+#include <ctype.h>			    /* isdigit */
 
 
 #include <initng_handler.h>
@@ -145,7 +145,7 @@
  * ############################################################################
  */
 static void handle_killed_daemon(active_db_h * killed_daemon,
-                                 process_h * process);
+				 process_h * process);
 
 /*
  * ############################################################################
@@ -346,16 +346,16 @@
     /* if its waiting for deps to stop, we can reset it running again */
     if (IS_MARK(daemon_to_start, &DAEMON_WAITING_FOR_STOP_DEP))
     {
-        initng_common_mark_service(daemon_to_start, &DAEMON_RUNNING);
-        return (TRUE);
+	initng_common_mark_service(daemon_to_start, &DAEMON_RUNNING);
+	return (TRUE);
     }
 
     /* mark it WAITING_FOR_START_DEP and wait */
     if (!initng_common_mark_service(daemon_to_start, &DAEMON_START_MARKED))
     {
-        W_("mark_daemon DAEMON_START_MARKED failed for daemon %s\n",
-           daemon_to_start->name);
-        return (FALSE);
+	W_("mark_daemon DAEMON_START_MARKED failed for daemon %s\n",
+	   daemon_to_start->name);
+	return (FALSE);
     }
 
     /* return happily */
@@ -370,16 +370,16 @@
     /* if its waiting for deps to start, we can set it to stopped directly */
     if (IS_MARK(daemon, &DAEMON_WAITING_FOR_START_DEP))
     {
-        initng_common_mark_service(daemon, &DAEMON_STOPPED);
-        return (TRUE);
+	initng_common_mark_service(daemon, &DAEMON_STOPPED);
+	return (TRUE);
     }
 
     /* set stopping */
     if (!initng_common_mark_service(daemon, &DAEMON_STOP_MARKED))
     {
-        W_("mark_service DAEMON_STOP_MARKED failed for daemon %s.\n",
-           daemon->name);
-        return (FALSE);
+	W_("mark_service DAEMON_STOP_MARKED failed for daemon %s.\n",
+	   daemon->name);
+	return (FALSE);
     }
 
     /* return happily */
@@ -398,8 +398,8 @@
     D_("module_init();\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     /* Add a new servicetype */
@@ -442,7 +442,7 @@
     initng_active_state_add(&DAEMON_RESPAWN_RATE_EXCEEDED);
 
     initng_plugin_hook_add(&g.ADDITIONAL_PARSE, 80,
-                           &check_valid_pidfile_path);
+			   &check_valid_pidfile_path);
 
     /* return happily */
     return (TRUE);
@@ -541,22 +541,22 @@
      */
     switch (initng_depend_start_dep_met(daemon, FALSE))
     {
-        case TRUE:
-            break;
-        case FAIL:
-            initng_common_mark_service(daemon, &DAEMON_START_DEPS_FAILED);
-            return;
-        default:
-            /* return and hope that this handler will be called again. */
-            return;
+	case TRUE:
+	    break;
+	case FAIL:
+	    initng_common_mark_service(daemon, &DAEMON_START_DEPS_FAILED);
+	    return;
+	default:
+	    /* return and hope that this handler will be called again. */
+	    return;
     }
 
     /* if system is shutting down, Don't start anything. */
     if (g.sys_state != STATE_STARTING && g.sys_state != STATE_UP)
     {
-        F_("Can't start daemon, when system status is: %i !\n", g.sys_state);
-        initng_common_mark_service(daemon, &DAEMON_STOPPED);
-        return;
+	F_("Can't start daemon, when system status is: %i !\n", g.sys_state);
+	initng_common_mark_service(daemon, &DAEMON_STOPPED);
+	return;
     }
 
     /* set status to START_DEP_MET */
@@ -570,7 +570,7 @@
 
     /* check with other plug-ins, if it is ok to stop this service now */
     if (initng_depend_stop_dep_met(daemon, FALSE) != TRUE)
-        return;
+	return;
 
     /* ok, stopping deps are met */
     initng_common_mark_service(daemon, &DAEMON_STOP_DEPS_MET);
@@ -583,7 +583,7 @@
 
     /* set the DAEMON_LAUNCH state */
     if (!initng_common_mark_service(daemon, &DAEMON_LAUNCH))
-        return;
+	return;
 
     /*
      * If pidof is set, check that there is no
@@ -591,66 +591,66 @@
      */
     if (is(&PIDOF, daemon))
     {
-        pid_t pid = 0;
+	pid_t pid = 0;
 
-        D_("getting pid by PIDOF!\n");
-        /* get pid by process name */
-        pid = get_pidof(daemon);
-        D_("result : %d\n", pid);
-
-        /* if the pid really exist on the system */
-        if (pid > 1 && kill(pid, 0) == 0)
-        {
-            /* create an new process */
-            process_h *existing_process = initng_process_db_new(&T_DAEMON);
-
-            if (existing_process)
-            {
-                W_("Daemon for service %s was already running, adding it to service daemon process list instead of starting a new one.\n", daemon->name);
-
-                /* set process status */
-                existing_process->pst = P_RUNNING;
-                existing_process->pid = pid;
-
-                /* add process */
-                initng_process_add_to_service(existing_process, daemon);
-                initng_common_mark_service(daemon, &DAEMON_RUNNING);
-                return;
-            }
-        }
+	D_("getting pid by PIDOF!\n");
+	/* get pid by process name */
+	pid = get_pidof(daemon);
+	D_("result : %d\n", pid);
+
+	/* if the pid really exist on the system */
+	if (pid > 1 && kill(pid, 0) == 0)
+	{
+	    /* create an new process */
+	    process_h *existing_process = initng_process_db_new(&T_DAEMON);
+
+	    if (existing_process)
+	    {
+		W_("Daemon for service %s was already running, adding it to service daemon process list instead of starting a new one.\n", daemon->name);
+
+		/* set process status */
+		existing_process->pst = P_RUNNING;
+		existing_process->pid = pid;
+
+		/* add process */
+		initng_process_add_to_service(existing_process, daemon);
+		initng_common_mark_service(daemon, &DAEMON_RUNNING);
+		return;
+	    }
+	}
     }
 
 
     /* F I N A L L Y   S T A R T */
     switch (initng_execute_launch(daemon, &T_DAEMON))
     {
-        case FALSE:
-            F_("Did not find a service->\"daemon\" entry to run!\n",
-               daemon->name);
-            initng_common_mark_service(daemon, &DAEMON_FAIL_STARTING);
-            return;
-        case FAIL:
-            F_("Service %s, could not launch service->\"daemon\"\n",
-               daemon->name);
-            initng_common_mark_service(daemon, &DAEMON_FAIL_STARTING);
-            return;
-        default:
-            break;
+	case FALSE:
+	    F_("Did not find a service->\"daemon\" entry to run!\n",
+	       daemon->name);
+	    initng_common_mark_service(daemon, &DAEMON_FAIL_STARTING);
+	    return;
+	case FAIL:
+	    F_("Service %s, could not launch service->\"daemon\"\n",
+	       daemon->name);
+	    initng_common_mark_service(daemon, &DAEMON_FAIL_STARTING);
+	    return;
+	default:
+	    break;
     }
 
 
     /* if PIDFILE or PIDOF set, put daemon in WAIT_FOR_PIDFILE_STATE */
     if (is(&PIDFILE, daemon) || is(&PIDOF, daemon))
     {
-        initng_common_mark_service(daemon, &DAEMON_WAIT_FOR_PID_FILE);
-        return;
+	initng_common_mark_service(daemon, &DAEMON_WAIT_FOR_PID_FILE);
+	return;
     };
 
     /* If daemon is a forking one, let it stay DAEMON_LAUNCH */
     if (is(&FORKS, daemon))
     {
-        D_("FORKS is set, will wait for return.\n");
-        return;
+	D_("FORKS is set, will wait for return.\n");
+	return;
     }
 
     D_("FORKS not set, setting to DAEMON_RUNNING directly.\n");
@@ -658,8 +658,8 @@
     /* check with up_check */
     if (initng_depend_up_check(daemon) != TRUE)
     {
-        initng_common_mark_service(daemon, &DAEMON_UP_CHECK_FAILED);
-        return;
+	initng_common_mark_service(daemon, &DAEMON_UP_CHECK_FAILED);
+	return;
     }
 
     /* We just set it to up, as soon as it is started */
@@ -673,49 +673,49 @@
     /* find the daemon, and check so it still exits */
     if (!(process = initng_process_db_get(&T_DAEMON, service)))
     {
-        F_("Could not find process to kill!\n");
-        return;
+	F_("Could not find process to kill!\n");
+	return;
     }
 
     /* Check so process have a valid pid */
     if (process->pid <= 0)
     {
-        D_("Pid is unvalid, marked as DAEMON_STOPPED\n");
-        initng_common_mark_service(service, &DAEMON_STOPPED);
-        return;
+	D_("Pid is unvalid, marked as DAEMON_STOPPED\n");
+	initng_common_mark_service(service, &DAEMON_STOPPED);
+	return;
     }
 
     if (kill(process->pid, 0) && errno == ESRCH)
     {
-        D_("Dont exist a process with pid %i, mark as DAEMON_STOPPED\n",
-           process->pid);
-        initng_common_mark_service(service, &DAEMON_STOPPED);
-        return;
+	D_("Dont exist a process with pid %i, mark as DAEMON_STOPPED\n",
+	   process->pid);
+	initng_common_mark_service(service, &DAEMON_STOPPED);
+	return;
     }
 
 
     /* launch stop service */
     switch (initng_execute_launch(service, &T_KILL))
     {
-        case FAIL:
-            F_("  --  (%s): fail launch stop!\n", service->name);
-            initng_common_mark_service(service, &DAEMON_FAIL_STOPPING);
-            return;
-        case FALSE:
-            {
-                /* if there is no plugin that wanna kill this daemon,
-                 * we do it ourself.
-                 */
-                kill_daemon(service, SIGTERM);
-                if (!initng_common_mark_service(service, &DAEMON_TERM))
-                    return;
-                break;
-            }
-        default:
-            /* Set its state to GOING_KILLED, to mark that we put some effort on killing it. */
-            if (!initng_common_mark_service(service, &DAEMON_TERM))
-                return;
-            break;
+	case FAIL:
+	    F_("  --  (%s): fail launch stop!\n", service->name);
+	    initng_common_mark_service(service, &DAEMON_FAIL_STOPPING);
+	    return;
+	case FALSE:
+	    {
+		/* if there is no plugin that wanna kill this daemon,
+		 * we do it ourself.
+		 */
+		kill_daemon(service, SIGTERM);
+		if (!initng_common_mark_service(service, &DAEMON_TERM))
+		    return;
+		break;
+	    }
+	default:
+	    /* Set its state to GOING_KILLED, to mark that we put some effort on killing it. */
+	    if (!initng_common_mark_service(service, &DAEMON_TERM))
+		return;
+	    break;
     }
 
 }
@@ -740,20 +740,20 @@
     /* check if timeout have appeared */
     if (g.now.tv_sec > s->time_current_state.tv_sec + PID_TIMEOUT)
     {
-        process_h *process = NULL;
+	process_h *process = NULL;
 
-        F_("Service \"%s\" wait for pidfile timed out! Will kill daemon now.\n", s->name);
+	F_("Service \"%s\" wait for pidfile timed out! Will kill daemon now.\n", s->name);
 
-        initng_common_mark_service(s, &DAEMON_FAIL_STARTING);
-        kill_daemon(s, SIGKILL);
+	initng_common_mark_service(s, &DAEMON_FAIL_STARTING);
+	kill_daemon(s, SIGKILL);
 
-        /* Free the process if found */
-        if ((process = initng_process_db_get(&T_DAEMON, s)))
-        {
-            list_del(&process->list);
-            initng_process_db_free(process);
-        }
-        return;
+	/* Free the process if found */
+	if ((process = initng_process_db_get(&T_DAEMON, s)))
+	{
+	    list_del(&process->list);
+	    initng_process_db_free(process);
+	}
+	return;
     }
 
     /*
@@ -761,8 +761,8 @@
      */
     if (!try_get_pid(s))
     {
-        /* try again in 1 second */
-        initng_handler_set_alarm(s, 1);
+	/* try again in 1 second */
+	initng_handler_set_alarm(s, 1);
     }
 }
 
@@ -778,8 +778,8 @@
     /* if RESPAWN_PAUSE set */
     if (is(&RESPAWN_PAUSE, service))
     {
-        /* get it */
-        respawn_pause = get_int(&RESPAWN_PAUSE, service);
+	/* get it */
+	respawn_pause = get_int(&RESPAWN_PAUSE, service);
     }
 
     D_("Will sleep %i seconds before respawning!\n", respawn_pause);
@@ -807,7 +807,7 @@
 
     /* Make sure we got an value */
     if (timeout == 0)
-        timeout = DEFAULT_TERM_TIMEOUT;
+	timeout = DEFAULT_TERM_TIMEOUT;
 
     initng_handler_set_alarm(daemon, timeout);
 }
@@ -863,8 +863,8 @@
      */
     if (process->r_code > 0)
     {
-        F_(" start %s, Returned with exit %i.\n", daemon->name,
-           process->r_code);
+	F_(" start %s, Returned with exit %i.\n", daemon->name,
+	   process->r_code);
     }
 
 
@@ -872,20 +872,20 @@
      * Youst run if we checks for PID FILE
      */
     if (daemon->current_state == &DAEMON_WAIT_FOR_PID_FILE &&
-        is(&FORKS, daemon))
+	is(&FORKS, daemon))
     {
-        try_get_pid(daemon);
-        return;
+	try_get_pid(daemon);
+	return;
     }
 
     /* This service are gonna respawn, no need to set it stopped */
     if (check_respawn(daemon))
     {
-        /* It is gonna respawn, free this process and forget */
-        list_del(&process->list);
-        initng_process_db_free(process);
+	/* It is gonna respawn, free this process and forget */
+	list_del(&process->list);
+	initng_process_db_free(process);
 
-        return;
+	return;
     }
 
     /*
@@ -896,10 +896,10 @@
     if (process->r_code && !is(&DAEMON_FAIL_OK, daemon))
     {
 
-        initng_common_mark_service(daemon, &DAEMON_FAIL_STARTING);
-        list_del(&process->list);
-        initng_process_db_free(process);
-        return;
+	initng_common_mark_service(daemon, &DAEMON_FAIL_STARTING);
+	list_del(&process->list);
+	initng_process_db_free(process);
+	return;
     }
 
     /* OK! now daemon is STOPPED! */
@@ -926,26 +926,26 @@
     /* make sure we got a process */
     if (!(process = initng_process_db_get(&T_DAEMON, service)))
     {
-        F_("Service doesn't have any processes, don't know how to kill then.\n");
-        return;
+	F_("Service doesn't have any processes, don't know how to kill then.\n");
+	return;
     }
 
     /* check so that pid is good */
     if (process->pid <= 0)
     {
-        F_("Bad PID %d in database!\n", process->pid);
-        list_del(&process->list);
-        initng_process_db_free(process);
-        return;
+	F_("Bad PID %d in database!\n", process->pid);
+	list_del(&process->list);
+	initng_process_db_free(process);
+	return;
     }
 
     /* check so there exits an process with this pid */
     if (kill(process->pid, 0) && errno == ESRCH)
     {
-        F_("Trying to kill a service (%s) with a pid (%d), but there exists no process with this pid!\n", service->name, process->pid);
-        list_del(&process->list);
-        initng_process_db_free(process);
-        return;
+	F_("Trying to kill a service (%s) with a pid (%d), but there exists no process with this pid!\n", service->name, process->pid);
+	list_del(&process->list);
+	initng_process_db_free(process);
+	return;
     }
 
     /* if system is not stopping, generate a warning */
@@ -978,81 +978,81 @@
 
     /* Open /proc or fail */
     if (!(dir = opendir("/proc")))
-        return (-1);
+	return (-1);
 
     /* Walk through the directory. */
     while ((d = readdir(dir)) != NULL)
     {
-        char buf[BUFF_SIZE + 1];        /* Will contain a fixed string like "/proc/12232/stat" */
-        char *s = NULL;         /* Temporary pointer when parsing the content of the stat file */
-        int len = 0;            /* An length counter */
-        pid_t pid = -1;         /* Will contain the pid to return */
-
-        /* Make sure this dirname is a number == pid */
-        if ((pid = atoi(d->d_name)) <= 0)
-            continue;
-
-        /* Fix a string, that matches the full path of the stat file */
-        snprintf(buf, BUFF_SIZE, "/proc/%d/stat", pid);
-        D_("To open: %s\n", buf);
-
-        /* Read SID & statname from it or fail */
-        if (!(fp = fopen(buf, "r")))
-        {
-            W_("Could not open %s.\n", buf);
-            continue;
-        }
-
-        /* fetch the full stat file, or fail */
-        if (fgets(buf, BUFF_SIZE, fp) == NULL)
-        {
-            fclose(fp);
-            continue;
-        }
-
-        /* close stat file */
-        fclose(fp);
-
-        /* set the walk counter, to the start of the file content fetched */
-        s = buf;
-
-        /* skip all chars to the first space - first string contains the pid no */
-        while (*s && *s != ' ')
-            s++;
-
-        /* Make sure we have any data */
-        if (*s == '\0')
-            continue;
-
-        /* skip the space */
-        s++;
-
-        /* skip the '(' char */
-        if (*s != '(')
-            continue;
-        s++;
-
-        /* count the length */
-        while (s[len] && s[len] != ')')
-            len++;
-
-        /* compare the name in the '(' ')' chars with the process name we are looking for */
-        if (strncmp(s, name, len) == 0)
-        {
-            D_("Found %s with pid %d\n", name, pid);
-
-            /* make sure the dir (/proc) is closed. */
-            if (dir)
-                closedir(dir);
-
-            /* return happily with the pid */
-            return (pid);
-        }
+	char buf[BUFF_SIZE + 1];	/* Will contain a fixed string like "/proc/12232/stat" */
+	char *s = NULL;		/* Temporary pointer when parsing the content of the stat file */
+	int len = 0;		/* An length counter */
+	pid_t pid = -1;		/* Will contain the pid to return */
+
+	/* Make sure this dirname is a number == pid */
+	if ((pid = atoi(d->d_name)) <= 0)
+	    continue;
+
+	/* Fix a string, that matches the full path of the stat file */
+	snprintf(buf, BUFF_SIZE, "/proc/%d/stat", pid);
+	D_("To open: %s\n", buf);
+
+	/* Read SID & statname from it or fail */
+	if (!(fp = fopen(buf, "r")))
+	{
+	    W_("Could not open %s.\n", buf);
+	    continue;
+	}
+
+	/* fetch the full stat file, or fail */
+	if (fgets(buf, BUFF_SIZE, fp) == NULL)
+	{
+	    fclose(fp);
+	    continue;
+	}
+
+	/* close stat file */
+	fclose(fp);
+
+	/* set the walk counter, to the start of the file content fetched */
+	s = buf;
+
+	/* skip all chars to the first space - first string contains the pid no */
+	while (*s && *s != ' ')
+	    s++;
+
+	/* Make sure we have any data */
+	if (*s == '\0')
+	    continue;
+
+	/* skip the space */
+	s++;
+
+	/* skip the '(' char */
+	if (*s != '(')
+	    continue;
+	s++;
+
+	/* count the length */
+	while (s[len] && s[len] != ')')
+	    len++;
+
+	/* compare the name in the '(' ')' chars with the process name we are looking for */
+	if (strncmp(s, name, len) == 0)
+	{
+	    D_("Found %s with pid %d\n", name, pid);
+
+	    /* make sure the dir (/proc) is closed. */
+	    if (dir)
+		closedir(dir);
+
+	    /* return happily with the pid */
+	    return (pid);
+	}
     }
 
     /* close the dir (/proc) if still open */
     if (dir)
-        closedir(dir);
+	closedir(dir);
 
     D_("Did not find a process with name \"%s\"\n", name);
     return (-1);
@@ -1079,27 +1079,27 @@
 
     /* If we cant open pidfile, this is bad */
     if (fd == -1)
-        return (-1);
+	return (-1);
 
     /* Read data from buffer */
     len = read(fd, buf, 20);
     close(fd);
     if (len < 1)
     {
-        F_("Read 0 chars from %s, It's empty.\n", name);
-        return (-1);
+	F_("Read 0 chars from %s, It's empty.\n", name);
+	return (-1);
     }
 
     for (i = 0; i < len && !isdigit(buf[i]); i++) ;
 
     for (; i < len && isdigit(buf[i]); i++)
-        ret = ret * 10 - '0' + buf[i];
+	ret = ret * 10 - '0' + buf[i];
 
     if (!ret && i > len)
-        F_("bufferoverrun: no pid fetched from '%s'.", name);
+	F_("bufferoverrun: no pid fetched from '%s'.", name);
     else if (ret && i > len)
-        F_("bufferoverrun: the pid received from '%s' is pid (%i).", name,
-           ret);
+	F_("bufferoverrun: the pid received from '%s' is pid (%i).", name,
+	   ret);
 
     return ret;
 }
@@ -1112,12 +1112,12 @@
 
     pidof = get_string(&PIDOF, s);
     if (!pidof)
-        return (-1);
+	return (-1);
 
 
     pidof_fixed = fix_variables(pidof, s);
     if (!pidof_fixed)
-        return (-1);
+	return (-1);
 
     pid = pid_of(pidof_fixed);
     free(pidof_fixed);
@@ -1135,31 +1135,31 @@
     /* get the pidfile */
     while ((pidfile = get_next_string(&PIDFILE, s, &itt)))
     {
-        /* fix the variables in the string */
-        pidfile_fixed = fix_variables(pidfile, s);
+	/* fix the variables in the string */
+	pidfile_fixed = fix_variables(pidfile, s);
 
-        /* check so we got the string */
-        if (!pidfile_fixed)
-            return (-1);
-
-        /* make sure the first char is a '/' so its a full path */
-        if (pidfile_fixed[0] != '/')
-        {
-            F_("%s has pid_file with relative path \"%s\"\n", s->name,
-               pidfile_fixed);
-            /* check_valid_pidfile_path() can detect certain dangerous
-               typos, but it can't prevent loading. Stop to be safe */
-            free(pidfile_fixed);
-            return (-1);
-        }
-
-        /* get the pid from the file */
-        pid = pid_from_file(pidfile_fixed);
-        free(pidfile_fixed);
-
-        /* return the pid */
-        if (pid > 1)
-            return (pid);
+	/* check so we got the string */
+	if (!pidfile_fixed)
+	    return (-1);
+
+	/* make sure the first char is a '/' so its a full path */
+	if (pidfile_fixed[0] != '/')
+	{
+	    F_("%s has pid_file with relative path \"%s\"\n", s->name,
+	       pidfile_fixed);
+	    /* check_valid_pidfile_path() can detect certain dangerous
+	       typos, but it can't prevent loading. Stop to be safe */
+	    free(pidfile_fixed);
+	    return (-1);
+	}
+
+	/* get the pid from the file */
+	pid = pid_from_file(pidfile_fixed);
+	free(pidfile_fixed);
+
+	/* return the pid */
+	if (pid > 1)
+	    return (pid);
     }
     return (-1);
 }
@@ -1173,30 +1173,30 @@
     /* ok, search for pidfiles */
     while ((pidfile = get_next_string(&PIDFILE, s, &itt)))
     {
-        if (pidfile)
-        {
-            /* fix the variables in the string */
-            pidfile_fixed = fix_variables(pidfile, s);
-
-            /* check it's an absolute path after variable substitution */
-            if (pidfile_fixed[0] == '/')
-            {
-                if (unlink(pidfile_fixed) != 0 && errno != ENOENT)
-                    F_("Could not remove stale pidfile \"%s\"\n",
-                       pidfile_fixed);
-                break;
-            }
-            else
-            {
-                F_("%s has pid_file with relative path \"%s\"\n", s->name,
-                   pidfile_fixed);
-                /* check_valid_pidfile_path() can detect certain dangerous
-                   typos, but it can't prevent loading. Stop to be safe */
-                free(pidfile_fixed);
-                return;
-            }
-            free(pidfile_fixed);
-        }
+	if (pidfile)
+	{
+	    /* fix the variables in the string */
+	    pidfile_fixed = fix_variables(pidfile, s);
+
+	    /* check it's an absolute path after variable substitution */
+	    if (pidfile_fixed[0] == '/')
+	    {
+		if (unlink(pidfile_fixed) != 0 && errno != ENOENT)
+		    F_("Could not remove stale pidfile \"%s\"\n",
+		       pidfile_fixed);
+		break;
+	    }
+	    else
+	    {
+		F_("%s has pid_file with relative path \"%s\"\n", s->name,
+		   pidfile_fixed);
+		/* check_valid_pidfile_path() can detect certain dangerous
+		   typos, but it can't prevent loading. Stop to be safe */
+		free(pidfile_fixed);
+		return;
+	    }
+	    free(pidfile_fixed);
+	}
     }
 }
 
@@ -1211,12 +1211,12 @@
 
     while ((pidfile = get_next_string(&PIDFILE, s, &itt)))
     {
-        if (pidfile && pidfile[0] != '/' && pidfile[0] != '$')
-        {
-            F_("%s has pid_file with relative path \"%s\"\n", s->name,
-               pidfile);
-            return FALSE;
-        }
+	if (pidfile && pidfile[0] != '/' && pidfile[0] != '$')
+	{
+	    F_("%s has pid_file with relative path \"%s\"\n", s->name,
+	       pidfile);
+	    return FALSE;
+	}
     }
     return TRUE;
 }
@@ -1241,40 +1241,40 @@
 
     /* Check so service status is DAEMON_RUNNING, or it wont have stopped by it self */
     if (!IS_MARK(service, &DAEMON_RUNNING))
-        return (FALSE);
+	return (FALSE);
 
     /* check if the service have respawn enabled */
     if (!is(&RESPAWN, service))
     {
-        D_("Service %s doesn't have RESPAWN flag set, won't respawn!\n");
-        return (FALSE);
+	D_("Service %s doesn't have RESPAWN flag set, won't respawn!\n");
+	return (FALSE);
     }
 
     /* get times */
     if (is(&INTERNAL_LAST_RESPAWN, service))
-        last = (time_t) get_int(&INTERNAL_LAST_RESPAWN, service);
+	last = (time_t) get_int(&INTERNAL_LAST_RESPAWN, service);
     D_("Now: %i , Last: %i\n", g.now.tv_sec, last);
 
     /* get respawn_rate if set */
     if (is(&RESPAWN_RATE, service))
     {
-        respawn_rate = get_int(&RESPAWN_RATE, service);
+	respawn_rate = get_int(&RESPAWN_RATE, service);
     }
 
     /* make sure it wont respawn to often */
     if (last && (respawn_rate > 0))
     {
-        /* if times pased is less then respawn_rate */
-        if ((g.now.tv_sec - last) < respawn_rate)
-        {
-            W_("Won't respawn service %s, it was respawned %i seconds ago.\n",
-               service->name, g.now.tv_sec - last);
+	/* if times pased is less then respawn_rate */
+	if ((g.now.tv_sec - last) < respawn_rate)
+	{
+	    W_("Won't respawn service %s, it was respawned %i seconds ago.\n",
+	       service->name, g.now.tv_sec - last);
 
-            initng_common_mark_service(service,
-                                       &DAEMON_RESPAWN_RATE_EXCEEDED);
+	    initng_common_mark_service(service,
+				       &DAEMON_RESPAWN_RATE_EXCEEDED);
 
-            return (FALSE);
-        }
+	    return (FALSE);
+	}
     }
 
     /* set the next INTERNAL_LAST_RESPAWN no to use. */
@@ -1296,60 +1296,60 @@
     /* Try get the pid from PIDOF is set */
     if (is(&PIDOF, s))
     {
-        D_("getting pid by PIDOF!\n");
-        /* get pid by process name */
-        pid = get_pidof(s);
-        D_("result : %d\n", pid);
+	D_("getting pid by PIDOF!\n");
+	/* get pid by process name */
+	pid = get_pidof(s);
+	D_("result : %d\n", pid);
     }
     /* Try get the pid from PIDFILE if set */
     else if (is(&PIDFILE, s))
     {
-        D_("getting pid by PIDFILE!\n");
-        pid = get_pidfile(s);
-        D_("result : %d\n", pid);
+	D_("getting pid by PIDFILE!\n");
+	pid = get_pidfile(s);
+	D_("result : %d\n", pid);
     }
     else
     {
-        F_("No one of PIDOF or PIDFILE are set, but initng is waiting for a pid.\n");
-        return (FALSE);
+	F_("No one of PIDOF or PIDFILE are set, but initng is waiting for a pid.\n");
+	return (FALSE);
     }
 
     /* check if a process with that pid exits in the system */
     if (pid > 0 && kill(pid, 0) < 0 && (errno == ESRCH))
     {
-        F_("Got a non-existent pid %i for daemon \"%s\", maybe there is a stale pidfile around.", pid, s->name);
-        pid = -1;                           /* reset */
+	F_("Got a non-existent pid %i for daemon \"%s\", maybe there is a stale pidfile around.", pid, s->name);
+	pid = -1;			    /* reset */
     }
     else if (pid > 0)
     {
-        process_h *p = NULL;
+	process_h *p = NULL;
 
-        /* get the process to handle */
-        if (!(p = initng_process_db_get(&T_DAEMON, s)))
-        {
-            F_("Did not find a daemon process on this service!\n");
-            initng_common_mark_service(s, &DAEMON_FAIL_STARTING);
-            return (FALSE);
-        }
-
-        /* finally set the new pid - but not if forks=no, because
-           that can cause problems */
-        if (is(&FORKS, s))
-            p->pid = pid;
-
-        /* check with up_check */
-        if (initng_depend_up_check(s) != TRUE)
-        {
-            initng_common_mark_service(s, &DAEMON_UP_CHECK_FAILED);
-            return (FALSE);
-        }
+	/* get the process to handle */
+	if (!(p = initng_process_db_get(&T_DAEMON, s)))
+	{
+	    F_("Did not find a daemon process on this service!\n");
+	    initng_common_mark_service(s, &DAEMON_FAIL_STARTING);
+	    return (FALSE);
+	}
+
+	/* finally set the new pid - but not if forks=no, because
+	   that can cause problems */
+	if (is(&FORKS, s))
+	    p->pid = pid;
+
+	/* check with up_check */
+	if (initng_depend_up_check(s) != TRUE)
+	{
+	    initng_common_mark_service(s, &DAEMON_UP_CHECK_FAILED);
+	    return (FALSE);
+	}
 
 
-        /* set the new state */
-        initng_common_mark_service(s, &DAEMON_RUNNING);
+	/* set the new state */
+	initng_common_mark_service(s, &DAEMON_RUNNING);
 
-        /* return HAPPILY */
-        return (TRUE);
+	/* return HAPPILY */
+	return (TRUE);
     }
     return (FALSE);
 }

Modified: initng/trunk/plugins/daemon/test/test_pidfile.c
==============================================================================
--- initng/trunk/plugins/daemon/test/test_pidfile.c	(original)
+++ initng/trunk/plugins/daemon/test/test_pidfile.c	Wed Apr  5 22:57:12 2006
@@ -11,8 +11,8 @@
     fd = fopen(PIDFILE, "w+");
     if (!fd)
     {
-        printf("Could not open " PIDFILE " for writing!\n");
-        return;
+	printf("Could not open " PIDFILE " for writing!\n");
+	return;
     }
     fprintf(fd, "%i", getpid());
     fclose(fd);
@@ -23,18 +23,18 @@
     (void) argc;
     (void) argv;
     printf("This is a testing daemon pid %i, that will fork and leave pid in "
-           PIDFILE ". \n", getpid());
+	   PIDFILE ". \n", getpid());
 
 
     if (fork() == 0)
     {
-        printf("This is fork, pid %i\n", getpid());
-        printf("Setting pid now!\n");
-        set_pid_file();
-        sleep(20);
-        printf("Child will now die!\n");
-        unlink(PIDFILE);
-        _exit(1);
+	printf("This is fork, pid %i\n", getpid());
+	printf("Setting pid now!\n");
+	set_pid_file();
+	sleep(20);
+	printf("Child will now die!\n");
+	unlink(PIDFILE);
+	_exit(1);
     }
 
     sleep(1);

Modified: initng/trunk/plugins/daemon_clean/initng_daemon_clean.c
==============================================================================
--- initng/trunk/plugins/daemon_clean/initng_daemon_clean.c	(original)
+++ initng/trunk/plugins/daemon_clean/initng_daemon_clean.c	Wed Apr  5 22:57:12 2006
@@ -21,7 +21,7 @@
 
 
 #include <stdio.h>
-#include <stdlib.h>                         /* free() exit() */
+#include <stdlib.h>			    /* free() exit() */
 #include <string.h>
 #include <assert.h>
 #include <time.h>
@@ -44,7 +44,7 @@
 static int on_kill(active_db_h * s, process_h * p)
 {
     if (strcmp(p->pt->name, "daemon") != 0)
-        return (FALSE);
+	return (FALSE);
 
     /* start the T_DAEMON_CLEAN */
     W_("%s %s has been killed!, executing DAEMON_CLEAN!\n", p->pt->name,
@@ -63,8 +63,8 @@
     D_("module_init();\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     initng_process_db_ptype_add(&T_DAEMON_CLEAN);

Modified: initng/trunk/plugins/dbus_event/dbus_nge.c
==============================================================================
--- initng/trunk/plugins/dbus_event/dbus_nge.c	(original)
+++ initng/trunk/plugins/dbus_event/dbus_nge.c	Wed Apr  5 22:57:12 2006
@@ -26,206 +26,206 @@
     conn = dbus_bus_get(DBUS_BUS_SYSTEM, &err);
     if (dbus_error_is_set(&err))
     {
-        fprintf(stderr, "Connection Error (%s)\n", err.message);
-        dbus_error_free(&err);
+	fprintf(stderr, "Connection Error (%s)\n", err.message);
+	dbus_error_free(&err);
     }
     if (NULL == conn)
     {
-        exit(1);
+	exit(1);
     }
 
     /* request our name on the bus and check for errors */
     ret = dbus_bus_request_name(conn, SINK_REQUEST,
-                                DBUS_NAME_FLAG_REPLACE_EXISTING, &err);
+				DBUS_NAME_FLAG_REPLACE_EXISTING, &err);
     if (dbus_error_is_set(&err))
     {
-        fprintf(stderr, "Name Error (%s)\n", err.message);
-        dbus_error_free(&err);
+	fprintf(stderr, "Name Error (%s)\n", err.message);
+	dbus_error_free(&err);
     }
     if (DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER != ret)
     {
-        exit(1);
+	exit(1);
     }
 
     /* add a rule for which messages we want to see */
-    dbus_bus_add_match(conn, "type='signal',interface='" INTERFACE "'", &err);  /* see signals from the given interface */
+    dbus_bus_add_match(conn, "type='signal',interface='" INTERFACE "'", &err);	/* see signals from the given interface */
     dbus_connection_flush(conn);
     if (dbus_error_is_set(&err))
     {
-        fprintf(stderr, "Match Error (%s)\n", err.message);
-        exit(1);
+	fprintf(stderr, "Match Error (%s)\n", err.message);
+	exit(1);
     }
 
     /* loop listening for signals being emmitted */
     while (true)
     {
 
-        /* non blocking read of the next available message */
-        dbus_connection_read_write(conn, 0);
-        msg = dbus_connection_pop_message(conn);
+	/* non blocking read of the next available message */
+	dbus_connection_read_write(conn, 0);
+	msg = dbus_connection_pop_message(conn);
 
-        /* loop again if we haven't read a message */
-        if (NULL == msg)
-        {
-            sleep(1);
-            continue;
-        }
+	/* loop again if we haven't read a message */
+	if (NULL == msg)
+	{
+	    sleep(1);
+	    continue;
+	}
 
 
-        if (dbus_message_is_signal(msg, INTERFACE, "astatus_change"))
-        {
-            char *service = NULL;
-            int is = 0;
-            char *state = NULL;
+	if (dbus_message_is_signal(msg, INTERFACE, "astatus_change"))
+	{
+	    char *service = NULL;
+	    int is = 0;
+	    char *state = NULL;
 
-            /* read the parameters */
-            if (!dbus_message_iter_init(msg, &args))
-                fprintf(stderr, "Message Has No Parameters\n");
+	    /* read the parameters */
+	    if (!dbus_message_iter_init(msg, &args))
+		fprintf(stderr, "Message Has No Parameters\n");
 
-            /* First interator is a string with service name */
-            if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING)
-                exit(1);
+	    /* First interator is a string with service name */
+	    if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING)
+		exit(1);
 
-            dbus_message_iter_get_basic(&args, &service);
+	    dbus_message_iter_get_basic(&args, &service);
 
-            /* go to next iter */
-            if (!dbus_message_iter_next(&args))
-                exit(1);
+	    /* go to next iter */
+	    if (!dbus_message_iter_next(&args))
+		exit(1);
 
-            /* Second value is an int */
-            if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_INT32)
-                exit(1);
+	    /* Second value is an int */
+	    if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_INT32)
+		exit(1);
 
-            dbus_message_iter_get_basic(&args, &is);
+	    dbus_message_iter_get_basic(&args, &is);
 
-            /* go to next iter */
-            if (!dbus_message_iter_next(&args))
-                exit(1);
+	    /* go to next iter */
+	    if (!dbus_message_iter_next(&args))
+		exit(1);
 
-            /* Third arg is a string, with state name */
-            if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING)
-                exit(1);
+	    /* Third arg is a string, with state name */
+	    if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING)
+		exit(1);
 
-            dbus_message_iter_get_basic(&args, &state);
+	    dbus_message_iter_get_basic(&args, &state);
 
 
-            printf(" astatus_change service: \"%s\" is: \"%i\" state: \"%s\"\n", service, is, state);
-        }
+	    printf(" astatus_change service: \"%s\" is: \"%i\" state: \"%s\"\n", service, is, state);
+	}
 
-        if (dbus_message_is_signal(msg, INTERFACE, "system_state_change"))
-        {
-            int sys_state = 0;
+	if (dbus_message_is_signal(msg, INTERFACE, "system_state_change"))
+	{
+	    int sys_state = 0;
 
-            /* read the parameters */
-            if (!dbus_message_iter_init(msg, &args))
-                fprintf(stderr, "Message Has No Parameters\n");
+	    /* read the parameters */
+	    if (!dbus_message_iter_init(msg, &args))
+		fprintf(stderr, "Message Has No Parameters\n");
 
-            /* Second value is an int */
-            if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_INT32)
-                exit(1);
+	    /* Second value is an int */
+	    if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_INT32)
+		exit(1);
 
 
-            printf(" system_state_change state: %i\n", sys_state);
-        }
+	    printf(" system_state_change state: %i\n", sys_state);
+	}
 
-        if (dbus_message_is_signal(msg, INTERFACE, "system_output"))
-        {
-            char *service = NULL;
-            char *process = NULL;
-            char *output = NULL;
+	if (dbus_message_is_signal(msg, INTERFACE, "system_output"))
+	{
+	    char *service = NULL;
+	    char *process = NULL;
+	    char *output = NULL;
 
-            /* read the parameters */
-            if (!dbus_message_iter_init(msg, &args))
-                fprintf(stderr, "Message Has No Parameters\n");
+	    /* read the parameters */
+	    if (!dbus_message_iter_init(msg, &args))
+		fprintf(stderr, "Message Has No Parameters\n");
 
-            /* First interator is a string with service name */
-            if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING)
-                exit(1);
+	    /* First interator is a string with service name */
+	    if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING)
+		exit(1);
 
-            dbus_message_iter_get_basic(&args, &service);
+	    dbus_message_iter_get_basic(&args, &service);
 
-            /* go to next iter */
-            if (!dbus_message_iter_next(&args))
-                exit(1);
+	    /* go to next iter */
+	    if (!dbus_message_iter_next(&args))
+		exit(1);
 
-            if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING)
-                exit(1);
+	    if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING)
+		exit(1);
 
-            dbus_message_iter_get_basic(&args, &process);
+	    dbus_message_iter_get_basic(&args, &process);
 
-            /* go to next iter */
-            if (!dbus_message_iter_next(&args))
-                exit(1);
+	    /* go to next iter */
+	    if (!dbus_message_iter_next(&args))
+		exit(1);
 
-            if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING)
-                exit(1);
+	    if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING)
+		exit(1);
 
-            dbus_message_iter_get_basic(&args, &output);
+	    dbus_message_iter_get_basic(&args, &output);
 
 
-            printf(" system_output service: %s process: %s \n%s\n", service,
-                   process, output);
-        }
+	    printf(" system_output service: %s process: %s \n%s\n", service,
+		   process, output);
+	}
 
-        if (dbus_message_is_signal(msg, INTERFACE, "print_error"))
-        {
-            int mt = 0;
-            char *file = NULL;
-            char *func = NULL;
-            int line = 0;
-            char *message = NULL;
+	if (dbus_message_is_signal(msg, INTERFACE, "print_error"))
+	{
+	    int mt = 0;
+	    char *file = NULL;
+	    char *func = NULL;
+	    int line = 0;
+	    char *message = NULL;
 
-            /* read the parameters */
-            if (!dbus_message_iter_init(msg, &args))
-                fprintf(stderr, "Message Has No Parameters\n");
+	    /* read the parameters */
+	    if (!dbus_message_iter_init(msg, &args))
+		fprintf(stderr, "Message Has No Parameters\n");
 
-            if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_INT32)
-                exit(1);
+	    if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_INT32)
+		exit(1);
 
-            dbus_message_iter_get_basic(&args, &mt);
+	    dbus_message_iter_get_basic(&args, &mt);
 
-            /* go to next iter */
-            if (!dbus_message_iter_next(&args))
-                exit(1);
+	    /* go to next iter */
+	    if (!dbus_message_iter_next(&args))
+		exit(1);
 
-            if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING)
-                exit(1);
+	    if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING)
+		exit(1);
 
-            dbus_message_iter_get_basic(&args, &file);
+	    dbus_message_iter_get_basic(&args, &file);
 
-            /* go to next iter */
-            if (!dbus_message_iter_next(&args))
-                exit(1);
+	    /* go to next iter */
+	    if (!dbus_message_iter_next(&args))
+		exit(1);
 
-            if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING)
-                exit(1);
+	    if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING)
+		exit(1);
 
-            dbus_message_iter_get_basic(&args, &func);
+	    dbus_message_iter_get_basic(&args, &func);
 
-            /* go to next iter */
-            if (!dbus_message_iter_next(&args))
-                exit(1);
+	    /* go to next iter */
+	    if (!dbus_message_iter_next(&args))
+		exit(1);
 
-            if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_INT32)
-                exit(1);
+	    if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_INT32)
+		exit(1);
 
-            dbus_message_iter_get_basic(&args, &line);
+	    dbus_message_iter_get_basic(&args, &line);
 
-            /* go to next iter */
-            if (!dbus_message_iter_next(&args))
-                exit(1);
+	    /* go to next iter */
+	    if (!dbus_message_iter_next(&args))
+		exit(1);
 
-            if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING)
-                exit(1);
+	    if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_STRING)
+		exit(1);
 
-            dbus_message_iter_get_basic(&args, &message);
+	    dbus_message_iter_get_basic(&args, &message);
 
-            printf(" system_output service: mt: %i file: %s func: %s line: %i\n%s\n", mt, file, func, line, message);
-        }
+	    printf(" system_output service: mt: %i file: %s func: %s line: %i\n%s\n", mt, file, func, line, message);
+	}
 
 
-        /* free the message */
-        dbus_message_unref(msg);
+	/* free the message */
+	dbus_message_unref(msg);
     }
 
     /* close the connection */

Modified: initng/trunk/plugins/dbus_event/initng_dbusevent.c
==============================================================================
--- initng/trunk/plugins/dbus_event/initng_dbusevent.c	(original)
+++ initng/trunk/plugins/dbus_event/initng_dbusevent.c	Wed Apr  5 22:57:12 2006
@@ -67,9 +67,9 @@
 static int connect_to_dbus(void);
 static void system_state_change(e_is state);
 static int system_pipe_watchers(active_db_h * service, process_h * process,
-                                char *output);
+				char *output);
 static int print_error(e_mt mt, const char *file, const char *func, int line,
-                       const char *format, va_list arg);
+		       const char *format, va_list arg);
 
 static dbus_bool_t add_dbus_watch(DBusWatch * watch, void *data);
 static void rem_dbus_watch(DBusWatch * watch, void *data);
@@ -98,8 +98,8 @@
 
     if (w == NULL)
     {
-        printf("Memory allocation failed\n");
-        return FALSE;
+	printf("Memory allocation failed\n");
+	return FALSE;
     }
 
     w->fdw.fds = dbus_watch_get_fd(watch);
@@ -108,7 +108,7 @@
     w->fdw.what = 0;
 
     dbus_watch_set_data(watch, w, free_dbus_watch_data);
-    toggled_dbus_watch(watch, data);        /* to set initial state */
+    toggled_dbus_watch(watch, data);	    /* to set initial state */
 
     initng_plugin_hook_add(&g.FDWATCHERS, 30, &w->fdw);
 
@@ -129,15 +129,15 @@
     w->fdw.what = 0;
     if (dbus_watch_get_enabled(watch))
     {
-        int flags = dbus_watch_get_flags(watch);
+	int flags = dbus_watch_get_flags(watch);
 
-        if (flags & DBUS_WATCH_READABLE)
-            w->fdw.what |= FDW_READ;
+	if (flags & DBUS_WATCH_READABLE)
+	    w->fdw.what |= FDW_READ;
 
-        if (flags & DBUS_WATCH_WRITABLE)
-            w->fdw.what |= FDW_WRITE;
+	if (flags & DBUS_WATCH_WRITABLE)
+	    w->fdw.what |= FDW_WRITE;
 
-        w->fdw.what |= FDW_ERROR;
+	w->fdw.what |= FDW_ERROR;
     }
 
 }
@@ -159,13 +159,13 @@
     /* TODO - handle DBUS_WATCH_HANGUP ? */
 
     if (what & FDW_READ)
-        flgs |= DBUS_WATCH_READABLE;
+	flgs |= DBUS_WATCH_READABLE;
 
     if (what & FDW_WRITE)
-        flgs |= DBUS_WATCH_WRITABLE;
+	flgs |= DBUS_WATCH_WRITABLE;
 
     if (what & FDW_ERROR)
-        flgs |= DBUS_WATCH_ERROR;
+	flgs |= DBUS_WATCH_ERROR;
 
     dbus_watch_handle(w->dbus, flgs);
 }
@@ -183,37 +183,37 @@
     const char *state_name = service->current_state->state_name;
 
     if (conn == NULL)
-        return (TRUE);
+	return (TRUE);
 
     D_("Sending signal with value \"%.10s\" %i \"%.10s\"\n", service_name, is,
        state_name);
 
     /* create a signal & check for errors */
     msg = dbus_message_new_signal(OBJECT,   /* object name of the signal */
-                                  INTERFACE,    /* interface name of the signal */
-                                  "astatus_change");    /* name of the signal */
+				  INTERFACE,	/* interface name of the signal */
+				  "astatus_change");	/* name of the signal */
     if (NULL == msg)
     {
-        F_("Unable to create ne dbus signal\n");
-        return (TRUE);
+	F_("Unable to create ne dbus signal\n");
+	return (TRUE);
     }
 
 
     /* Append some arguments to the call */
     if (!dbus_message_append_args
-        (msg, DBUS_TYPE_STRING, &service_name, DBUS_TYPE_INT32, &is,
-         DBUS_TYPE_STRING, &state_name, DBUS_TYPE_INVALID))
+	(msg, DBUS_TYPE_STRING, &service_name, DBUS_TYPE_INT32, &is,
+	 DBUS_TYPE_STRING, &state_name, DBUS_TYPE_INVALID))
     {
-        F_("Unable to append args to dbus signal!\n");
-        return (TRUE);
+	F_("Unable to append args to dbus signal!\n");
+	return (TRUE);
     }
 
 
     /* send the message and flush the connection */
     if (!dbus_connection_send(conn, msg, &serial))
     {
-        F_("Unable to send dbus signal!\n");
-        return (TRUE);
+	F_("Unable to send dbus signal!\n");
+	return (TRUE);
     }
     // dbus_connection_flush(conn);
 
@@ -231,33 +231,33 @@
     dbus_uint32_t serial = 0;
 
     if (conn == NULL)
-        return;
+	return;
 
     /* create a signal & check for errors */
     msg = dbus_message_new_signal(OBJECT,   /* object name of the signal */
-                                  INTERFACE,    /* interface name of the signal */
-                                  "system_state_change");       /* name of the signal */
+				  INTERFACE,	/* interface name of the signal */
+				  "system_state_change");	/* name of the signal */
     if (NULL == msg)
     {
-        F_("Unable to create new dbus signal\n");
-        return;
+	F_("Unable to create new dbus signal\n");
+	return;
     }
 
 
     /* Append some arguments to the call */
     if (!dbus_message_append_args
-        (msg, DBUS_TYPE_INT32, &state, DBUS_TYPE_INVALID))
+	(msg, DBUS_TYPE_INT32, &state, DBUS_TYPE_INVALID))
     {
-        F_("Unable to append args to dbus signal!\n");
-        return;
+	F_("Unable to append args to dbus signal!\n");
+	return;
     }
 
 
     /* send the message and flush the connection */
     if (!dbus_connection_send(conn, msg, &serial))
     {
-        F_("Unable to send dbus signal!\n");
-        return;
+	F_("Unable to send dbus signal!\n");
+	return;
     }
     //dbus_connection_flush(conn);
 
@@ -269,7 +269,7 @@
 }
 
 static int system_pipe_watchers(active_db_h * service, process_h * process,
-                                char *output)
+				char *output)
 {
     DBusMessage *msg;
     dbus_uint32_t serial = 0;
@@ -277,34 +277,34 @@
     const char *process_name = process->pt->name;
 
     if (conn == NULL)
-        return (TRUE);
+	return (TRUE);
 
     /* create a signal & check for errors */
     msg = dbus_message_new_signal(OBJECT,   /* object name of the signal */
-                                  INTERFACE,    /* interface name of the signal */
-                                  "system_output");     /* name of the signal */
+				  INTERFACE,	/* interface name of the signal */
+				  "system_output");	/* name of the signal */
     if (NULL == msg)
     {
-        F_("Unable to create new dbus signal\n");
-        return (TRUE);
+	F_("Unable to create new dbus signal\n");
+	return (TRUE);
     }
 
 
     /* Append some arguments to the call */
     if (!dbus_message_append_args
-        (msg, DBUS_TYPE_STRING, &service_name, DBUS_TYPE_STRING,
-         &process_name, DBUS_TYPE_STRING, &output, DBUS_TYPE_INVALID))
+	(msg, DBUS_TYPE_STRING, &service_name, DBUS_TYPE_STRING,
+	 &process_name, DBUS_TYPE_STRING, &output, DBUS_TYPE_INVALID))
     {
-        F_("Unable to append args to dbus signal!\n");
-        return (TRUE);
+	F_("Unable to append args to dbus signal!\n");
+	return (TRUE);
     }
 
 
     /* send the message and flush the connection */
     if (!dbus_connection_send(conn, msg, &serial))
     {
-        F_("Unable to send dbus signal!\n");
-        return (TRUE);
+	F_("Unable to send dbus signal!\n");
+	return (TRUE);
     }
     //dbus_connection_flush(conn);
 
@@ -316,22 +316,22 @@
 }
 
 static int print_error(e_mt mt, const char *file, const char *func,
-                       int line, const char *format, va_list arg)
+		       int line, const char *format, va_list arg)
 {
     DBusMessage *msg;
     dbus_uint32_t serial = 0;
 
     if (conn == NULL)
-        return (TRUE);
+	return (TRUE);
 
     /* create a signal & check for errors */
     msg = dbus_message_new_signal(OBJECT,   /* object name of the signal */
-                                  INTERFACE,    /* interface name of the signal */
-                                  "print_error");       /* name of the signal */
+				  INTERFACE,	/* interface name of the signal */
+				  "print_error");	/* name of the signal */
     if (NULL == msg)
     {
-        F_("Unable to create new dbus signal\n");
-        return (TRUE);
+	F_("Unable to create new dbus signal\n");
+	return (TRUE);
     }
 
     /* compose the message */
@@ -341,20 +341,20 @@
 
     /* Append some arguments to the call */
     if (!dbus_message_append_args
-        (msg, DBUS_TYPE_INT32, &mt, DBUS_TYPE_STRING, &file, DBUS_TYPE_STRING,
-         &func, DBUS_TYPE_INT32, &line, DBUS_TYPE_STRING, &message,
-         DBUS_TYPE_INVALID))
+	(msg, DBUS_TYPE_INT32, &mt, DBUS_TYPE_STRING, &file, DBUS_TYPE_STRING,
+	 &func, DBUS_TYPE_INT32, &line, DBUS_TYPE_STRING, &message,
+	 DBUS_TYPE_INVALID))
     {
-        F_("Unable to append args to dbus signal!\n");
-        return (TRUE);
+	F_("Unable to append args to dbus signal!\n");
+	return (TRUE);
     }
 
 
     /* send the message and flush the connection */
     if (!dbus_connection_send(conn, msg, &serial))
     {
-        F_("Unable to send dbus signal!\n");
-        return (TRUE);
+	F_("Unable to send dbus signal!\n");
+	return (TRUE);
     }
     //dbus_connection_flush(conn);
 
@@ -374,13 +374,13 @@
 {
     /* only react on a SIGHUP signal */
     if (signal != SIGHUP)
-        return;
+	return;
 
     /* close if open */
     if (conn)
     {
-        dbus_connection_close(conn);
-        conn = NULL;
+	dbus_connection_close(conn);
+	conn = NULL;
     }
 
     /* and open again */
@@ -400,27 +400,27 @@
     conn = dbus_bus_get(DBUS_BUS_SYSTEM, &err);
     if (dbus_error_is_set(&err))
     {
-        F_("Connection Error (%s)\n", err.message);
-        dbus_error_free(&err);
+	F_("Connection Error (%s)\n", err.message);
+	dbus_error_free(&err);
     }
     if (conn == NULL)
     {
-        return (FALSE);
+	return (FALSE);
     }
 
 
     dbus_connection_set_watch_functions(conn, add_dbus_watch, rem_dbus_watch,
-                                        toggled_dbus_watch, NULL, NULL);
+					toggled_dbus_watch, NULL, NULL);
 
     /* register our name on the bus, and check for errors */
     ret = dbus_bus_request_name(conn, SOURCE_REQUEST,
-                                DBUS_NAME_FLAG_REPLACE_EXISTING, &err);
+				DBUS_NAME_FLAG_REPLACE_EXISTING, &err);
 
     /* Make sure no error is set */
     if (dbus_error_is_set(&err))
     {
-        F_("Name Error (%s)\n", err.message);
-        dbus_error_free(&err);
+	F_("Name Error (%s)\n", err.message);
+	dbus_error_free(&err);
     }
 
     /*  IF this is set, initng is the owner of initng.signal.source */
@@ -437,8 +437,8 @@
 
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", INITNG_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", INITNG_VERSION, api_version);
+	return (FALSE);
     }
 
     connect_to_dbus();
@@ -462,8 +462,8 @@
 {
     if (conn != NULL)
     {
-        dbus_connection_close(conn);
-        conn = NULL;
+	dbus_connection_close(conn);
+	conn = NULL;
     }
 
     initng_plugin_hook_del(&g.SIGNAL, &check_socket);

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	Wed Apr  5 22:57:12 2006
@@ -112,35 +112,35 @@
     for (i = 0; i < 1024; i++)
     {
 
-        currentC = NULL;
-        while_list(currentC, &g.FDWATCHERS)
-        {
-            if (currentC->c.fdh->fds != i)
-                continue;
-
-            mprintf(&string, " %i: Used by plugin: %s\n", i,
-                    currentC->from_file);
-            break;
-            /* Call db fs */
-        }
-
-        currentA = NULL;
-        while_active_db(currentA)
-        {
-            currentP = NULL;
-            while_processes(currentP, currentA)
-            {
-                if (currentP->out_pipe[0] != i)
-                    continue;
-
-                mprintf(&string, " %i: Used service: %s, process: %s\n", i,
-                        currentA->name, currentP->pt->name);
-                break;
-            }
-        }
+	currentC = NULL;
+	while_list(currentC, &g.FDWATCHERS)
+	{
+	    if (currentC->c.fdh->fds != i)
+		continue;
+
+	    mprintf(&string, " %i: Used by plugin: %s\n", i,
+		    currentC->from_file);
+	    break;
+	    /* Call db fs */
+	}
+
+	currentA = NULL;
+	while_active_db(currentA)
+	{
+	    currentP = NULL;
+	    while_processes(currentP, currentA)
+	    {
+		if (currentP->out_pipe[0] != i)
+		    continue;
+
+		mprintf(&string, " %i: Used service: %s, process: %s\n", i,
+			currentA->name, currentP->pt->name);
+		break;
+	    }
+	}
 
 
-        /*mprintf(&string, " %i:\n", i); */
+	/*mprintf(&string, " %i:\n", i); */
     }
     return (string);
 }
@@ -160,17 +160,17 @@
 
     D_("Print service \"%s\"\n", arg);
     if (arg && strlen(arg) > 1
-        && (s = initng_service_cache_find_in_name(arg)))
+	&& (s = initng_service_cache_find_in_name(arg)))
     {
-        return (service_db_print(s));
+	return (service_db_print(s));
     }
     else if (arg && strlen(arg) > 1)
     {
-        return (i_strdup("No such service.\n"));
+	return (i_strdup("No such service.\n"));
     }
     else
     {
-        return (service_db_print_all());
+	return (service_db_print_all());
     }
 
     return (NULL);
@@ -182,15 +182,15 @@
 
     if (arg && strlen(arg) > 1 && (s = initng_active_db_find_in_name(arg)))
     {
-        return (active_db_print(s));
+	return (active_db_print(s));
     }
     else if (arg && strlen(arg) > 1)
     {
-        return (i_strdup("No such service."));
+	return (i_strdup("No such service."));
     }
     else
     {
-        return (active_db_print_all());
+	return (active_db_print_all());
     }
 
     return (NULL);
@@ -204,22 +204,22 @@
     (void) arg;
     switch (g.verbose)
     {
-        case 0:
-            g.verbose = 1;
-            break;
-        case 1:
-            g.verbose = 0;
-            break;
-        case 2:
-            g.verbose = 3;
-            break;
-        case 3:
-            g.verbose = 2;
-            break;
-        default:
-            g.verbose = 0;
-            W_("Unknown verbose id %i\n", g.verbose);
-            break;
+	case 0:
+	    g.verbose = 1;
+	    break;
+	case 1:
+	    g.verbose = 0;
+	    break;
+	case 2:
+	    g.verbose = 3;
+	    break;
+	case 3:
+	    g.verbose = 2;
+	    break;
+	default:
+	    g.verbose = 0;
+	    W_("Unknown verbose id %i\n", g.verbose);
+	    break;
     }
     return (g.verbose);
 }
@@ -227,7 +227,7 @@
 static int cmd_add_verbose(char *arg)
 {
     if (!arg)
-        return (FALSE);
+	return (FALSE);
 
     return (initng_error_verbose_add(arg));
 }
@@ -235,7 +235,7 @@
 static int cmd_del_verbose(char *arg)
 {
     if (!arg)
-        return (FALSE);
+	return (FALSE);
 
     return (initng_error_verbose_del(arg));
 }
@@ -246,14 +246,14 @@
     D_("module_init(stcmd);\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     initng_command_add(&LIST_FDS);
     if (!g.i_am_init)
     {
-        initng_command_add(&QUIT_INITNG);
+	initng_command_add(&QUIT_INITNG);
     }
     initng_command_add(&PRINT_SERVICE_DB);
     initng_command_add(&PRINT_ACTIVE_DB);
@@ -277,7 +277,7 @@
     initng_command_del(&LIST_FDS);
     if (!g.i_am_init)
     {
-        initng_command_del(&QUIT_INITNG);
+	initng_command_del(&QUIT_INITNG);
     }
     initng_command_del(&PRINT_SERVICE_DB);
     initng_command_del(&PRINT_ACTIVE_DB);

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	Wed Apr  5 22:57:12 2006
@@ -69,68 +69,68 @@
 
     for (i = 0; string[i] != 0; i++)
     {
-        if (IS_PRINTABLE(string[i]))
-            mprintf(to, "%c", string[i]);
-        else
-            mprintf(to, "^%c", string[i] ^ 0x40);
+	if (IS_PRINTABLE(string[i]))
+	    mprintf(to, "%c", string[i]);
+	else
+	    mprintf(to, "^%c", string[i] ^ 0x40);
     }
 }
 
 static void print_sdata(s_data * tmp, char **string)
 {
     if (!tmp->type)
-        return;
+	return;
     switch (tmp->type->opt_type)
     {
-        case STRING:
-        case STRINGS:
-            if (!tmp->t.s)
-            {
-                F_("empty value!\n");
-                return;
-            }
-            mprintf(string, " @@ %-24s : \"", tmp->type->opt_name);
-
-            print_string_value(tmp->t.s, string);
-            mprintf(string, "\"\n");
-            return;
-        case VARIABLE_STRING:
-        case VARIABLE_STRINGS:
-            if (!tmp->t.s)
-            {
-                F_("empty value!\n");
-                return;
-            }
-            if (tmp->vn)
-                mprintf(string, " @@ %-13s %-10s : \"", tmp->type->opt_name,
-                        tmp->vn);
-            else
-                mprintf(string, " @@ %-13s %-10s : \"", tmp->type->opt_name,
-                        tmp->vn);
-
-            print_string_value(tmp->t.s, string);
-            mprintf(string, "\"\n");
-            return;
-        case INT:
-            mprintf(string, " @@ %-24s : \"%i\"\n", tmp->type->opt_name,
-                    tmp->t.i);
-            return;
-        case VARIABLE_INT:
-            mprintf(string, " @@ %-13s %-10s : \"%i\"\n", tmp->type->opt_name,
-                    tmp->vn, tmp->t.i);
-            return;
-        case SET:
-            mprintf(string, " @@ %-24s\n", tmp->type->opt_name);
-            return;
-        case VARIABLE_SET:
-            mprintf(string, " @@ %-13s %-10s\n", tmp->type->opt_name,
-                    tmp->vn);
-            return;
-        case ALIAS:
-            mprintf(string, " @@ ALIAS %-24s\n", tmp->type->opt_name);
-            return;
-        default:
-            return;
+	case STRING:
+	case STRINGS:
+	    if (!tmp->t.s)
+	    {
+		F_("empty value!\n");
+		return;
+	    }
+	    mprintf(string, " @@ %-24s : \"", tmp->type->opt_name);
+
+	    print_string_value(tmp->t.s, string);
+	    mprintf(string, "\"\n");
+	    return;
+	case VARIABLE_STRING:
+	case VARIABLE_STRINGS:
+	    if (!tmp->t.s)
+	    {
+		F_("empty value!\n");
+		return;
+	    }
+	    if (tmp->vn)
+		mprintf(string, " @@ %-13s %-10s : \"", tmp->type->opt_name,
+			tmp->vn);
+	    else
+		mprintf(string, " @@ %-13s %-10s : \"", tmp->type->opt_name,
+			tmp->vn);
+
+	    print_string_value(tmp->t.s, string);
+	    mprintf(string, "\"\n");
+	    return;
+	case INT:
+	    mprintf(string, " @@ %-24s : \"%i\"\n", tmp->type->opt_name,
+		    tmp->t.i);
+	    return;
+	case VARIABLE_INT:
+	    mprintf(string, " @@ %-13s %-10s : \"%i\"\n", tmp->type->opt_name,
+		    tmp->vn, tmp->t.i);
+	    return;
+	case SET:
+	    mprintf(string, " @@ %-24s\n", tmp->type->opt_name);
+	    return;
+	case VARIABLE_SET:
+	    mprintf(string, " @@ %-13s %-10s\n", tmp->type->opt_name,
+		    tmp->vn);
+	    return;
+	case ALIAS:
+	    mprintf(string, " @@ ALIAS %-24s\n", tmp->type->opt_name);
+	    return;
+	default:
+	    return;
     }
 
 }
@@ -148,27 +148,27 @@
     /* if string is emty print header */
     if (!(*string))
     {
-        mprintf(string, "\n#  %s  \"%s", s->type->name, s->name);
-        if (s->father_name)
-            mprintf(string, " : %s", s->father_name);
-        mprintf(string, "\"\n");
+	mprintf(string, "\n#  %s  \"%s", s->type->name, s->name);
+	if (s->father_name)
+	    mprintf(string, " : %s", s->father_name);
+	mprintf(string, "\"\n");
     }
 
     mprintf(string, "    ---------------------------------- \n");
 
     list_for_each_entry(tmp, &s->data.head.list, list)
     {
-        print_sdata(tmp, string);
+	print_sdata(tmp, string);
     }
 
     /* if father with data exits, print it */
     if (s->father)
     {
-        D_("FATHER FOUND %s\n", s->name);
-        service_db_print_u(s->father, string);
+	D_("FATHER FOUND %s\n", s->name);
+	service_db_print_u(s->father, string);
     }
     else
-        D_("FATHER NOT FOUND %s\n", s->name);
+	D_("FATHER NOT FOUND %s\n", s->name);
 }
 
 
@@ -184,8 +184,8 @@
 
     while_service_cache(current)
     {
-        D_("printing %s ...\n", current->name);
-        service_db_print_u(current, &string);
+	D_("printing %s ...\n", current->name);
+	service_db_print_u(current, &string);
     }
 
     return (string);
@@ -198,12 +198,12 @@
     mprintf(string, "\t\tPid: %i\n", p->pid);
     mprintf(string, "\t\tR_code: %i\n", p->r_code);
     mprintf(string, "\t\tFds read: %i, write: %i\n", p->out_pipe[0],
-            p->out_pipe[1]);
+	    p->out_pipe[1]);
     mprintf(string, "\t\tpst: %i\n", p->pst);
     if (p->buffer)
     {
-        mprintf(string, "\t\tBuffer (%i): \"%s\"\n", p->buffer_allocated,
-                p->buffer);
+	mprintf(string, "\t\tBuffer (%i): \"%s\"\n", p->buffer_allocated,
+		p->buffer);
     }
 
 }
@@ -224,29 +224,29 @@
 
     mprintf(string, "\n#  %s  \"%s", s->type->name, s->name);
     if (s->from_service && s->from_service->father_name)
-        mprintf(string, " : %s", s->from_service->father_name);
+	mprintf(string, " : %s", s->from_service->father_name);
     mprintf(string, "\"\n");
 
     if (s->current_state && s->current_state->state_name)
     {
-        mprintf(string, "\tactive status: %s\n",
-                s->current_state->state_name);
+	mprintf(string, "\tactive status: %s\n",
+		s->current_state->state_name);
     }
 
     gettimeofday(&now, NULL);
 
     mprintf(string,
-            "\tlast_rought_time: %ims time_last_state: %ims time_current_state: %ims\n",
-            MS_DIFF(now, s->last_rought_time), MS_DIFF(now,
-                                                       s->
-                                                       time_last_state),
-            MS_DIFF(now, s->time_current_state));
+	    "\tlast_rought_time: %ims time_last_state: %ims time_current_state: %ims\n",
+	    MS_DIFF(now, s->last_rought_time), MS_DIFF(now,
+						       s->
+						       time_last_state),
+	    MS_DIFF(now, s->time_current_state));
 
     /* print processes if any */
 
     while_processes(process, s)
     {
-        active_db_print_process(process, string);
+	active_db_print_process(process, string);
     }
 
 
@@ -262,12 +262,12 @@
 
     if (s->from_service)
     {
-        mprintf(string, "\tservice_db opts:\n");
-        tmp = NULL;
-        list_for_each_entry(tmp, &(s->from_service->data.head.list), list)
-        {
-            print_sdata(tmp, string);
-        }
+	mprintf(string, "\tservice_db opts:\n");
+	tmp = NULL;
+	list_for_each_entry(tmp, &(s->from_service->data.head.list), list)
+	{
+	    print_sdata(tmp, string);
+	}
     }
 }
 
@@ -281,7 +281,7 @@
 
     while_active_db(apt)
     {
-        active_db_print_u(apt, &string);
+	active_db_print_u(apt, &string);
     }
 
     return (string);

Modified: initng/trunk/plugins/envparser/initng_envparser.c
==============================================================================
--- initng/trunk/plugins/envparser/initng_envparser.c	(original)
+++ initng/trunk/plugins/envparser/initng_envparser.c	Wed Apr  5 22:57:12 2006
@@ -54,22 +54,22 @@
 
     /* make sure the env_file is set */
     if (!is(&ENV_FILE, s))
-        return (TRUE);
+	return (TRUE);
 
     /* TODO, put this into one while loop */
 
     /* Parse all ENV_FILE's */
     while ((file = get_next_string(&ENV_FILE, s, &itt)))
     {
-        parse_file(file, s);
+	parse_file(file, s);
     }
     itt = NULL;
 
     /* Parse all, and stop if files don't exits, or not parseable */
     while ((file = get_next_string(&ENV_FILE_REQUIRED, s, &itt)))
     {
-        if (parse_file(file, s) == FALSE)
-            return (FALSE);
+	if (parse_file(file, s) == FALSE)
+	    return (FALSE);
     }
 
     return (TRUE);
@@ -83,122 +83,122 @@
 
     /* open that file */
     if (!open_read_close(file, &file_content))
-        return (FALSE);
+	return (FALSE);
 
 
     /* Start Parsing */
     point = file_content;
     while (point[0])
     {
-        char *vn = NULL;        /* env variable name  */
-        char *vv = NULL;        /* env variable value */
+	char *vn = NULL;	/* env variable name  */
+	char *vv = NULL;	/* env variable value */
 
-        int i = 0;
-        int quoted = FALSE;
+	int i = 0;
+	int quoted = FALSE;
 
-        /* skip initial spaces */
-        JUMP_SPACES(point);
-        if (!point[0])
-            break;
-
-        /* skip rows, starting with '#' */
-        if (point[0] == '#')
-        {
-            JUMP_TO_NEXT_ROW(point);
-            continue;
-        }
-
-        /* make sure the line contains (and doesn't begin with) a '=', if not, its not an ENV line */
-        i = 0;
-        while (point[i] && point[i] != '=' && point[i] != '\n')
-            i++;
-        if (point[i] != '=' || i == 0)
-        {
-            JUMP_TO_NEXT_ROW(point);
-            continue;
-        }
-
-        /* skip ending spaces and '=' char */
-        while (point[i - 1] == ' ' || point[i - 1] == '\t')
-            i--;
-
-        /* copy that vn */
-        vn = i_strndup(point, i);
-
-        point += i;
-
-        /* jump any spaces and '=' char */
-        JUMP_SPACES(point);
-        if (point[0] == '=')
-            point++;
-        JUMP_SPACES(point);
-
-        i = 0;
-        while (point[i] && (quoted != FALSE || point[i] != '\n'))
-        {
-            if (point[i] == '"' || point[i] == '\'')
-            {
-
-                if (quoted == FALSE)
-                    quoted = point[i];
-                else if (quoted == point[i])
-                    quoted = FALSE;
-
-                if (i == 0)
-                {
-                    point++;
-                    continue;
-                }
-
-                if (vv)
-                {
-                    vv = i_realloc(vv, sizeof(char) * (strlen(vv) + i + 1));
-                    strncat(vv, point, i);
-                }
-                else
-                    vv = i_strndup(point, i);
-
-                point += (i + 1);
-                i = 0;
-            }
-            else
-                i++;
-        }
-
-        /* copy the variable value */
-        if (vv && i > 0)
-        {
-            vv = i_realloc(vv, sizeof(char) * (strlen(vv) + i));
-            strncat(vv, point, i);
-        }
-        else if (i > 0)
-            vv = i_strndup(point, i);
-        else if (!vv)
-        {
-            /* empty value. make sure vv contains at least '\0' */
-            vv = i_calloc(1, sizeof(char));
-            vv[0] = '\0';
-        }
-
-        point += i;
-
-        /* add to service cache */
-        if (is_var(&ENV, vn, s))
-        {
-            const char *oldval = get_string_var(&ENV, vn,
-                                                s);
-            char *fixed = fix_redefined_variable(vn, oldval, vv);
-
-            free(vv);
-            set_string_var(&ENV, vn, s, fixed);
-        }
-        else
-        {
-            set_string_var(&ENV, vn, s, vv);
-        }
+	/* skip initial spaces */
+	JUMP_SPACES(point);
+	if (!point[0])
+	    break;
+
+	/* skip rows, starting with '#' */
+	if (point[0] == '#')
+	{
+	    JUMP_TO_NEXT_ROW(point);
+	    continue;
+	}
+
+	/* make sure the line contains (and doesn't begin with) a '=', if not, its not an ENV line */
+	i = 0;
+	while (point[i] && point[i] != '=' && point[i] != '\n')
+	    i++;
+	if (point[i] != '=' || i == 0)
+	{
+	    JUMP_TO_NEXT_ROW(point);
+	    continue;
+	}
+
+	/* skip ending spaces and '=' char */
+	while (point[i - 1] == ' ' || point[i - 1] == '\t')
+	    i--;
+
+	/* copy that vn */
+	vn = i_strndup(point, i);
+
+	point += i;
+
+	/* jump any spaces and '=' char */
+	JUMP_SPACES(point);
+	if (point[0] == '=')
+	    point++;
+	JUMP_SPACES(point);
+
+	i = 0;
+	while (point[i] && (quoted != FALSE || point[i] != '\n'))
+	{
+	    if (point[i] == '"' || point[i] == '\'')
+	    {
+
+		if (quoted == FALSE)
+		    quoted = point[i];
+		else if (quoted == point[i])
+		    quoted = FALSE;
+
+		if (i == 0)
+		{
+		    point++;
+		    continue;
+		}
+
+		if (vv)
+		{
+		    vv = i_realloc(vv, sizeof(char) * (strlen(vv) + i + 1));
+		    strncat(vv, point, i);
+		}
+		else
+		    vv = i_strndup(point, i);
+
+		point += (i + 1);
+		i = 0;
+	    }
+	    else
+		i++;
+	}
+
+	/* copy the variable value */
+	if (vv && i > 0)
+	{
+	    vv = i_realloc(vv, sizeof(char) * (strlen(vv) + i));
+	    strncat(vv, point, i);
+	}
+	else if (i > 0)
+	    vv = i_strndup(point, i);
+	else if (!vv)
+	{
+	    /* empty value. make sure vv contains at least '\0' */
+	    vv = i_calloc(1, sizeof(char));
+	    vv[0] = '\0';
+	}
+
+	point += i;
+
+	/* add to service cache */
+	if (is_var(&ENV, vn, s))
+	{
+	    const char *oldval = get_string_var(&ENV, vn,
+						s);
+	    char *fixed = fix_redefined_variable(vn, oldval, vv);
+
+	    free(vv);
+	    set_string_var(&ENV, vn, s, fixed);
+	}
+	else
+	{
+	    set_string_var(&ENV, vn, s, vv);
+	}
 
-        /* go to next row and parse */
-        JUMP_TO_NEXT_ROW(point);
+	/* go to next row and parse */
+	JUMP_TO_NEXT_ROW(point);
     }
     free(file_content);
     return (TRUE);
@@ -208,8 +208,8 @@
 {
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
     D_("module_init();\n");
 

Modified: initng/trunk/plugins/find/initng_find.c
==============================================================================
--- initng/trunk/plugins/find/initng_find.c	(original)
+++ initng/trunk/plugins/find/initng_find.c	Wed Apr  5 22:57:12 2006
@@ -54,68 +54,68 @@
 
     path = opendir(dir);
     if (!path)
-        return (NULL);
+	return (NULL);
 
     /* Walk thru all files in dir */
     while ((dir_e = readdir(path)))
     {
-        /* skip dirs/files starting with a . */
-        if (dir_e->d_name[0] == '.')
-            continue;
-
-
-        /* set up full path */
-        strncpy(file, dir, 40);
-        strcat(file, "/");
-        strcat(file, dir_e->d_name);
+	/* skip dirs/files starting with a . */
+	if (dir_e->d_name[0] == '.')
+	    continue;
+
+
+	/* set up full path */
+	strncpy(file, dir, 40);
+	strcat(file, "/");
+	strcat(file, dir_e->d_name);
 
 
 
-        /* get the stat of that file */
-        if (stat(file, &fstat) != 0)
-        {
-            printf("File %s failed stat errno: %s\n", file, strerror(errno));
-            continue;
-        }
-
-        /* if it is a dir */
-        if (S_ISDIR(fstat.st_mode))
-        {
-            /* Cal ur self function with that dir */
-            tmp = search_dir(for_service, file);
-            if (tmp)
-                return (tmp);
-
-            /* continue while loop */
-            continue;
-        }
-
-        /* if it is a file */
-        if (S_ISREG(fstat.st_mode))
-        {
-            /* check if it contains the keyword we are looking for */
-            if (!strstr(file, for_service))
-                continue;
-
-            {
-                /* cut the initiating "/etc/initng/" */
-                char *s = file + ((strlen(INITNG_ROOT) + 1) * sizeof(char));
-
-                /* cut the ending ".i" */
-                int i = 0;
-
-                while (s[i] && s[i] != '.')
-                    i++;
-                s[i] = '\0';
-
-                W_("Service should be \"%s\"\n", s, for_service);
-                if ((tmp = initng_common_parse_service(s)))
-                {
-                    closedir(path);
-                    return (tmp);
-                }
-            }
-        }
+	/* get the stat of that file */
+	if (stat(file, &fstat) != 0)
+	{
+	    printf("File %s failed stat errno: %s\n", file, strerror(errno));
+	    continue;
+	}
+
+	/* if it is a dir */
+	if (S_ISDIR(fstat.st_mode))
+	{
+	    /* Cal ur self function with that dir */
+	    tmp = search_dir(for_service, file);
+	    if (tmp)
+		return (tmp);
+
+	    /* continue while loop */
+	    continue;
+	}
+
+	/* if it is a file */
+	if (S_ISREG(fstat.st_mode))
+	{
+	    /* check if it contains the keyword we are looking for */
+	    if (!strstr(file, for_service))
+		continue;
+
+	    {
+		/* cut the initiating "/etc/initng/" */
+		char *s = file + ((strlen(INITNG_ROOT) + 1) * sizeof(char));
+
+		/* cut the ending ".i" */
+		int i = 0;
+
+		while (s[i] && s[i] != '.')
+		    i++;
+		s[i] = '\0';
+
+		W_("Service should be \"%s\"\n", s, for_service);
+		if ((tmp = initng_common_parse_service(s)))
+		{
+		    closedir(path);
+		    return (tmp);
+		}
+	    }
+	}
     }
     closedir(path);
     return (NULL);
@@ -132,30 +132,30 @@
 
     /* Try get by alias file */
     {
-        char *alias_name = NULL;
+	char *alias_name = NULL;
 
-        /* try get from alias file */
-        if ((alias_name = get_find_alias(service)))
-        {
-            /* also try to find a service with that name */
-            tmp = initng_common_parse_service(alias_name);
-            free(alias_name);
-
-            if (tmp)
-                return (tmp);
-        }
+	/* try get from alias file */
+	if ((alias_name = get_find_alias(service)))
+	{
+	    /* also try to find a service with that name */
+	    tmp = initng_common_parse_service(alias_name);
+	    free(alias_name);
+
+	    if (tmp)
+		return (tmp);
+	}
     }
 
     /* Never try to find a service with a '/' in the name, it already have a path */
     if (strstr(service, "/"))
     {
-        printf("This is a full path, nothing to search on.\n");
-        return (NULL);
+	printf("This is a full path, nothing to search on.\n");
+	return (NULL);
     }
 
     /* browser initng root, in searching for a file matching service name */
     if ((tmp = search_dir(service, INITNG_ROOT)))
-        return (tmp);
+	return (tmp);
 
     return (NULL);
 }
@@ -174,7 +174,7 @@
     D_("Finding alias for %s\n", from);
     /* open that file */
     if (!open_read_close(ALIAS_FILE, &file_content))
-        return (NULL);
+	return (NULL);
 
     /* get length of what we are searching */
     from_len = strlen(from);
@@ -183,43 +183,43 @@
     point = file_content;
     while (point[0])
     {
-        /* skip initial spaces */
-        JUMP_SPACES(point);
-        if (!point[0])
-            break;
-
-        /* skip rows, starting with '#' */
-        if (point[0] == '#')
-        {
-            JUMP_TO_NEXT_ROW(point);
-            continue;
-        }
-
-        /* check if first word is a match */
-        if (strncasecmp(point, from, from_len) != 0)
-        {
-            JUMP_TO_NEXT_ROW(point);
-            continue;
-        }
-
-        if (!point[from_len] || !point[from_len + 1]
-            || point[from_len] != '=')
-        {
-            JUMP_TO_NEXT_ROW(point);
-            continue;
-        }
-
-        /* Put pointer to result after the '=' */
-        point_result = point + from_len + 1;
+	/* skip initial spaces */
+	JUMP_SPACES(point);
+	if (!point[0])
+	    break;
+
+	/* skip rows, starting with '#' */
+	if (point[0] == '#')
+	{
+	    JUMP_TO_NEXT_ROW(point);
+	    continue;
+	}
+
+	/* check if first word is a match */
+	if (strncasecmp(point, from, from_len) != 0)
+	{
+	    JUMP_TO_NEXT_ROW(point);
+	    continue;
+	}
+
+	if (!point[from_len] || !point[from_len + 1]
+	    || point[from_len] != '=')
+	{
+	    JUMP_TO_NEXT_ROW(point);
+	    continue;
+	}
+
+	/* Put pointer to result after the '=' */
+	point_result = point + from_len + 1;
 
-        while (point_result[i] && point_result[i] != '\n')
-            i++;
+	while (point_result[i] && point_result[i] != '\n')
+	    i++;
 
-        /* copy the rest of line */
-        ret = i_strndup(point_result, i);
+	/* copy the rest of line */
+	ret = i_strndup(point_result, i);
 
-        free(file_content);
-        return (ret);
+	free(file_content);
+	return (ret);
     }
     free(file_content);
     return (NULL);
@@ -232,8 +232,8 @@
     D_("module_init();\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     return (initng_plugin_hook_add(&g.PARSERS, 70, &initng_find));

Modified: initng/trunk/plugins/fstat/initng_fstat.c
==============================================================================
--- initng/trunk/plugins/fstat/initng_fstat.c	(original)
+++ initng/trunk/plugins/fstat/initng_fstat.c	Wed Apr  5 22:57:12 2006
@@ -21,7 +21,7 @@
 
 
 #include <stdio.h>
-#include <stdlib.h>                         /* free() exit() */
+#include <stdlib.h>			    /* free() exit() */
 #include <string.h>
 #include <sys/stat.h>
 #include <sys/types.h>
@@ -67,27 +67,27 @@
     /* CHECK WAIT_FOR_FILE */
     while ((file = get_next_string(&WAIT_FOR_FILE, service, &itt)))
     {
-        D_("Service %s need file %s to exist\n", service->name, file);
-        if (stat(file, &file_stat) != 0)
-        {
-            D_("File %s needed by %s doesn't exist.\n", file, service->name);
-            /* set the alarm, make sure initng will search files, in one second */
-            initng_global_set_sleep(1);
-
-            /* don't change status of service to START_DEP_MET */
-            return (FALSE);
-        }
+	D_("Service %s need file %s to exist\n", service->name, file);
+	if (stat(file, &file_stat) != 0)
+	{
+	    D_("File %s needed by %s doesn't exist.\n", file, service->name);
+	    /* set the alarm, make sure initng will search files, in one second */
+	    initng_global_set_sleep(1);
+
+	    /* don't change status of service to START_DEP_MET */
+	    return (FALSE);
+	}
     }
 
     /* CHECK REQUIRE_FILE */
     while ((file = get_next_string(&REQUIRE_FILE, service, &itt)))
     {
-        D_("Service %s need file %s to exist\n", service->name, file);
-        if (stat(file, &file_stat) != 0)
-        {
-            initng_common_mark_service(service, &REQUIRE_FILE_FAILED);
-            return (FALSE);
-        }
+	D_("Service %s need file %s to exist\n", service->name, file);
+	if (stat(file, &file_stat) != 0)
+	{
+	    initng_common_mark_service(service, &REQUIRE_FILE_FAILED);
+	    return (FALSE);
+	}
     }
 
     return (TRUE);
@@ -106,27 +106,27 @@
     /* check WAIT_FOR_FILE_AFTER */
     while ((file = get_next_string(&WAIT_FOR_FILE_AFTER, service, &itt)))
     {
-        D_("Service %s need file %s before it can be set to RUNNING\n",
-           service->name, file);
-        if (stat(file, &file_stat) != 0)
-        {
-            D_("File %s needed by %s doesn't exist.\n", file, service->name);
-            /* set the alarm, make sure initng will search files, in one second */
-            initng_global_set_sleep(1);
-
-            /* don't change status of service to START_READY */
-            return (FALSE);
-        }
+	D_("Service %s need file %s before it can be set to RUNNING\n",
+	   service->name, file);
+	if (stat(file, &file_stat) != 0)
+	{
+	    D_("File %s needed by %s doesn't exist.\n", file, service->name);
+	    /* set the alarm, make sure initng will search files, in one second */
+	    initng_global_set_sleep(1);
+
+	    /* don't change status of service to START_READY */
+	    return (FALSE);
+	}
     }
 
     /* check REQUIRE_FILE_AFTER */
     while ((file = get_next_string(&WAIT_FOR_FILE_AFTER, service, &itt)))
     {
-        if (stat(file, &file_stat) != 0)
-        {
-            initng_common_mark_service(service, &REQUIRE_FILE_AFTER_FAILED);
-            return (FALSE);
-        }
+	if (stat(file, &file_stat) != 0)
+	{
+	    initng_common_mark_service(service, &REQUIRE_FILE_AFTER_FAILED);
+	    return (FALSE);
+	}
     }
 
     return (TRUE);
@@ -137,8 +137,8 @@
     S_;
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     initng_service_data_types_add(&WAIT_FOR_FILE);

Modified: initng/trunk/plugins/history/initng_history.c
==============================================================================
--- initng/trunk/plugins/history/initng_history.c	(original)
+++ initng/trunk/plugins/history/initng_history.c	Wed Apr  5 22:57:12 2006
@@ -20,11 +20,11 @@
 
 #include <initng.h>
 
-#include <sys/types.h>                      /* time_t */
+#include <sys/types.h>			    /* time_t */
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
-#include <stdio.h>                          /* printf() */
+#include <stdio.h>			    /* printf() */
 #include <assert.h>
 #include <errno.h>
 
@@ -53,39 +53,39 @@
 
     while_history_db_prev(current)
     {
-        active_row *row = payload->p + (i * sizeof(active_row));
+	active_row *row = payload->p + (i * sizeof(active_row));
 
-        /* if action is not set, it is probably a string logged in this db */
-        if (!current->action)
-            continue;
-
-        if ((arg && strlen(arg) > 1)
-            && !(((current->name) && strcmp(current->name, arg) == 0)
-                 || ((current->service && current->service->name)
-                     && strcmp(current->service->name, arg) == 0)))
-            continue;
-
-        if (current->data)
-            printf("%s\n", current->data);
-
-        if (current->action)
-            strncpy(row->state, current->action->state_name, 100);
-        else
-            row->state[0] = '\0';
-
-        memcpy(&row->time_set, &current->time, sizeof(struct timeval));
-        if (current->name)
-            strncpy(row->name, current->name, 100);
-        else if (current->service && current->service->name)
-            strncpy(row->name, current->service->name, 100);
-        else
-            row->name[0] = '\0';
+	/* if action is not set, it is probably a string logged in this db */
+	if (!current->action)
+	    continue;
+
+	if ((arg && strlen(arg) > 1)
+	    && !(((current->name) && strcmp(current->name, arg) == 0)
+		 || ((current->service && current->service->name)
+		     && strcmp(current->service->name, arg) == 0)))
+	    continue;
+
+	if (current->data)
+	    printf("%s\n", current->data);
+
+	if (current->action)
+	    strncpy(row->state, current->action->state_name, 100);
+	else
+	    row->state[0] = '\0';
+
+	memcpy(&row->time_set, &current->time, sizeof(struct timeval));
+	if (current->name)
+	    strncpy(row->name, current->name, 100);
+	else if (current->service && current->service->name)
+	    strncpy(row->name, current->service->name, 100);
+	else
+	    row->name[0] = '\0';
 
-        /* set the rought state */
-        row->is = current->action->is;
+	/* set the rought state */
+	row->is = current->action->is;
 
-        /* increase the number of entrys to send */
-        i++;
+	/* increase the number of entrys to send */
+	i++;
     }
 
     payload->s = i * sizeof(active_row);
@@ -110,64 +110,64 @@
     /* reset arg, if strlen is short */
     if (arg)
     {
-        if (strlen(arg) < 1)
-            arg = NULL;
-        else if (strcmp(arg, "output") == 0)
-            only_output = TRUE;
+	if (strlen(arg) < 1)
+	    arg = NULL;
+	else if (strcmp(arg, "output") == 0)
+	    only_output = TRUE;
     }
 
     mprintf(&string, " hh:mm:ss    service           :  STATUS\n");
     mprintf(&string,
-            " ------------------------------------------------------\n");
+	    " ------------------------------------------------------\n");
     while_history_db_prev(current)
     {
-        /* if only_output is set, it have to be an output to continue */
-        if (only_output && !current->data)
-            continue;
-
-        /* if there is an argument, it have to match the service */
-        if (arg
-            && !(((current->name) && strcmp(current->name, arg) == 0)
-                 || ((current->service && current->service->name)
-                     && strcmp(current->service->name, arg) == 0)))
-            continue;
-
-        /* try to set the service name, from any source found */
-        if (current->name)
-            name = current->name;
-        else if (current->service && current->service->name)
-            name = current->service->name;
-        else
-            name = NULL;
-
-        /* create an localtime struct form service->time */
-        ts = localtime(&current->time.tv_sec);
-
-        /* if the log entry contains output data ... */
-        if (current->data)
-        {
-            if (latest == name)
-                mprintf(&string, "%s", current->data);
-            else
-                mprintf(&string, " %.2i:%.2i:%.2i %20s : *OUTPUT*\n%s",
-                        ts->tm_hour, ts->tm_min, ts->tm_sec, name,
-                        current->data);
-            latest = name;
-        }
-        else
-        {
-            if (current->action->is == IS_UP || current->action->is == IS_DOWN
-                || current->action->is == IS_FAILED)
-            {
-                /* reset so that *OUTPUT* will be shown again */
-                latest = NULL;
-
-                /* print a nice service change status entry */
-                mprintf(&string, " %.2i:%.2i:%.2i %20s : %s\n", ts->tm_hour,
-                        ts->tm_min, ts->tm_sec, name,
-                        current->action->state_name);
-            }
-        }
+	/* if only_output is set, it have to be an output to continue */
+	if (only_output && !current->data)
+	    continue;
+
+	/* if there is an argument, it have to match the service */
+	if (arg
+	    && !(((current->name) && strcmp(current->name, arg) == 0)
+		 || ((current->service && current->service->name)
+		     && strcmp(current->service->name, arg) == 0)))
+	    continue;
+
+	/* try to set the service name, from any source found */
+	if (current->name)
+	    name = current->name;
+	else if (current->service && current->service->name)
+	    name = current->service->name;
+	else
+	    name = NULL;
+
+	/* create an localtime struct form service->time */
+	ts = localtime(&current->time.tv_sec);
+
+	/* if the log entry contains output data ... */
+	if (current->data)
+	{
+	    if (latest == name)
+		mprintf(&string, "%s", current->data);
+	    else
+		mprintf(&string, " %.2i:%.2i:%.2i %20s : *OUTPUT*\n%s",
+			ts->tm_hour, ts->tm_min, ts->tm_sec, name,
+			current->data);
+	    latest = name;
+	}
+	else
+	{
+	    if (current->action->is == IS_UP || current->action->is == IS_DOWN
+		|| current->action->is == IS_FAILED)
+	    {
+		/* reset so that *OUTPUT* will be shown again */
+		latest = NULL;
+
+		/* print a nice service change status entry */
+		mprintf(&string, " %.2i:%.2i:%.2i %20s : %s\n", ts->tm_hour,
+			ts->tm_min, ts->tm_sec, name,
+			current->action->state_name);
+	    }
+	}
 
     }
     return (string);
@@ -189,7 +189,7 @@
 
     while_history_db(current)
     {
-        current->time.tv_sec += skew;
+	current->time.tv_sec += skew;
     }
 }
 
@@ -203,11 +203,11 @@
 
     while_history_db(current)
     {
-        if (current->service == service)
-        {
-            current->service = NULL;
-            current->name = i_strdup(service->name);
-        }
+	if (current->service == service)
+	{
+	    current->service = NULL;
+	    current->name = i_strdup(service->name);
+	}
     }
 }
 
@@ -219,19 +219,19 @@
     /* while there is a history db */
     while_history_db_safe(current, safe)
     {
-        /* free history name */
-        if (current->name)
-            free(current->name);
-
-        /* free data if any */
-        if (current->data)
-            free(current->data);
+	/* free history name */
+	if (current->name)
+	    free(current->name);
+
+	/* free data if any */
+	if (current->data)
+	    free(current->data);
 
-        /* remove from history_db list */
-        list_del(&current->list);
+	/* remove from history_db list */
+	list_del(&current->list);
 
-        /* free history entry */
-        free(current);
+	/* free history entry */
+	free(current);
     }
 }
 
@@ -247,32 +247,32 @@
     if (history_records > HISTORY)
     {
 
-        struct list_head *last = history_db.list.prev;
-        history_h *entry = list_entry(last, history_h, list);
+	struct list_head *last = history_db.list.prev;
+	history_h *entry = list_entry(last, history_h, list);
 
-        /* if we got anything */
-        if (!entry)
-        {
-            F_("Unable to free last histroty entry!, cant add more.\n");
-            return (FALSE);
-        }
-
-        /* free the name */
-        if (entry->name)
-            free(entry->name);
-
-        /* free any data that might be in this history entry */
-        if (entry->data)
-            free(entry->data);
+	/* if we got anything */
+	if (!entry)
+	{
+	    F_("Unable to free last histroty entry!, cant add more.\n");
+	    return (FALSE);
+	}
+
+	/* free the name */
+	if (entry->name)
+	    free(entry->name);
+
+	/* free any data that might be in this history entry */
+	if (entry->data)
+	    free(entry->data);
 
-        /* delete this from the historylist */
-        list_del(last);
+	/* delete this from the historylist */
+	list_del(last);
 
-        /* free the struct */
-        free(entry);
+	/* free the struct */
+	free(entry);
 
-        /* count down the number of records */
-        history_records--;
+	/* count down the number of records */
+	history_records--;
     }
 
     /* leave */
@@ -282,13 +282,13 @@
 /* add values to history database */
 static int history_add_values(active_db_h * service)
 {
-    history_h *tmp_e = NULL;    /* temporary pointer to insert data and add to db */
+    history_h *tmp_e = NULL;	/* temporary pointer to insert data and add to db */
 
     assert(service->name);
 
     /* Don't bother adding */
     if (!service->current_state)
-        return (TRUE);
+	return (TRUE);
 
     /*if (!service->current_state->state_name);
        return(TRUE); */
@@ -298,15 +298,15 @@
     /* allocate space for data */
     if (!(tmp_e = (history_h *) i_calloc(1, sizeof(history_h))))
     {
-        F_("Out of memory.\n");
-        return (TRUE);
+	F_("Out of memory.\n");
+	return (TRUE);
     }
 
     /* set data in struct */
     tmp_e->service = service;
     tmp_e->name = NULL;
     memcpy(&tmp_e->time, &service->time_current_state,
-           sizeof(struct timeval));
+	   sizeof(struct timeval));
     tmp_e->action = service->current_state;
 
     /*D_("history_add_values() service : %s, name: %s, action: %s\n", service->name, NULL, service->current_state->state_name); */
@@ -316,7 +316,7 @@
     /* if service is status freeing, clear the pointers in history db */
     if (IS_MARK(service, &FREEING))
     {
-        history_db_clear_service(service);
+	history_db_clear_service(service);
     }
 
     /* leave */
@@ -324,15 +324,15 @@
 }
 
 static int fetch_output(active_db_h * service, process_h * process,
-                        char *buffer_pos)
+			char *buffer_pos)
 {
     history_h *tmp_e = NULL;
 
     /* allocate space for data */
     if (!(tmp_e = (history_h *) i_calloc(1, sizeof(history_h))))
     {
-        F_("Out of memory.\n");
-        return (FALSE);
+	F_("Out of memory.\n");
+	return (FALSE);
     }
 
     /* set data in struct */
@@ -354,8 +354,8 @@
 {
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     INIT_LIST_HEAD(&history_db.list);
@@ -364,7 +364,7 @@
     initng_command_add(&LOG);
     initng_plugin_hook_add(&g.ASTATUS_CHANGE, 1000, &history_add_values);
     initng_plugin_hook_add(&g.COMPENSATE_TIME, 50,
-                           &history_db_compensate_time);
+			   &history_db_compensate_time);
     initng_plugin_hook_add(&g.PIPEWATCHERS, 50, &fetch_output);
 
     return (TRUE);

Modified: initng/trunk/plugins/idleprobe/initng_idleprobe.c
==============================================================================
--- initng/trunk/plugins/idleprobe/initng_idleprobe.c	(original)
+++ initng/trunk/plugins/idleprobe/initng_idleprobe.c	Wed Apr  5 22:57:12 2006
@@ -22,7 +22,7 @@
 
 
 #include <stdio.h>
-#include <stdlib.h>                         /* free() exit() */
+#include <stdlib.h>			    /* free() exit() */
 #include <string.h>
 #include <sys/stat.h>
 #include <sys/types.h>
@@ -92,16 +92,16 @@
     /* check so that wait value is correct */
     if (wait < 0)
     {
-        F_("Wrong value for parameter wait_for_cpu_idle (%i)!\n", wait);
-        return (FALSE);
+	F_("Wrong value for parameter wait_for_cpu_idle (%i)!\n", wait);
+	return (FALSE);
     }
 
     /* Make sure this is maximum run once every second, and mainloop */
     if (g.now.tv_sec == last)
     {
-        /* make sure rerun interrupt again in 1 second */
-        initng_global_set_sleep(1);
-        return (FALSE);
+	/* make sure rerun interrupt again in 1 second */
+	initng_global_set_sleep(1);
+	return (FALSE);
     }
 
     /* update last run counter */
@@ -110,12 +110,12 @@
     /* if fp_proc not open, try to open it */
     if (!fp_proc)
     {
-        fp_proc = fopen("/proc/stat", "r");
+	fp_proc = fopen("/proc/stat", "r");
     }
 
     /* if still not open, return false */
     if (!fp_proc)
-        return (FALSE);
+	return (FALSE);
 
 
     rewind(fp_proc);
@@ -124,19 +124,19 @@
     // first value the CPU summary line
     if (!fgets(buf, sizeof(buf), fp_proc))
     {
-        F_("Failed to read from /proc/stat!\n");
-        return (FALSE);
+	F_("Failed to read from /proc/stat!\n");
+	return (FALSE);
     }
 
     /* okay, lets start parse /proc/stat */
     if (sscanf(buf, "cpu %Lu %Lu %Lu %Lu %Lu %Lu %Lu",
-               &cpu_user,
-               &cpu_nice,
-               &cpu_system,
-               &cpu_idle, &cpu_dummy1, &cpu_dummy2, &cpu_dummy3) < 4)
+	       &cpu_user,
+	       &cpu_nice,
+	       &cpu_system,
+	       &cpu_idle, &cpu_dummy1, &cpu_dummy2, &cpu_dummy3) < 4)
     {
-        F_("Failed to read from /proc/stat!\n");
-        return (FALSE);
+	F_("Failed to read from /proc/stat!\n");
+	return (FALSE);
     }
 
     D_("cpu_user: %i\n", (int) cpu_user);
@@ -153,21 +153,21 @@
     cpu_dummy3_frm = cpu_dummy3 - old_cpu_dummy3;
     cpu_tot_frm = cpu_user_frm + cpu_nice_frm + cpu_system_frm + cpu_idle_frm + cpu_dummy1_frm + cpu_dummy2_frm + cpu_dummy3_frm;
     if (cpu_tot_frm < 1)
-        cpu_tot_frm = 1;
+	cpu_tot_frm = 1;
     scale = 100.0 / (float) cpu_tot_frm;
 
     if (old_cpu_user)
     {
-        if ((float) cpu_idle_frm * scale > 90.0)
-        {
-            D_("idle_cnt: %i\n", idle_cnt);
-            if (++idle_cnt > wait)
-                return (TRUE);
-        }
-        else
-        {
-            idle_cnt = 0;
-        }
+	if ((float) cpu_idle_frm * scale > 90.0)
+	{
+	    D_("idle_cnt: %i\n", idle_cnt);
+	    if (++idle_cnt > wait)
+		return (TRUE);
+	}
+	else
+	{
+	    idle_cnt = 0;
+	}
     }
 
     old_cpu_user = cpu_user;
@@ -193,11 +193,11 @@
 
     if ((value = get_int(&WAIT_FOR_CPU_COUNT, service)) > 0)
     {
-        return (is_cpu_idle(value));
+	return (is_cpu_idle(value));
     }
 
     if (is(&WAIT_FOR_CPU_IDLE, service))
-        return (is_cpu_idle(DEFAULT_IDLE));
+	return (is_cpu_idle(DEFAULT_IDLE));
 
 
     return (TRUE);
@@ -208,8 +208,8 @@
     S_;
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     initng_service_data_types_add(&WAIT_FOR_CPU_IDLE);
@@ -226,5 +226,5 @@
     initng_plugin_hook_del(&g.START_DEP_MET, &check_cpu_idle);
 
     if (fp_proc)
-        fclose(fp_proc);
+	fclose(fp_proc);
 }

Modified: initng/trunk/plugins/initctl/initng_initctl.c
==============================================================================
--- initng/trunk/plugins/initctl/initng_initctl.c	(original)
+++ initng/trunk/plugins/initctl/initng_initctl.c	Wed Apr  5 22:57:12 2006
@@ -61,18 +61,18 @@
 static void initng_reload(void);
 
 
-f_module_h pipe_fd = { &parse_control_input, FDW_READ, -1 };    /* /dev/initctl */
+f_module_h pipe_fd = { &parse_control_input, FDW_READ, -1 };	/* /dev/initctl */
 
 struct stat st, st2;
 
-#define PIPE_FD    10                       /* Fileno of initfifo. */
+#define PIPE_FD    10			    /* Fileno of initfifo. */
 
 static void initctl_control_close(void)
 {
     if (pipe_fd.fds > 2)
     {
-        close(pipe_fd.fds);
-        pipe_fd.fds = -1;
+	close(pipe_fd.fds);
+	pipe_fd.fds = -1;
     }
 }
 
@@ -81,7 +81,7 @@
     D_("initctl control open (%d)\n", pipe_fd.fds);
     /* First, try to create /dev/initctl if not present. */
     if (stat(INIT_FIFO, &st2) < 0 && errno == ENOENT)
-        (void) mkfifo(INIT_FIFO, 0600);
+	(void) mkfifo(INIT_FIFO, 0600);
 
     /*
      *  If /dev/initctl is open, stat the file to see if it
@@ -89,38 +89,38 @@
      */
     if (pipe_fd.fds > 2)
     {
-        if (fstat(pipe_fd.fds, &st) < 0)
-            initctl_control_close();
-        if (stat(INIT_FIFO, &st2) < 0 || st.st_dev != st2.st_dev
-            || st.st_ino != st2.st_ino)
-        {
-            initctl_control_close();
-        }
+	if (fstat(pipe_fd.fds, &st) < 0)
+	    initctl_control_close();
+	if (stat(INIT_FIFO, &st2) < 0 || st.st_dev != st2.st_dev
+	    || st.st_ino != st2.st_ino)
+	{
+	    initctl_control_close();
+	}
     }
 
     /* If the pipe isn't open, try to open it. */
     if (pipe_fd.fds < 3)
     {
-        /* it the file descriptor has to be over 2 to be valid */
-        if ((pipe_fd.fds = open(INIT_FIFO, O_RDWR | O_NONBLOCK)) < 3)
-            return (FALSE);
-
-        D_("Opened on fd %i\n", pipe_fd.fds);
-        fstat(pipe_fd.fds, &st);
-        if (!S_ISFIFO(st.st_mode))
-        {
-            /* /dev/initctl is there, but we can't open it */
-            F_("%s is not a fifo\n", INIT_FIFO);
-            if (pipe_fd.fds >= 0)
-            {
-                close(pipe_fd.fds);
-                pipe_fd.fds = -1;
-            }
-            return (FALSE);
-        }
+	/* it the file descriptor has to be over 2 to be valid */
+	if ((pipe_fd.fds = open(INIT_FIFO, O_RDWR | O_NONBLOCK)) < 3)
+	    return (FALSE);
+
+	D_("Opened on fd %i\n", pipe_fd.fds);
+	fstat(pipe_fd.fds, &st);
+	if (!S_ISFIFO(st.st_mode))
+	{
+	    /* /dev/initctl is there, but we can't open it */
+	    F_("%s is not a fifo\n", INIT_FIFO);
+	    if (pipe_fd.fds >= 0)
+	    {
+		close(pipe_fd.fds);
+		pipe_fd.fds = -1;
+	    }
+	    return (FALSE);
+	}
 
-        /* ok, finally add hook */
-        initng_plugin_hook_add(&g.FDWATCHERS, 70, &pipe_fd);
+	/* ok, finally add hook */
+	initng_plugin_hook_add(&g.FDWATCHERS, 70, &pipe_fd);
     }
     return (TRUE);
 }
@@ -132,7 +132,7 @@
     struct init_request request;
 
     if (from_module != &pipe_fd)
-        return;
+	return;
 
     /* Read data from /dev/initctl */
     n = read(pipe_fd.fds, &request, sizeof(request));
@@ -140,20 +140,20 @@
     /* Check if request is ok : */
     if (n == 0)
     {
-        F_("read 0 bytes, this should never happen!\n");
-        return;
+	F_("read 0 bytes, this should never happen!\n");
+	return;
     }
     if (n <= 0)
     {
-        if (errno == EINTR)
-            return;
-        F_("Error reading request\n");
-        return;
+	if (errno == EINTR)
+	    return;
+	F_("Error reading request\n");
+	return;
     }
     if (request.magic != INIT_MAGIC || n != sizeof(request))
     {
-        F_("got bogus init request\n");
-        return;
+	F_("got bogus init request\n");
+	return;
     }
 
     /*
@@ -161,9 +161,9 @@
      */
     if (request.cmd != INIT_CMD_RUNLVL)
     {
-        D_("got unimplemented init request - %d (%c),%d (%c).\n",
-           request.runlevel, request.runlevel, request.cmd, request.cmd);
-        return;
+	D_("got unimplemented init request - %d (%c),%d (%c).\n",
+	   request.runlevel, request.runlevel, request.cmd, request.cmd);
+	return;
     }
 
     /* TODO, handle these:
@@ -180,54 +180,54 @@
 
     switch (request.runlevel)
     {
-            /* halting */
-        case '0':
-            D_("Halting.\n");
-            g.when_out = THEN_POWEROFF;
-            initng_handler_stop_all();
-            return;
-
-            /* reboot */
-        case '6':
-            D_("Rebooting.\n");
-            g.when_out = THEN_REBOOT;
-            initng_handler_stop_all();
-            return;
-
-            /* restart init */
-        case 'U':
-        case 'u':
-            D_("init U, sent reloading initng\n");
-            initng_reload();
-            return;
-
-            /* reload /etc/inittab */
-        case 'Q':
-        case 'q':
-            D_("init Q, freeing complete service cache\n");
-            initng_service_cache_free_all();
-            return;
-
-            /* go singleuser */
-        case 'S':
-        case 's':
-            W_("init S, going singleuser\n");
-            g.when_out = THEN_RESTART;
-
-            /* set next runlevel to single (That will be loaded when no service is left in current one) */
-            initng_main_set_runlevel("single");
-            initng_handler_stop_all();
-            return;
-        default:
-            D_("Starting runlevel%c\n", request.runlevel);
-            {
-                char tmp[20];
-
-                sprintf(tmp, "runlevel%c", request.runlevel);
-                if (!initng_handler_start_new_service_named(tmp))
-                    F_(" service \"%s\" could not be executed.\n", tmp);
-            }
-            return;
+	    /* halting */
+	case '0':
+	    D_("Halting.\n");
+	    g.when_out = THEN_POWEROFF;
+	    initng_handler_stop_all();
+	    return;
+
+	    /* reboot */
+	case '6':
+	    D_("Rebooting.\n");
+	    g.when_out = THEN_REBOOT;
+	    initng_handler_stop_all();
+	    return;
+
+	    /* restart init */
+	case 'U':
+	case 'u':
+	    D_("init U, sent reloading initng\n");
+	    initng_reload();
+	    return;
+
+	    /* reload /etc/inittab */
+	case 'Q':
+	case 'q':
+	    D_("init Q, freeing complete service cache\n");
+	    initng_service_cache_free_all();
+	    return;
+
+	    /* go singleuser */
+	case 'S':
+	case 's':
+	    W_("init S, going singleuser\n");
+	    g.when_out = THEN_RESTART;
+
+	    /* set next runlevel to single (That will be loaded when no service is left in current one) */
+	    initng_main_set_runlevel("single");
+	    initng_handler_stop_all();
+	    return;
+	default:
+	    D_("Starting runlevel%c\n", request.runlevel);
+	    {
+		char tmp[20];
+
+		sprintf(tmp, "runlevel%c", request.runlevel);
+		if (!initng_handler_start_new_service_named(tmp))
+		    F_(" service \"%s\" could not be executed.\n", tmp);
+	    }
+	    return;
     }
 }
 
@@ -242,8 +242,8 @@
      */
     if (access(UTMP_FILE, F_OK) < 0)
     {
-        F_("/var/run/utmp does not exist, this should be created by bootmisc.i\n");
-        return;
+	F_("/var/run/utmp does not exist, this should be created by bootmisc.i\n");
+	return;
     }
     /*
        TODO, is this a good idea or a bad idea?
@@ -258,9 +258,9 @@
     utmp.ut_time = (int) t;
     if (pututline(&utmp) == NULL)
     {
-        F_("pututline failed\n");
-        endutent();
-        return;
+	F_("pututline failed\n");
+	endutent();
+	return;
     }
     endutent();
     return;
@@ -272,7 +272,7 @@
 
     if (reload && reload->u.void_command_call)
     {
-        (*reload->u.void_command_call) (NULL);
+	(*reload->u.void_command_call) (NULL);
     }
 }
 
@@ -283,11 +283,11 @@
 {
     /* Look for the right signal */
     if (signal != SIGHUP)
-        return;
+	return;
 
     if (!initctl_control_open())
     {
-        F_("Warning, failed to open /dev/initctl\n");
+	F_("Warning, failed to open /dev/initctl\n");
     }
 }
 
@@ -295,7 +295,7 @@
 {
     if (state == STATE_UP && (!utmp_stored))
     {
-        makeutmp(3);
+	makeutmp(3);
     }
 }
 
@@ -305,14 +305,14 @@
     D_("module_init();\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     if (!g.i_am_init)
     {
-        initng_unload_module_named("initctl");
-        return (TRUE);                      /* this is not a failure */
+	initng_unload_module_named("initctl");
+	return (TRUE);			    /* this is not a failure */
     }
 
     utmp_stored = FALSE;
@@ -320,10 +320,10 @@
     initctl_control_open();
 
     if ((!initng_plugin_hook_add(&g.SIGNAL, 50, &hup_request))
-        || (!initng_plugin_hook_add(&g.SWATCHERS, 50, &is_system_up)))
+	|| (!initng_plugin_hook_add(&g.SWATCHERS, 50, &is_system_up)))
     {
-        F_("Fail add hook!\n");
-        return (FALSE);
+	F_("Fail add hook!\n");
+	return (FALSE);
     }
     return (TRUE);
 }
@@ -335,7 +335,7 @@
 
     /* then this module was never loaded */
     if (!g.i_am_init)
-        return;                             /* this is not a failure */
+	return;				    /* this is not a failure */
 
 
     initctl_control_close();

Modified: initng/trunk/plugins/initctl/initreq.h
==============================================================================
--- initng/trunk/plugins/initctl/initreq.h	(original)
+++ initng/trunk/plugins/initctl/initreq.h	Wed Apr  5 22:57:12 2006
@@ -46,14 +46,14 @@
  */
 struct init_request_bsd
 {
-    char gen_id[8];             /* Beats me.. telnetd uses "fe" */
-    char tty_id[16];            /* Tty name minus /dev/tty      */
-    char host[INITRQ_HLEN];     /* Hostname                     */
-    char term_type[16];         /* Terminal type                */
-    int signal;                 /* Signal to send               */
-    int pid;                    /* Process to send to           */
-    char exec_name[128];        /* Program to execute           */
-    char reserved[128];         /* For future expansion.        */
+    char gen_id[8];		/* Beats me.. telnetd uses "fe" */
+    char tty_id[16];		/* Tty name minus /dev/tty      */
+    char host[INITRQ_HLEN];	/* Hostname                     */
+    char term_type[16];		/* Terminal type                */
+    int signal;			/* Signal to send               */
+    int pid;			/* Process to send to           */
+    char exec_name[128];	/* Program to execute           */
+    char reserved[128];		/* For future expansion.        */
 };
 
 
@@ -66,14 +66,14 @@
  */
 struct init_request
 {
-    int magic;                  /* Magic number                 */
-    int cmd;                    /* What kind of request         */
-    int runlevel;               /* Runlevel to change to        */
-    int sleeptime;              /* Time between TERM and KILL   */
+    int magic;			/* Magic number                 */
+    int cmd;			/* What kind of request         */
+    int runlevel;		/* Runlevel to change to        */
+    int sleeptime;		/* Time between TERM and KILL   */
     union
     {
-        struct init_request_bsd bsd;
-        char data[368];
+	struct init_request_bsd bsd;
+	char data[368];
     } i;
 };
 

Modified: initng/trunk/plugins/interactive/initng_interactive.c
==============================================================================
--- initng/trunk/plugins/interactive/initng_interactive.c	(original)
+++ initng/trunk/plugins/interactive/initng_interactive.c	Wed Apr  5 22:57:12 2006
@@ -21,8 +21,8 @@
 
 
 #include <stdio.h>
-#include <string.h>                         /* strstr() */
-#include <stdlib.h>                         /* free() exit() */
+#include <string.h>			    /* strstr() */
+#include <stdlib.h>			    /* free() exit() */
 #include <initng_handler.h>
 #include <initng_global.h>
 #include <initng_plugin_hook.h>
@@ -46,18 +46,18 @@
     fprintf(stderr, "Start service %s, (Y/n/a):", service->name);
     /* HACK: ignore read errors by assuming 'n' */
     if (fgets(asw, 9, stdin) == NULL)
-        asw[0] = 'n';
+	asw[0] = 'n';
 
     /* if it is true, then its ok to launch service */
     if (asw[0] == 'y' || asw[0] == 'Y')
-        return (TRUE);
+	return (TRUE);
 
     if (asw[0] == 'a' || asw[0] == 'A')
     {
-        initng_plugin_hook_del(&g.START_DEP_MET, &interactive_STARTING);
-        initng_plugin_hook_del(&g.STOP_DEP_MET, &interactive_STOP_MARKED);
-        active = FALSE;
-        return (TRUE);
+	initng_plugin_hook_del(&g.START_DEP_MET, &interactive_STARTING);
+	initng_plugin_hook_del(&g.STOP_DEP_MET, &interactive_STOP_MARKED);
+	active = FALSE;
+	return (TRUE);
     }
 
     initng_common_mark_service(service, &INT_DISABLED);
@@ -73,17 +73,17 @@
     fprintf(stderr, "Stop service %s, (Y/n/a):", service->name);
     /* HACK: ignore read errors by assuming 'n' */
     if (fgets(asw, 9, stdin) == NULL)
-        asw[0] = 'n';
+	asw[0] = 'n';
 
     if (asw[0] == 'y' || asw[0] == 'Y')
-        return (TRUE);
+	return (TRUE);
 
     if (asw[0] == 'a' || asw[0] == 'A')
     {
-        initng_plugin_hook_del(&g.START_DEP_MET, &interactive_STARTING);
-        initng_plugin_hook_del(&g.STOP_DEP_MET, &interactive_STOP_MARKED);
-        active = FALSE;
-        return (TRUE);
+	initng_plugin_hook_del(&g.START_DEP_MET, &interactive_STARTING);
+	initng_plugin_hook_del(&g.STOP_DEP_MET, &interactive_STOP_MARKED);
+	active = FALSE;
+	return (TRUE);
     }
 
     initng_common_mark_service(service, &INT_DISABLED);
@@ -96,25 +96,25 @@
 
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     D_("module_init();\n");
 
     /* look for the string interactive */
     for (i = 0; g.Argv[i]; i++)
-        if (strstr(g.Argv[i], "interactive"))
-        {                                   /* if found */
+	if (strstr(g.Argv[i], "interactive"))
+	{				    /* if found */
 
-            P_("Initng is started in interactive mode!\n");
-            initng_plugin_hook_add(&g.START_DEP_MET, 90,
-                                   &interactive_STARTING);
-            initng_plugin_hook_add(&g.STOP_DEP_MET, 90,
-                                   &interactive_STOP_MARKED);
-            active = TRUE;
-            return (TRUE);
-        }
+	    P_("Initng is started in interactive mode!\n");
+	    initng_plugin_hook_add(&g.START_DEP_MET, 90,
+				   &interactive_STARTING);
+	    initng_plugin_hook_add(&g.STOP_DEP_MET, 90,
+				   &interactive_STOP_MARKED);
+	    active = TRUE;
+	    return (TRUE);
+	}
 
     active = FALSE;
     initng_unload_module_named("interactive");
@@ -126,7 +126,7 @@
     D_("module_unload();\n");
     if (active == TRUE)
     {
-        initng_plugin_hook_del(&g.START_DEP_MET, &interactive_STARTING);
-        initng_plugin_hook_del(&g.STOP_DEP_MET, &interactive_STOP_MARKED);
+	initng_plugin_hook_del(&g.START_DEP_MET, &interactive_STARTING);
+	initng_plugin_hook_del(&g.STOP_DEP_MET, &interactive_STOP_MARKED);
     }
 }

Modified: initng/trunk/plugins/iparser/initng_i_parser.c
==============================================================================
--- initng/trunk/plugins/iparser/initng_i_parser.c	(original)
+++ initng/trunk/plugins/iparser/initng_i_parser.c	Wed Apr  5 22:57:12 2006
@@ -28,7 +28,7 @@
 #include <stdlib.h>
 #include <assert.h>
 #include <sys/types.h>
-#include <dirent.h>   /*#include <dirent.h> */  /* opendir() closedir() */
+#include <dirent.h>   /*#include <dirent.h> */	/* opendir() closedir() */
 #include <fnmatch.h>
 
 #include <initng_global.h>
@@ -43,7 +43,7 @@
 
 #define ENDED(x) (!(x)[0] || (x)[0]=='\n')
 char *g_filename = NULL;
-char *g_pointer = NULL;         /* a pointer to the first char we can back step to when printing line copies */
+char *g_pointer = NULL;		/* a pointer to the first char we can back step to when printing line copies */
 
 
 /* set this to have a really verbose walking output */
@@ -53,23 +53,23 @@
 #define FL_(a,m) err_print_line2t(a, m, MSG_FAIL, __FILE__, (const char*)__PRETTY_FUNCTION__, __LINE__)
 
 static void err_print_line2t(char *point, const char *message, e_mt err,
-                             const char *file, const char *func,
-                             int codeline);
+			     const char *file, const char *func,
+			     int codeline);
 static service_cache_h *parse_file(char *filename, const char *watch_for);
 static int parse_service_line(char **to_parse, const char *watch_for,
-                              service_cache_h * father, stype_h * type,
-                              char *filename, service_cache_h ** match,
-                              service_cache_h ** exact_match);
+			      service_cache_h * father, stype_h * type,
+			      char *filename, service_cache_h ** match,
+			      service_cache_h ** exact_match);
 static int parse_opt(char **where, stype_h * type, service_cache_h * srv);
 
 static int set_parser(s_entry * type, char **value, char *va,
-                      service_cache_h * from_service);
+		      service_cache_h * from_service);
 static int string_parser(s_entry * type, char **value, char *va,
-                         service_cache_h * from_service);
+			 service_cache_h * from_service);
 static int strings_parser(s_entry * type, char **value, char *va,
-                          service_cache_h * from_service);
+			  service_cache_h * from_service);
 static int iint_parser(s_entry * type, char **value, char *va,
-                       service_cache_h * from_service);
+		       service_cache_h * from_service);
 
 static char *dup_string_and_walk(char **value, int break_on_space);
 
@@ -80,14 +80,14 @@
     int i;
 
     for (i = 0; string[i] != 0; i++)
-        if (string[i] <= 32)
-            return (FALSE);
+	if (string[i] <= 32)
+	    return (FALSE);
 
     return (TRUE);
 }
 
 static void err_print_line2t(char *point, const char *message, e_mt err,
-                             const char *file, const char *func, int codeline)
+			     const char *file, const char *func, int codeline)
 {
     char *line;
     char *pstr;
@@ -98,14 +98,14 @@
 
     /* make sure global filename is set */
     if (!g_pointer || !g_filename)
-        return;
+	return;
 
     /*while(start != g_pointer && start[-1] != g_pointer && start[-1] != '\n') */
     while (start != g_pointer && (start - 1)[0] != '\n')
-        start--;
+	start--;
 
     while (start[len] && start[len] != '\n')
-        len++;
+	len++;
 
     pi = point - start;
 
@@ -113,15 +113,15 @@
     line = i_strndup(start, len);
     pstr = i_calloc(pi + 4, sizeof(char));
     if (!line || !pstr)
-        return;
+	return;
 
     /* put spaces */
     memset(pstr, ' ', sizeof(char) * (pi));
 
     /* Tabs destroy our position pointers, replaces with spaces */
     for (i = 0; line[i]; i++)
-        if (line[i] == '\t')
-            line[i] = ' ';
+	if (line[i] == '\t')
+	    line[i] = ' ';
 
 
     /* then, put the marker. */
@@ -130,8 +130,8 @@
 
 
     initng_error_print(err, file, func, codeline,
-                       "%s\nfile: %s\n\"%s\"\n %s\n\n", message,
-                       g_filename, line, pstr);
+		       "%s\nfile: %s\n\"%s\"\n %s\n\n", message,
+		       g_filename, line, pstr);
     free(line);
     free(pstr);
     sleep(0.2);
@@ -152,8 +152,8 @@
     /* Make sure the filename of 200 chars above are more than enough */
     if (strlen(service_to_find) > 50)
     {
-        F_("Service name to long, initng_i_parser can't look for this service!\n");
-        return (NULL);
+	F_("Service name to long, initng_i_parser can't look for this service!\n");
+	return (NULL);
     }
 
     /*
@@ -187,8 +187,8 @@
     strcat(filetoparse, INITNG_EXT);
     if ((got_serv = parse_file(filetoparse, service_to_find)))
     {
-        free(path);
-        return (got_serv);
+	free(path);
+	return (got_serv);
     }
     filetoparse[0] = '\0';
 
@@ -198,8 +198,8 @@
     strcat(filetoparse, INITNG_EXT);
     if ((got_serv = parse_file(filetoparse, service_to_find)))
     {
-        free(path);
-        return (got_serv);
+	free(path);
+	return (got_serv);
     }
     filetoparse[0] = '\0';
 
@@ -209,8 +209,8 @@
     strcat(filetoparse, "/default" INITNG_EXT);
     if ((got_serv = parse_file(filetoparse, service_to_find)))
     {
-        free(path);
-        return (got_serv);
+	free(path);
+	return (got_serv);
     }
     filetoparse[0] = '\0';
 
@@ -221,8 +221,8 @@
 
     if ((got_serv = parse_file(filetoparse, service_to_find)))
     {
-        free(path);
-        return (got_serv);
+	free(path);
+	return (got_serv);
     }
     filetoparse[0] = '\0';
 
@@ -233,8 +233,8 @@
     strcat(filetoparse, INITNG_EXT);
     if ((got_serv = parse_file(filetoparse, service_to_find)))
     {
-        free(path);
-        return (got_serv);
+	free(path);
+	return (got_serv);
     }
     filetoparse[0] = '\0';
 
@@ -244,8 +244,8 @@
     strcat(filetoparse, INITNG_EXT);
     if ((got_serv = parse_file(filetoparse, service_to_find)))
     {
-        free(path);
-        return (got_serv);
+	free(path);
+	return (got_serv);
     }
     filetoparse[0] = '\0';
 
@@ -255,8 +255,8 @@
     strcat(filetoparse, INITNG_EXT);
     if ((got_serv = parse_file(filetoparse, service_to_find)))
     {
-        free(path);
-        return (got_serv);
+	free(path);
+	return (got_serv);
     }
     filetoparse[0] = '\0';
 
@@ -289,8 +289,8 @@
     /* read config file */
     if (!open_read_close(filename, &file_content))
     {
-        D_("Can't open config file %s.\n", filename);
-        return (NULL);
+	D_("Can't open config file %s.\n", filename);
+	return (NULL);
     }
     file = file_content;
     g_pointer = file;
@@ -299,97 +299,97 @@
     /* main parse line by line loop */
     while (file[0] != '\0')
     {
-        stype_h *stype = NULL;
+	stype_h *stype = NULL;
 
-        DL_(file, "parse_file while loop:");
-        /* skip leading spaces */
-        JUMP_NSPACES(file);
-        if (file[0] == '\0')
-        {
-            DL_(file, "End of file");
-            break;
-        }
-
-        /* skip lines starting with '#' */
-        if (file[0] == '#' || file[0] == '\n' || file[0] == ';')
-        {
-            REALLY_JUMP_TO_NEXT_ROW(file);
-            continue;
-        }
-        /*
-         * parsometer:
-         *   service test {
-         *   ^
-         */
-
-        /* get the stype */
-        if (!(stype = initng_service_types_get(file)))
-        {
-            match = NULL;
-            break;
-        }
-
-        JUMP_TO_NEXT_WORD(file);
-        /*
-         * parsometer:
-         *   service test {
-         *           ^
-         */
-
-        /* parse line, with options from that service type */
-        if (parse_service_line(&file, watch_for, NULL, stype,
-                               filename, &match, &exact_match) == TRUE)
-        {
-            /* if we found RIGHT what we wanted */
-            if (exact_match)
-            {
-                match = exact_match;
-                break;
-            }
-
-            /* ok, jump the ending '}' stack */
-            if (file[0] == '}')
-                file++;
-        }
+	DL_(file, "parse_file while loop:");
+	/* skip leading spaces */
+	JUMP_NSPACES(file);
+	if (file[0] == '\0')
+	{
+	    DL_(file, "End of file");
+	    break;
+	}
+
+	/* skip lines starting with '#' */
+	if (file[0] == '#' || file[0] == '\n' || file[0] == ';')
+	{
+	    REALLY_JUMP_TO_NEXT_ROW(file);
+	    continue;
+	}
+	/*
+	 * parsometer:
+	 *   service test {
+	 *   ^
+	 */
+
+	/* get the stype */
+	if (!(stype = initng_service_types_get(file)))
+	{
+	    match = NULL;
+	    break;
+	}
+
+	JUMP_TO_NEXT_WORD(file);
+	/*
+	 * parsometer:
+	 *   service test {
+	 *           ^
+	 */
+
+	/* parse line, with options from that service type */
+	if (parse_service_line(&file, watch_for, NULL, stype,
+			       filename, &match, &exact_match) == TRUE)
+	{
+	    /* if we found RIGHT what we wanted */
+	    if (exact_match)
+	    {
+		match = exact_match;
+		break;
+	    }
+
+	    /* ok, jump the ending '}' stack */
+	    if (file[0] == '}')
+		file++;
+	}
 
-    }                                       /* end while */
+    }					    /* end while */
 
     if (file_content)
     {
-        free(file_content);
-        file_content = NULL;
+	free(file_content);
+	file_content = NULL;
     }
 
     /* add to service db */
     if (match && !initng_service_cache_add(match))
     {
-        /* Problem adding, probably this service name exists already,
-         * DO NOT EVEN TRY TO UNLOAD EXISTENT! some services my already rely on it or 
-         * we can get here if we processing 'need' option from this service, unloading
-         * will make watch_for to point on not existing area of memory!
-         */
-        service_cache_h *found;
-
-        /* search for an with same name */
-        found = initng_service_cache_find_by_name(match->name);
-
-        /* if found, free created an return founded */
-        if (found)
-        {
-            initng_service_cache_free(match);
-            match = found;
-        }
-        else if (!initng_service_cache_add(match))
-        {
-            F_("Could not add service to service db!\n");
-            initng_service_cache_free(match);
-            match = NULL;
-        }
+	/* Problem adding, probably this service name exists already,
+	 * DO NOT EVEN TRY TO UNLOAD EXISTENT! some services my already rely on it or 
+	 * we can get here if we processing 'need' option from this service, unloading
+	 * will make watch_for to point on not existing area of memory!
+	 */
+	service_cache_h *found;
+
+	/* search for an with same name */
+	found = initng_service_cache_find_by_name(match->name);
+
+	/* if found, free created an return founded */
+	if (found)
+	{
+	    initng_service_cache_free(match);
+	    match = found;
+	}
+	else if (!initng_service_cache_add(match))
+	{
+	    F_("Could not add service to service db!\n");
+	    initng_service_cache_free(match);
+	    match = NULL;
+	}
     }
 
 #ifdef DEBUG
     if (!match)
-        D_("%s - no match", watch_for);
+	D_("%s - no match", watch_for);
 #endif
 
     /* Return what we got, and hope for the best */
@@ -398,9 +398,9 @@
 
 
 static int parse_service_line(char **to_parse, const char *watch_for,
-                              service_cache_h * father, stype_h * type,
-                              char *filename, service_cache_h ** match,
-                              service_cache_h ** exact_match)
+			      service_cache_h * father, stype_h * type,
+			      char *filename, service_cache_h ** match,
+			      service_cache_h ** exact_match)
 {
     char *name = NULL;
     char *father_name = NULL;
@@ -424,8 +424,8 @@
     JUMP_NSPACES(*to_parse);
     if (ENDED(*to_parse))
     {
-        FL_(*to_parse, "Line ended unexpectedly.");
-        return (FALSE);
+	FL_(*to_parse, "Line ended unexpectedly.");
+	return (FALSE);
     }
 
     /* service test : class { */
@@ -434,14 +434,14 @@
     /* this fetches name, and increase *to_parse */
     if (!(name = st_dup_next_word(to_parse)))
     {
-        FL_(*to_parse, "Did not get a name!");
-        return (FALSE);
+	FL_(*to_parse, "Did not get a name!");
+	return (FALSE);
     }
 
     if (!is_valid(name))
     {
-        FL_(*to_parse, "Name contains invalid characters.");
-        return (FALSE);
+	FL_(*to_parse, "Name contains invalid characters.");
+	return (FALSE);
     }
 
     /* service test : class { */
@@ -453,59 +453,59 @@
     JUMP_NSPACES(*to_parse);
     if (ENDED(*to_parse))
     {
-        FL_(*to_parse, "Line ended unexpectedly.");
-        free(name);
-        return (FALSE);;
+	FL_(*to_parse, "Line ended unexpectedly.");
+	free(name);
+	return (FALSE);;
     }
 
     /* service test : class { */
     /*              |         */
     if ((*to_parse)[0] == ':')
     {
-        (*to_parse)++;
-        /* service test : class { */
-        /*               |        */
-
-        /* jump forward on spaces */
-        JUMP_NSPACES(*to_parse);
-        if (ENDED(*to_parse))
-        {
-            FL_(*to_parse, "Line ended unexpectedly.");
-            free(name);
-            return (FALSE);
-        }
-        /* service test : class { */
-        /*                |       */
-
-        if (!(father_name = st_dup_next_word(to_parse)))
-        {
-            FL_(*to_parse, "Unable to fetch fathername.");
-            free(name);
-            return (FALSE);
-        }
-
-        if (!is_valid(father_name))
-        {
-            FL_(*to_parse, "Father name contains invalid characters.");
-            return (FALSE);
-        }
+	(*to_parse)++;
+	/* service test : class { */
+	/*               |        */
+
+	/* jump forward on spaces */
+	JUMP_NSPACES(*to_parse);
+	if (ENDED(*to_parse))
+	{
+	    FL_(*to_parse, "Line ended unexpectedly.");
+	    free(name);
+	    return (FALSE);
+	}
+	/* service test : class { */
+	/*                |       */
+
+	if (!(father_name = st_dup_next_word(to_parse)))
+	{
+	    FL_(*to_parse, "Unable to fetch fathername.");
+	    free(name);
+	    return (FALSE);
+	}
+
+	if (!is_valid(father_name))
+	{
+	    FL_(*to_parse, "Father name contains invalid characters.");
+	    return (FALSE);
+	}
 
 #ifdef DEBUG
-        if (father_name)
-            D_("Father is: %s, set from \"server : father\"\n", father_name);
+	if (father_name)
+	    D_("Father is: %s, set from \"server : father\"\n", father_name);
 #endif
 
-        /* service test : class { */
-        /*                     |  */
-        /* jump forward on spaces */
-        JUMP_NSPACES(*to_parse);
-        if (ENDED(*to_parse))
-        {
-            FL_(*to_parse, "Line ended unexpectedly.");
-            free(name);
-            free(father_name);
-            return (FALSE);
-        }
+	/* service test : class { */
+	/*                     |  */
+	/* jump forward on spaces */
+	JUMP_NSPACES(*to_parse);
+	if (ENDED(*to_parse))
+	{
+	    FL_(*to_parse, "Line ended unexpectedly.");
+	    free(name);
+	    free(father_name);
+	    return (FALSE);
+	}
     }
 
     DL_(*to_parse, "Parse opt, should stand directly over { char");
@@ -513,12 +513,12 @@
     /*                      | */
     if ((*to_parse)[0] != '{')
     {
-        /* something is wrong */
-        FL_(*to_parse, "error parsing, expected something else.");
-        free(name);
-        if (father_name)
-            free(father_name);
-        return (FALSE);
+	/* something is wrong */
+	FL_(*to_parse, "error parsing, expected something else.");
+	free(name);
+	if (father_name)
+	    free(father_name);
+	return (FALSE);
     }
 
     /* jump to first char after start tag and begin from there. */
@@ -527,51 +527,51 @@
 
     if (initng_service_cache_find_by_exact_name(name))
     {
-        D_("service %s already parsed, skipping to the end of stack\n", name);
-        int stack = 1;
-        int quoted = FALSE;
-        int backslashed = FALSE;
-
-        while ((*to_parse)[0])
-        {
-            if (backslashed == FALSE)
-            {
-                if ((*to_parse)[0] == '\\')
-                    backslashed = TRUE;
-                else if ((*to_parse)[0] == '"' || (*to_parse)[0] == '\'')
-                {
-                    if (quoted == FALSE)
-                        quoted = (*to_parse)[0];
-                    else if (quoted == (*to_parse)[0])
-                        quoted = FALSE;
-                }
-                else if (quoted == FALSE)
-                {
-                    if ((*to_parse)[0] == '{')
-                        stack++;
-                    else if ((*to_parse)[0] == '}')
-                        stack--;
-                    else if ((*to_parse)[0] == '#')
-                    {
-                        REALLY_JUMP_TO_NEXT_ROW(*to_parse);
-                        continue;
-                    }
-                }
-            }
-            else
-                backslashed = FALSE;
-
-            if (stack == 0)
-                break;
-
-            (*to_parse)++;
-        }
-
-        free(name);
-        if (father_name)
-            free(father_name);
+	D_("service %s already parsed, skipping to the end of stack\n", name);
+	int stack = 1;
+	int quoted = FALSE;
+	int backslashed = FALSE;
+
+	while ((*to_parse)[0])
+	{
+	    if (backslashed == FALSE)
+	    {
+		if ((*to_parse)[0] == '\\')
+		    backslashed = TRUE;
+		else if ((*to_parse)[0] == '"' || (*to_parse)[0] == '\'')
+		{
+		    if (quoted == FALSE)
+			quoted = (*to_parse)[0];
+		    else if (quoted == (*to_parse)[0])
+			quoted = FALSE;
+		}
+		else if (quoted == FALSE)
+		{
+		    if ((*to_parse)[0] == '{')
+			stack++;
+		    else if ((*to_parse)[0] == '}')
+			stack--;
+		    else if ((*to_parse)[0] == '#')
+		    {
+			REALLY_JUMP_TO_NEXT_ROW(*to_parse);
+			continue;
+		    }
+		}
+	    }
+	    else
+		backslashed = FALSE;
+
+	    if (stack == 0)
+		break;
+
+	    (*to_parse)++;
+	}
+
+	free(name);
+	if (father_name)
+	    free(father_name);
 
-        return (TRUE);
+	return (TRUE);
     }
 
     DL_(*to_parse, "Parse opt, should be first char in stack");
@@ -591,78 +591,78 @@
     /* check so that it was allocated! */
     if (!new_service)
     {
-        F_("Unable to allocate space for new service.\n");
-        FL_(*to_parse, "Unable to allocate space for new service.");
-        if (father_name)
-            free(father_name);
-        return (FALSE);
+	F_("Unable to allocate space for new service.\n");
+	FL_(*to_parse, "Unable to allocate space for new service.");
+	if (father_name)
+	    free(father_name);
+	return (FALSE);
     }
 
     /* set the father to the service */
     if (father_name)
     {
-        if (father)
-            new_service->father = father;
-        new_service->father_name = father_name;
+	if (father)
+	    new_service->father = father;
+	new_service->father_name = father_name;
     }
 
     /* set type if not set. */
     if (father)
-        new_service->type = type;
+	new_service->type = type;
 
     /* carry on until segment stop or eof, this will handle all lines in current section */
     while ((*to_parse)[0])
     {
 
-        DL_(*to_parse, "parse_service_line, while loop :");
+	DL_(*to_parse, "parse_service_line, while loop :");
 
-        /* skip spaces and empty lines with them */
-        JUMP_NSPACES(*to_parse);
+	/* skip spaces and empty lines with them */
+	JUMP_NSPACES(*to_parse);
 
-        /* end of row */
-        if ((*to_parse)[0] == ';')
-        {
-            (*to_parse)++;
-            continue;
-        }
-
-        /* end of file or stack */
-        if (!(*to_parse)[0] || (*to_parse)[0] == '}')
-        {
-            DL_(*to_parse,
-                "When escaping from parse_service_line while loop");
-            break;
-        }
-
-        /* skip lines starting with '#' */
-        if ((*to_parse)[0] == '#')
-        {
-            REALLY_JUMP_TO_NEXT_ROW(*to_parse);
-            continue;
-        }
-
-
-        DL_(*to_parse, "parse_service_line, on first option char:");
-
-        /* parse line - search for keywords in g.option_table */
-        if (parse_opt(to_parse, type, new_service))
-        {
-            if ((*to_parse)[0] != ';')
-            {
-                FL_(*to_parse, "Must be a ';' char here");
-                break;
-            }
-
-            /* jump the ';' char */
-            (*to_parse)++;
-            continue;
-        }
-
-        /* Bad content, could not be parsed */
-        /* free and reset */
-        initng_service_cache_free(new_service);
-        new_service = NULL;
-        return (FALSE);
+	/* end of row */
+	if ((*to_parse)[0] == ';')
+	{
+	    (*to_parse)++;
+	    continue;
+	}
+
+	/* end of file or stack */
+	if (!(*to_parse)[0] || (*to_parse)[0] == '}')
+	{
+	    DL_(*to_parse,
+		"When escaping from parse_service_line while loop");
+	    break;
+	}
+
+	/* skip lines starting with '#' */
+	if ((*to_parse)[0] == '#')
+	{
+	    REALLY_JUMP_TO_NEXT_ROW(*to_parse);
+	    continue;
+	}
+
+
+	DL_(*to_parse, "parse_service_line, on first option char:");
+
+	/* parse line - search for keywords in g.option_table */
+	if (parse_opt(to_parse, type, new_service))
+	{
+	    if ((*to_parse)[0] != ';')
+	    {
+		FL_(*to_parse, "Must be a ';' char here");
+		break;
+	    }
+
+	    /* jump the ';' char */
+	    (*to_parse)++;
+	    continue;
+	}
+
+	/* Bad content, could not be parsed */
+	/* free and reset */
+	initng_service_cache_free(new_service);
+	new_service = NULL;
+	return (FALSE);
     }
 
     set_string(&FROM_FILE, new_service, i_strdup(filename));
@@ -670,34 +670,34 @@
 
     if (strcmp(new_service->name, watch_for) == 0)
     {
-        D_("Found EXACT match: %s\n", new_service->name);
-        (*exact_match) = new_service;
-        return (TRUE);
+	D_("Found EXACT match: %s\n", new_service->name);
+	(*exact_match) = new_service;
+	return (TRUE);
     }
 
     /* check if this is the service we are looking for. */
     if (service_match(watch_for, new_service->name) == TRUE)
     {
-        D_("Found :%s\n", new_service->name);
+	D_("Found :%s\n", new_service->name);
 
-        /* Just explanation - will erase later (TheLich):
-         * don't keep services with wildcards in service_cache
-         * thus there is each separate copy for each service, that
-         * was created from wildcard service and now all services
-         * in service cache will have unique names (no need in
-         * pattern search when looking for service). This is because
-         * of new behaviour of initng parser (adding to cache only that
-         * service which was asked). If we will not do that, then if 
-         * wildcard service exists in database and we want to add *real*
-         * service, which matches this wildcard - it will not be added,
-         * wildcard service will be used instead. (daemon/getty/ * and
-         * daemon/getty/1 is a good example).
-         */
-
-        free(new_service->name);
-        new_service->name = i_strdup(watch_for);
-        (*match) = new_service;
-        return (TRUE);
+	/* Just explanation - will erase later (TheLich):
+	 * don't keep services with wildcards in service_cache
+	 * thus there is each separate copy for each service, that
+	 * was created from wildcard service and now all services
+	 * in service cache will have unique names (no need in
+	 * pattern search when looking for service). This is because
+	 * of new behaviour of initng parser (adding to cache only that
+	 * service which was asked). If we will not do that, then if 
+	 * wildcard service exists in database and we want to add *real*
+	 * service, which matches this wildcard - it will not be added,
+	 * wildcard service will be used instead. (daemon/getty/ * and
+	 * daemon/getty/1 is a good example).
+	 */
+
+	free(new_service->name);
+	new_service->name = i_strdup(watch_for);
+	(*match) = new_service;
+	return (TRUE);
     }
 
     initng_service_cache_free(new_service);
@@ -729,8 +729,8 @@
     JUMP_NSPACES(*where);
     if (ENDED(*where))
     {
-        FL_(*where, "Line ended unexpectedly.");
-        return (FALSE);
+	FL_(*where, "Line ended unexpectedly.");
+	return (FALSE);
     }
 
     /* Parsometer
@@ -742,22 +742,22 @@
     /* skip empty services */
     if ((*where)[0] == '}')
     {
-        FL_(*where, "found a } char here!");
-        return (FALSE);
+	FL_(*where, "found a } char here!");
+	return (FALSE);
     }
 
     /* count number of chars this option name have */
     if ((opt_len = strcspn((*where), "\n; \t=\"'")) < 1)
     {
-        FL_(*where, "option name to short!");
-        return (FALSE);
+	FL_(*where, "option name to short!");
+	return (FALSE);
     }
 
     /* get option name and strip all blanks from it */
     if (opt_len >= MAX_OPT_LEN)
     {
-        FL_(*where, "Max optlen 100 reached!");
-        return (FALSE);
+	FL_(*where, "Max optlen 100 reached!");
+	return (FALSE);
     }
     strncpy(opt_name, (*where), opt_len);
     opt_name[opt_len] = '\0';
@@ -766,8 +766,8 @@
     (*where) += opt_len;
     if (ENDED(*where))
     {
-        FL_(*where, "Line just ended after variable name.");
-        return (FALSE);
+	FL_(*where, "Line just ended after variable name.");
+	return (FALSE);
     }
     /* Parsometer
      *
@@ -778,8 +778,8 @@
     JUMP_NSPACES(*where);
     if (ENDED(*where))
     {
-        FL_(*where, "Line just ended after variable name.");
-        return (FALSE);
+	FL_(*where, "Line just ended after variable name.");
+	return (FALSE);
     }
 
     /* Parsometer
@@ -791,52 +791,52 @@
 
     if ((*where)[0] != '=' && (*where)[0] != ';')
     {
-        /* count number of chars this option name have */
-        if (!(var_len = strcspn((*where), "\n; \t=\"'")))
-        {
-            FL_(*where, "variable name to short!");
-            return (FALSE);
-        }
-
-        /* get option name and strip all blanks from it */
-        if (var_len >= MAX_VAR_LEN)
-        {
-            FL_(*where, "Maximum variable name of 100 met.");
-            return (FALSE);
-        }
-
-        /* copy the string */
-        var_name = i_strndup(*where, var_len);
-
-        if (!is_valid(var_name))
-        {
-            FL_(*where, "Variable name contains invalid characters.");
-            return (FALSE);
-        }
-
-        DL_(*where, var_name);
-
-        (*where) += var_len;
-
-        DL_(*where, "EMPTYSPACE");
-
-        /* Parsometer
-         *
-         * "   script start = /usr/bin/gdm; "
-         * "               |                "
-         */
-        JUMP_NSPACES(*where);
-        if (ENDED(*where))
-        {
-            FL_(*where, "Line ended unexpectedly.");
-            free(var_name);
-            return (FALSE);
-        }
-        /* Parsometer
-         *
-         * "   script start = /usr/bin/gdm; "
-         * "                |               "
-         */
+	/* count number of chars this option name have */
+	if (!(var_len = strcspn((*where), "\n; \t=\"'")))
+	{
+	    FL_(*where, "variable name to short!");
+	    return (FALSE);
+	}
+
+	/* get option name and strip all blanks from it */
+	if (var_len >= MAX_VAR_LEN)
+	{
+	    FL_(*where, "Maximum variable name of 100 met.");
+	    return (FALSE);
+	}
+
+	/* copy the string */
+	var_name = i_strndup(*where, var_len);
+
+	if (!is_valid(var_name))
+	{
+	    FL_(*where, "Variable name contains invalid characters.");
+	    return (FALSE);
+	}
+
+	DL_(*where, var_name);
+
+	(*where) += var_len;
+
+	DL_(*where, "EMPTYSPACE");
+
+	/* Parsometer
+	 *
+	 * "   script start = /usr/bin/gdm; "
+	 * "               |                "
+	 */
+	JUMP_NSPACES(*where);
+	if (ENDED(*where))
+	{
+	    FL_(*where, "Line ended unexpectedly.");
+	    free(var_name);
+	    return (FALSE);
+	}
+	/* Parsometer
+	 *
+	 * "   script start = /usr/bin/gdm; "
+	 * "                |               "
+	 */
 
 
     }
@@ -846,60 +846,60 @@
     /* walk the option db */
     while_service_data_types(current)
     {
-        /* temporary pointer storage */
-        s_entry *tmp = current;
+	/* temporary pointer storage */
+	s_entry *tmp = current;
 
-        /* make sure opt_name is set */
-        if (!current->opt_name)
-            continue;
-
-        /* check that option is not marked for a certain service type */
-        if (current->ot && current->ot != type)
-            continue;
-
-        /* check string length of word, this is faster then strcasecmp */
-        if (opt_len != current->opt_name_len)
-        {
-            /*F_("Lenght is not correct.\n"); */
-            continue;
-        }
-
-        /* finally, check if opt_name is what we are looking for */
-        if (strncmp(current->opt_name, opt_name, opt_len) != 0)
-            continue;
-
-        D_("parse_opt(%s): option \"%s\" value at option.\n",
-           srv->name, current->opt_name);
-
-        /* if this is a alias, browse forward to the correct opt_type */
-        while (tmp->opt_type == ALIAS && tmp->alias)
-            tmp = tmp->alias;
-
-        D_("option type %i, var_name: %s, opt_name: %s\n", tmp->opt_type,
-           var_name ? var_name : "(none)", current->opt_name);
-
-        DL_(*where, current->opt_name);
-
-        /* now switch the opt_type */
-        switch (tmp->opt_type)
-        {
-            case STRING:
-            case VARIABLE_STRING:
-                return (string_parser(current, where, var_name, srv));
-            case STRINGS:
-            case VARIABLE_STRINGS:
-                return (strings_parser(current, where, var_name, srv));
-            case SET:
-            case VARIABLE_SET:
-                return (set_parser(current, where, var_name, srv));
-            case INT:
-            case VARIABLE_INT:
-                return (iint_parser(current, where, var_name, srv));
-            default:
-                break;
-        }
-        FL_(*where, "Unknown, or undefined type to parse!");
-        return (FALSE);
+	/* make sure opt_name is set */
+	if (!current->opt_name)
+	    continue;
+
+	/* check that option is not marked for a certain service type */
+	if (current->ot && current->ot != type)
+	    continue;
+
+	/* check string length of word, this is faster then strcasecmp */
+	if (opt_len != current->opt_name_len)
+	{
+	    /*F_("Lenght is not correct.\n"); */
+	    continue;
+	}
+
+	/* finally, check if opt_name is what we are looking for */
+	if (strncmp(current->opt_name, opt_name, opt_len) != 0)
+	    continue;
+
+	D_("parse_opt(%s): option \"%s\" value at option.\n",
+	   srv->name, current->opt_name);
+
+	/* if this is a alias, browse forward to the correct opt_type */
+	while (tmp->opt_type == ALIAS && tmp->alias)
+	    tmp = tmp->alias;
+
+	D_("option type %i, var_name: %s, opt_name: %s\n", tmp->opt_type,
+	   var_name ? var_name : "(none)", current->opt_name);
+
+	DL_(*where, current->opt_name);
+
+	/* now switch the opt_type */
+	switch (tmp->opt_type)
+	{
+	    case STRING:
+	    case VARIABLE_STRING:
+		return (string_parser(current, where, var_name, srv));
+	    case STRINGS:
+	    case VARIABLE_STRINGS:
+		return (strings_parser(current, where, var_name, srv));
+	    case SET:
+	    case VARIABLE_SET:
+		return (set_parser(current, where, var_name, srv));
+	    case INT:
+	    case VARIABLE_INT:
+		return (iint_parser(current, where, var_name, srv));
+	    default:
+		break;
+	}
+	FL_(*where, "Unknown, or undefined type to parse!");
+	return (FALSE);
     }
 
     /* bail out if we did not find a match */
@@ -910,8 +910,8 @@
 }
 
 static int set_parser(s_entry * type, char **value
-                      __attribute__ ((unused)), char *va,
-                      service_cache_h * from_service)
+		      __attribute__ ((unused)), char *va,
+		      service_cache_h * from_service)
 {
     assert(from_service);
     assert(*value);
@@ -932,9 +932,9 @@
 
     if ((*value)[0] == ';')
     {
-        D_("set_parser(%s,s,%s);\n", type->opt_name, from_service->name);
-        set_var(type, va, from_service);
-        return (TRUE);
+	D_("set_parser(%s,s,%s);\n", type->opt_name, from_service->name);
+	set_var(type, va, from_service);
+	return (TRUE);
     }
 
     /* Parsometer
@@ -944,8 +944,8 @@
      */
     if ((*value)[0] != '=')
     {
-        FL_(*value, "There should be an ';' or '=' here!");
-        return (FALSE);
+	FL_(*value, "There should be an ';' or '=' here!");
+	return (FALSE);
     }
 
     /* skip the '=' char */
@@ -953,8 +953,8 @@
     JUMP_NSPACES(*value);
     if (ENDED(*value))
     {
-        FL_(*value, "Line ended unexpectedly.");
-        return (FALSE);
+	FL_(*value, "Line ended unexpectedly.");
+	return (FALSE);
     }
 
     /* Parsometer
@@ -964,22 +964,22 @@
      */
     if (strncasecmp(*value, "yes", 3) == 0)
     {
-        D_("set_parser(%s,s,%s);\n", type->opt_name, from_service->name);
-        set_var(type, va, from_service);
+	D_("set_parser(%s,s,%s);\n", type->opt_name, from_service->name);
+	set_var(type, va, from_service);
 
-        /* skip 3 chars */
-        (*value) += 3;
-        return (TRUE);
+	/* skip 3 chars */
+	(*value) += 3;
+	return (TRUE);
     }
 
     if (strncasecmp(*value, "true", 4) == 0)
     {
-        D_("set_parser(%s,s,%s);\n", type->opt_name, from_service->name);
-        set_var(type, va, from_service);
+	D_("set_parser(%s,s,%s);\n", type->opt_name, from_service->name);
+	set_var(type, va, from_service);
 
-        /* skip 4 chars */
-        (*value) += 4;
-        return (TRUE);
+	/* skip 4 chars */
+	(*value) += 4;
+	return (TRUE);
     }
 
     /* else, remove */
@@ -989,7 +989,7 @@
 
 
 static int string_parser(s_entry * type, char **value, char *va,
-                         service_cache_h * from_service)
+			 service_cache_h * from_service)
 {
     char *to;
 
@@ -1007,15 +1007,15 @@
     DL_(*value, "string_parser()");
     if ((*value)[0] != '=')
     {
-        FL_(*value, "There should be an = here.");
-        return (FALSE);
+	FL_(*value, "There should be an = here.");
+	return (FALSE);
     }
 
     (*value)++;
     if (ENDED(*value))
     {
-        FL_(*value, "Line ended unexpectedly.");
-        return (FALSE);
+	FL_(*value, "Line ended unexpectedly.");
+	return (FALSE);
     }
     /* Parsometer
      *
@@ -1025,8 +1025,8 @@
     JUMP_NSPACES(*value);
     if (ENDED(*value))
     {
-        FL_(*value, "Line ended unexpectedly.");
-        return (FALSE);
+	FL_(*value, "Line ended unexpectedly.");
+	return (FALSE);
     }
 
     /* Parsometer
@@ -1040,7 +1040,7 @@
 
     /* go to the end and stay there */
     while ((*value)[0] && (*value)[0] != ';')
-        (*value)++;
+	(*value)++;
 
     DL_(*value, "skip to the ';' char");
 
@@ -1052,19 +1052,19 @@
     /* make sure the end is a ';' */
     if (ENDED(*value))
     {
-        FL_(*value, "Line ended unexpectedly.");
-        free(to);
-        return (FALSE);
+	FL_(*value, "Line ended unexpectedly.");
+	free(to);
+	return (FALSE);
     }
 
     if ((*value)[0] != ';')
     {
-        FL_(*value, "There should be an ; here.");
-        if ((*value)[0] == '\n')
-            F_("Its a *newline* instead.\n");
-        else
-            F_("Its a %c instead.\n", (*value)[0]);
-        return (FALSE);
+	FL_(*value, "There should be an ; here.");
+	if ((*value)[0] == '\n')
+	    F_("Its a *newline* instead.\n");
+	else
+	    F_("Its a %c instead.\n", (*value)[0]);
+	return (FALSE);
     }
 
 
@@ -1074,7 +1074,7 @@
 }
 
 static int iint_parser(s_entry * type, char **value, char *va,
-                       service_cache_h * from_service)
+		       service_cache_h * from_service)
 {
     char to[11];
     int len = 0;
@@ -1092,15 +1092,15 @@
 
     if ((*value)[0] != '=')
     {
-        FL_(*value, "Missing an '=' here.");
-        return (FALSE);
+	FL_(*value, "Missing an '=' here.");
+	return (FALSE);
     }
 
     (*value)++;
     if (ENDED(*value))
     {
-        FL_(*value, "Line ended unexpectedly.");
-        return (FALSE);
+	FL_(*value, "Line ended unexpectedly.");
+	return (FALSE);
     }
 
     /* Parsometer
@@ -1112,8 +1112,8 @@
     JUMP_NSPACES(*value);
     if (ENDED(*value))
     {
-        FL_(*value, "Line ended unexpectedly.");
-        return (FALSE);
+	FL_(*value, "Line ended unexpectedly.");
+	return (FALSE);
     }
 
     /* Parsometer
@@ -1126,15 +1126,15 @@
     /* make sure the end is a ';' */
     if ((*value)[len] != ';')
     {
-        FL_(*value, "Missing an ';' char.");
-        return (FALSE);
+	FL_(*value, "Missing an ';' char.");
+	return (FALSE);
     }
 
     /* make sure value is not to big */
     if (len >= 10)
     {
-        FL_(*value, "Length is bigger than 10.");
-        return (FALSE);
+	FL_(*value, "Length is bigger than 10.");
+	return (FALSE);
     }
 
     /* ok, copy the code */
@@ -1145,8 +1145,8 @@
     (*value) += len;
     if (ENDED(*value))
     {
-        FL_(*value, "Line ended unexpectedly.");
-        return (FALSE);
+	FL_(*value, "Line ended unexpectedly.");
+	return (FALSE);
     }
 
     set_int_var(type, va, from_service, atoi(to));
@@ -1154,7 +1154,7 @@
 }
 
 static int strings_parser(s_entry * type, char **value, char *va,
-                          service_cache_h * from_service)
+			  service_cache_h * from_service)
 {
     char *to = NULL;
 
@@ -1173,15 +1173,15 @@
 
     if ((*value)[0] != '=')
     {
-        FL_(*value, "Missing an '=' here.");
-        return (FALSE);
+	FL_(*value, "Missing an '=' here.");
+	return (FALSE);
     }
 
     (*value)++;
     if (ENDED(*value))
     {
-        FL_(*value, "Line ended unexpectedly.");
-        return (FALSE);
+	FL_(*value, "Line ended unexpectedly.");
+	return (FALSE);
     }
 
     /* Parsometer
@@ -1192,8 +1192,8 @@
     JUMP_NSPACES(*value);
     if (ENDED(*value))
     {
-        FL_(*value, "Line ended unexpectedly.");
-        return (FALSE);
+	FL_(*value, "Line ended unexpectedly.");
+	return (FALSE);
     }
     /* Parsometer
      *
@@ -1201,38 +1201,38 @@
      * "          |             "
      */
     DL_(*value,
-        "strings_parser, Youst before dup_string_and_walk(value, TRUE)");
+	"strings_parser, Youst before dup_string_and_walk(value, TRUE)");
 
     while ((to = dup_string_and_walk(value, TRUE)))
     {
-        DL_(*value, "adding");
-        if (va)
-        {
-            set_another_string_var(type, i_strdup(va), from_service, to);
-        }
-        else
-        {
-            set_another_string_var(type, NULL, from_service, to);
-        }
-        /* check if this is end */
-        if ((*value)[0] == ';')
-            break;
-
-        JUMP_NSPACES(*value);
-
-        /* check if this is end */
-        if ((*value)[0] == ';')
-            break;
-        if (ENDED(*value))
-            break;
-        DL_(*value, "a_add");
+	DL_(*value, "adding");
+	if (va)
+	{
+	    set_another_string_var(type, i_strdup(va), from_service, to);
+	}
+	else
+	{
+	    set_another_string_var(type, NULL, from_service, to);
+	}
+	/* check if this is end */
+	if ((*value)[0] == ';')
+	    break;
+
+	JUMP_NSPACES(*value);
+
+	/* check if this is end */
+	if ((*value)[0] == ';')
+	    break;
+	if (ENDED(*value))
+	    break;
+	DL_(*value, "a_add");
     }
 
     /* dont forgot to free va */
     if (va)
     {
-        free(va);
-        va = NULL;
+	free(va);
+	va = NULL;
     }
     /* Parsometer
      *
@@ -1243,8 +1243,8 @@
     DL_(*value, "all added");
     if ((*value)[0] != ';')
     {
-        FL_(*value, "End char is not an ';'.");
-        return (FALSE);
+	FL_(*value, "End char is not an ';'.");
+	return (FALSE);
     }
     return (TRUE);
 }
@@ -1255,8 +1255,8 @@
     D_("i_parser: module_init();\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     return (initng_plugin_hook_add(&g.PARSERS, 50, &initng_i_parser));
@@ -1287,11 +1287,11 @@
 
     if (space_is_new_word == TRUE)
     {
-        DL_(*value, "Space is new word");
+	DL_(*value, "Space is new word");
     }
     else
     {
-        DL_(*value, "Space is none word");
+	DL_(*value, "Space is none word");
     }
 
     DL_(*value, "dup_string_and_walk:");
@@ -1301,55 +1301,55 @@
     /* If this value we should copy is stacked in braces */
     if ((*value)[0] == '{')
     {
-        int stack = 1;
+	int stack = 1;
 
-        (*value)++;
+	(*value)++;
 
 #ifndef NOTRIM
-        JUMP_NSPACES(*value);
+	JUMP_NSPACES(*value);
 #endif
-        /* count length to the '}' char */
-        while ((*value)[len])
-        {
-            if ((*value)[len] == '{')
-                stack++;
-            else if ((*value)[len] == '}')
-                stack--;
-
-            /* if stack is zero or below, we are standing on a '}' with no escape char before */
-            if (stack <= 0 && (*value)[len] == '}'
-                && (*value)[len - 1] != '\\')
-            {
-                (*value)[len] = ';';
-                break;
-            }
-            len++;
-        }
+	/* count length to the '}' char */
+	while ((*value)[len])
+	{
+	    if ((*value)[len] == '{')
+		stack++;
+	    else if ((*value)[len] == '}')
+		stack--;
+
+	    /* if stack is zero or below, we are standing on a '}' with no escape char before */
+	    if (stack <= 0 && (*value)[len] == '}'
+		&& (*value)[len - 1] != '\\')
+	    {
+		(*value)[len] = ';';
+		break;
+	    }
+	    len++;
+	}
 
 #ifndef NOTRIM
-        while ((*value)[len - 1] == ' ' || (*value)[len - 1] == '\t'
-               || (*value)[len - 1] == '\n')
-            len--;
+	while ((*value)[len - 1] == ' ' || (*value)[len - 1] == '\t'
+	       || (*value)[len - 1] == '\n')
+	    len--;
 #endif
-        /* ok, copy the code */
-        if (!(to = i_strndup(*value, len)))
-        {
-            FL_(*value, "Failed copying.");
-            return (NULL);
-        }
+	/* ok, copy the code */
+	if (!(to = i_strndup(*value, len)))
+	{
+	    FL_(*value, "Failed copying.");
+	    return (NULL);
+	}
 
-        /* walk forward again */
-        (*value) += len;
+	/* walk forward again */
+	(*value) += len;
 
 #ifndef NOTRIM
-        JUMP_NSPACES(*value);
+	JUMP_NSPACES(*value);
 #endif
-        if ((*value)[0] == '}')
-            (*value)++;
+	if ((*value)[0] == '}')
+	    (*value)++;
 
-        DL_(*value, "after += len");
+	DL_(*value, "after += len");
 
-        return (to);
+	return (to);
 
     }
 
@@ -1357,35 +1357,35 @@
     /* if it is embraced in with '"' */
     if ((*value)[0] == '"')
     {
-        /* skip the '"' char */
-        (*value)++;
+	/* skip the '"' char */
+	(*value)++;
 
-        /* count the number of tokens */
-        while ((*value)[len])
-        {
-            /* if this is the ending '"' with no escape char before */
-            if ((*value)[len] == '"' && (*value)[len - 1] != '\\')
-            {
-                break;
-            }
-            len++;
-        }
-
-        /* ok, copy the code */
-        if (!(to = i_strndup(*value, len)))
-        {
-            FL_(*value, "Failed copying.");
-            return (NULL);
-        }
-
-        /* walk forward again */
-        (*value) += len;
-        if ((*value)[0] == '"')
-            (*value)++;
+	/* count the number of tokens */
+	while ((*value)[len])
+	{
+	    /* if this is the ending '"' with no escape char before */
+	    if ((*value)[len] == '"' && (*value)[len - 1] != '\\')
+	    {
+		break;
+	    }
+	    len++;
+	}
+
+	/* ok, copy the code */
+	if (!(to = i_strndup(*value, len)))
+	{
+	    FL_(*value, "Failed copying.");
+	    return (NULL);
+	}
+
+	/* walk forward again */
+	(*value) += len;
+	if ((*value)[0] == '"')
+	    (*value)++;
 
-        DL_(*value, "after += len");
+	DL_(*value, "after += len");
 
-        return (to);
+	return (to);
     }
 
     /* else */
@@ -1394,34 +1394,34 @@
     /* Count length */
     while ((*value)[len])
     {
-        /* this char is escaped by the char before */
-        if ((*value)[len - 1] == '\\')
-        {
-            len++;
-            continue;
-        }
-
-        /* If we should break copying on a space, check this */
-        if (space_is_new_word == TRUE)
-        {
-            DL_(*value, "Space is new word");
-            if ((*value)[len] == ' ' || (*value)[len] == '\t'
-                || (*value)[len] == '\n')
-                break;
-        }
-
-        /* always break on a ; */
-        if ((*value)[len] == ';')
-            break;
+	/* this char is escaped by the char before */
+	if ((*value)[len - 1] == '\\')
+	{
+	    len++;
+	    continue;
+	}
+
+	/* If we should break copying on a space, check this */
+	if (space_is_new_word == TRUE)
+	{
+	    DL_(*value, "Space is new word");
+	    if ((*value)[len] == ' ' || (*value)[len] == '\t'
+		|| (*value)[len] == '\n')
+		break;
+	}
+
+	/* always break on a ; */
+	if ((*value)[len] == ';')
+	    break;
 
-        len++;
+	len++;
     }
 
     /* ok, copy the code */
     if (!(to = i_strndup(*value, len)))
     {
-        FL_(*value, "Failed copying.");
-        return (FALSE);
+	FL_(*value, "Failed copying.");
+	return (FALSE);
     }
 
     /* walk forward again */

Modified: initng/trunk/plugins/last/initng_last.c
==============================================================================
--- initng/trunk/plugins/last/initng_last.c	(original)
+++ initng/trunk/plugins/last/initng_last.c	Wed Apr  5 22:57:12 2006
@@ -21,7 +21,7 @@
 
 
 #include <stdio.h>
-#include <stdlib.h>                         /* free() exit() */
+#include <stdlib.h>			    /* free() exit() */
 #include <string.h>
 #include <assert.h>
 
@@ -50,40 +50,40 @@
 
     /* And LAST is set. */
     if (!is(&LAST, service))
-        return (TRUE);
+	return (TRUE);
 
     /* ok check with all service */
     D_("LAST: walking through service db\n");
     while_active_db(current)
     {
-        /* don't check ourself */
-        if (current == service)
-            continue;
-
-        /* ignore runlevels */
-        /* TODO 20051105 SaTaN0rX: i do not know why i need to check for this */
-        /*if (current->type == &TYPE_RUNLEVEL)
-           continue; */
-
-        /* if this service also should be started last, continue */
-        if (is(&LAST, current))
-            continue;
-
-        /* TODO, use dep_on_deep */
-        /* if current need service that should be last */
-        if (initng_depend_deep(current, service) == TRUE)
-        {
-            /* don't wait, because this wait is circular */
-            D_("Service %s depends on %s\n", service->name, current->name);
-            continue;
-        }
-
-        if (IS_STARTING(current))
-        {
-            D_("Service %s is also starting, and %s should be started last\n",
-               current->name, service->name);
-            return (FALSE);
-        }
+	/* don't check ourself */
+	if (current == service)
+	    continue;
+
+	/* ignore runlevels */
+	/* TODO 20051105 SaTaN0rX: i do not know why i need to check for this */
+	/*if (current->type == &TYPE_RUNLEVEL)
+	   continue; */
+
+	/* if this service also should be started last, continue */
+	if (is(&LAST, current))
+	    continue;
+
+	/* TODO, use dep_on_deep */
+	/* if current need service that should be last */
+	if (initng_depend_deep(current, service) == TRUE)
+	{
+	    /* don't wait, because this wait is circular */
+	    D_("Service %s depends on %s\n", service->name, current->name);
+	    continue;
+	}
+
+	if (IS_STARTING(current))
+	{
+	    D_("Service %s is also starting, and %s should be started last\n",
+	       current->name, service->name);
+	    return (FALSE);
+	}
     }
 
     /* ok, finally last start this */
@@ -95,8 +95,8 @@
     D_("module_init();\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     initng_service_data_types_add(&LAST);

Modified: initng/trunk/plugins/limit/initng_limit.c
==============================================================================
--- initng/trunk/plugins/limit/initng_limit.c	(original)
+++ initng/trunk/plugins/limit/initng_limit.c	Wed Apr  5 22:57:12 2006
@@ -107,21 +107,21 @@
 {
     switch (errno)
     {
-        case EFAULT:
-            return ("Rlim prints outside the accessible address space.\n");
-        case EINVAL:
-            return ("Resource is not valid.\n");
-        case EPERM:
-            return ("Unprivileged process tried to set rlimit.\n");
-        default:
-            break;
+	case EFAULT:
+	    return ("Rlim prints outside the accessible address space.\n");
+	case EINVAL:
+	    return ("Resource is not valid.\n");
+	case EPERM:
+	    return ("Unprivileged process tried to set rlimit.\n");
+	default:
+	    break;
     }
     return (NULL);
 }
 
 /* this function set rlimit if it should, w-o overwriting old values. */
 static int set_limit(s_entry * soft, s_entry * hard, active_db_h * service,
-                     int ltype, int times)
+		     int ltype, int times)
 {
     int si = FALSE;
     int sh = FALSE;
@@ -133,41 +133,41 @@
 
     /* make sure any is set */
     if (si == FALSE && sh == FALSE)
-        return (0);
+	return (0);
 
     /* get the current limit data */
     if (getrlimit(ltype, &l) != 0)
     {
-        F_("getrlimit failed!, service %s, limit type %i: %s\n",
-           service->name, ltype, err_desc());
-        return (-1);
+	F_("getrlimit failed!, service %s, limit type %i: %s\n",
+	   service->name, ltype, err_desc());
+	return (-1);
     }
 
     D_("current: soft: %i, hard: %i\n", l.rlim_cur, l.rlim_max);
     /* if soft limit is set, get it */
     if (si)
     {
-        l.rlim_cur = (get_int(soft, service) * times);
+	l.rlim_cur = (get_int(soft, service) * times);
     }
 
     /* if hard limit is set, get it */
     if (sh)
     {
-        l.rlim_max = (get_int(hard, service) * times);
+	l.rlim_max = (get_int(hard, service) * times);
     }
 
     /* make sure hard is at least same big, but hopefully bigger. */
     if (l.rlim_cur > l.rlim_max)
-        l.rlim_max = l.rlim_cur;
+	l.rlim_max = l.rlim_cur;
 
     D_("now: soft: %i, hard: %i\n", l.rlim_cur, l.rlim_max);
 
     /* set the limit and return status */
     if (setrlimit(ltype, &l) != 0)
     {
-        F_("setrlimit failed, service: %s, limit type %i: %s\n",
-           service->name, ltype, err_desc());
-        return (-1);
+	F_("setrlimit failed, service: %s, limit type %i: %s\n",
+	   service->name, ltype, err_desc());
+	return (-1);
     }
 
     return (0);
@@ -188,30 +188,30 @@
 
     /* Handle RLIMIT_CORE */
     ret += set_limit(&RLIMIT_CORE_SOFT, &RLIMIT_CORE_HARD, s, RLIMIT_CORE,
-                     1024);
+		     1024);
 
     /* Handle RLIMIT_CPU */
     ret += set_limit(&RLIMIT_CPU_SOFT, &RLIMIT_CPU_HARD, s, RLIMIT_CPU, 1);
 
     /* Handle RLIMIT_DATA */
     ret += set_limit(&RLIMIT_DATA_SOFT, &RLIMIT_DATA_HARD, s, RLIMIT_DATA,
-                     1024);
+		     1024);
 
     /* Handle RLIMIT_FSIZE */
     ret += set_limit(&RLIMIT_FSIZE_SOFT, &RLIMIT_FSIZE_HARD, s, RLIMIT_FSIZE,
-                     1024);
+		     1024);
 
     /* Handle RLIMIT_MEMLOCK */
     ret += set_limit(&RLIMIT_MEMLOCK_SOFT, &RLIMIT_MEMLOCK_HARD, s,
-                     RLIMIT_MEMLOCK, 1024);
+		     RLIMIT_MEMLOCK, 1024);
 
     /* Handle RLIMIT_NOFILE */
     ret += set_limit(&RLIMIT_NOFILE_SOFT, &RLIMIT_NOFILE_HARD, s,
-                     RLIMIT_NOFILE, 1);
+		     RLIMIT_NOFILE, 1);
 
     /* Handle RLIMIT_NPROC */
     ret += set_limit(&RLIMIT_NPROC_SOFT, &RLIMIT_NPROC_HARD, s, RLIMIT_NPROC,
-                     1);
+		     1);
 
     /* Handle RLIMIT_RSS */
     ret += set_limit(&RLIMIT_RSS_SOFT, &RLIMIT_RSS_HARD, s, RLIMIT_RSS, 1024);
@@ -220,16 +220,16 @@
     /* for some reason, this seems missing on some systems */
     /* Handle RLIMIT_SIGPENDING */
     ret += set_limit(&RLIMIT_SIGPENDING_SOFT, &RLIMIT_SIGPENDING_HARD, s,
-                     RLIMIT_SIGPENDING, 1);
+		     RLIMIT_SIGPENDING, 1);
 #endif
 
     /* Handle RLIMIT_STACK */
     ret += set_limit(&RLIMIT_STACK_SOFT, &RLIMIT_STACK_HARD, s, RLIMIT_STACK,
-                     1024);
+		     1024);
 
     /* make sure every rlimit suceeded */
     if (ret != 0)
-        return (FALSE);
+	return (FALSE);
 
     /* return happily */
     return (TRUE);
@@ -240,8 +240,8 @@
     D_("module_init();\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     /* Add all options to initng */

Modified: initng/trunk/plugins/lockfile/initng_lockfile.c
==============================================================================
--- initng/trunk/plugins/lockfile/initng_lockfile.c	(original)
+++ initng/trunk/plugins/lockfile/initng_lockfile.c	Wed Apr  5 22:57:12 2006
@@ -47,24 +47,24 @@
     // are we under influence of lockfile?
     if (is(&LOCKFILE, service))
     {
-        char *p = strrchr(service->name, '/') + 1;
-        char lockfile[sizeof(LOCKDIR) + strlen(p)];
+	char *p = strrchr(service->name, '/') + 1;
+	char lockfile[sizeof(LOCKDIR) + strlen(p)];
 
-        strcpy(mempcpy(lockfile, LOCKDIR, sizeof(LOCKDIR) - 1), p);
+	strcpy(mempcpy(lockfile, LOCKDIR, sizeof(LOCKDIR) - 1), p);
 
-        D_("lockfile path [%s]\n", lockfile);
-        // service states from initng_is.h
-        if (IS_UP(service))
-        {
-            D_("service got up\n");
-            creat(lockfile, S_IREAD);
-
-        }
-        else if (IS_DOWN(service))
-        {
-            D_("service went down\n");
-            unlink(lockfile);
-        }
+	D_("lockfile path [%s]\n", lockfile);
+	// service states from initng_is.h
+	if (IS_UP(service))
+	{
+	    D_("service got up\n");
+	    creat(lockfile, S_IREAD);
+
+	}
+	else if (IS_DOWN(service))
+	{
+	    D_("service went down\n");
+	    unlink(lockfile);
+	}
     }
 
     return (TRUE);
@@ -75,8 +75,8 @@
     D_("module_init();\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     initng_service_data_types_add(&LOCKFILE);

Modified: initng/trunk/plugins/logfile/initng_logfile.c
==============================================================================
--- initng/trunk/plugins/logfile/initng_logfile.c	(original)
+++ initng/trunk/plugins/logfile/initng_logfile.c	Wed Apr  5 22:57:12 2006
@@ -22,7 +22,7 @@
 
 
 #include <stdio.h>
-#include <stdlib.h>                         /* free() exit() */
+#include <stdlib.h>			    /* free() exit() */
 #include <fcntl.h>
 #include <string.h>
 #include <errno.h>
@@ -39,7 +39,7 @@
 
 
 static int program_output(active_db_h * service, process_h * x,
-                          char *buffer_pos)
+			  char *buffer_pos)
 {
     const char *filename = NULL;
     char *filename_fixed = NULL;
@@ -57,8 +57,8 @@
     filename = get_string(&LOGFILE, service);
     if (!filename)
     {
-        D_("Logfile not set\n");
-        return (FALSE);
+	D_("Logfile not set\n");
+	return (FALSE);
     }
 
     /* Fix $variables in filename string */
@@ -68,8 +68,8 @@
     fd = open(filename, O_WRONLY | O_CREAT | O_APPEND);
     if (fd < 1)
     {
-        F_("Error opening %s, err : %s\n", filename, strerror(errno));
-        return (FALSE);
+	F_("Error opening %s, err : %s\n", filename, strerror(errno));
+	return (FALSE);
     }
 
     /* Write data to logfile */
@@ -77,8 +77,8 @@
     len = strlen(buffer_pos);
 
     if (write(fd, buffer_pos, len) != len)
-        F_("Error writing to %s's log, err : %s\n", service->name,
-           strerror(errno));
+	F_("Error writing to %s's log, err : %s\n", service->name,
+	   strerror(errno));
 
     free(filename_fixed);
     close(fd);
@@ -92,8 +92,8 @@
 
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     initng_service_data_types_add(&LOGFILE);

Modified: initng/trunk/plugins/netprobe/initng_netprobe.c
==============================================================================
--- initng/trunk/plugins/netprobe/initng_netprobe.c	(original)
+++ initng/trunk/plugins/netprobe/initng_netprobe.c	Wed Apr  5 22:57:12 2006
@@ -21,7 +21,7 @@
 
 
 #include <stdio.h>
-#include <stdlib.h>                         /* free() exit() */
+#include <stdlib.h>			    /* free() exit() */
 #include <string.h>
 #include <sys/stat.h>
 #include <sys/types.h>
@@ -64,8 +64,8 @@
     netsock = socket(PF_INET, SOCK_DGRAM, IPPROTO_IP);
     if (netsock < 0)
     {
-        F_("Unable to open a socket!\n");
-        return (FALSE);
+	F_("Unable to open a socket!\n");
+	return (FALSE);
     }
 
     ifc.ifc_len = sizeof(buffert);
@@ -73,8 +73,8 @@
 
     if (ioctl(netsock, SIOCGIFCONF, &ifc) < 0)
     {
-        F_("error: SIOCGIFCONF\n");
-        return (FALSE);
+	F_("error: SIOCGIFCONF\n");
+	return (FALSE);
     }
 
     /*printf("len:%i\n", ifc.ifc_len); */
@@ -83,18 +83,18 @@
     ifr = ifc.ifc_req;
 
     {
-        int i;
-        for (i = ifc.ifc_len / sizeof(struct ifreq); --i >= 0; ifr++)
-        {
-            /* Loopback is not network */
-            if (strcmp("lo", ifr->ifr_name) == 0)
-                continue;
-            /*struct ifreq i; */
-            D_("found up interface %s.\n", ifr->ifr_name);
-            close(netsock);
-            network_status = TRUE;
-            return (TRUE);
-        }
+	int i;
+	for (i = ifc.ifc_len / sizeof(struct ifreq); --i >= 0; ifr++)
+	{
+	    /* Loopback is not network */
+	    if (strcmp("lo", ifr->ifr_name) == 0)
+		continue;
+	    /*struct ifreq i; */
+	    D_("found up interface %s.\n", ifr->ifr_name);
+	    close(netsock);
+	    network_status = TRUE;
+	    return (TRUE);
+	}
 
     }
 
@@ -117,7 +117,7 @@
 
     /* The network provider should always be stoppable */
     if (is(&NETWORK_PROVIDER, service))
-        return (TRUE);
+	return (TRUE);
 
     /*
      * if there exits any service with NETWORK_PROVIDER set,
@@ -125,8 +125,8 @@
      */
     while_active_db(current)
     {
-        if (is(&NETWORK_PROVIDER, service) && (!IS_DOWN(service)))
-            return (FALSE);
+	if (is(&NETWORK_PROVIDER, service) && (!IS_DOWN(service)))
+	    return (FALSE);
     }
     return (TRUE);
 }
@@ -135,7 +135,7 @@
 {
     /* only apply if service requires network */
     if (!is(&REQUIRE_NETWORK, service))
-        return (TRUE);
+	return (TRUE);
 
     D_("Doing check because REQURE_NETWORK is set.\n");
 
@@ -148,8 +148,8 @@
 
     while_active_db(current)
     {
-        if (is(&NETWORK_PROVIDER, current) && IS_UP(current))
-            goto ok;
+	if (is(&NETWORK_PROVIDER, current) && IS_UP(current))
+	    goto ok;
     }
     /* Don't set sleep 1, because initng will be interrupted when a
      * service changes state anyway.
@@ -169,14 +169,14 @@
     /* only do this check once every mainloop */
     if (last_check != g.now.tv_sec)
     {
-        network_status = is_network();
-        D_("Network status = %s\n",
-           network_status == TRUE ? "TRUE" : "FALSE");
+	network_status = is_network();
+	D_("Network status = %s\n",
+	   network_status == TRUE ? "TRUE" : "FALSE");
     }
     last_check = g.now.tv_sec;
 
     if (network_status == TRUE)
-        return (TRUE);
+	return (TRUE);
 
     /* Make sure mainloop will run within 1 second. */
     initng_global_set_sleep(1);
@@ -189,8 +189,8 @@
     S_;
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     initng_service_data_types_add(&REQUIRE_NETWORK);

Modified: initng/trunk/plugins/ngc4/initng_ngc4.c
==============================================================================
--- initng/trunk/plugins/ngc4/initng_ngc4.c	(original)
+++ initng/trunk/plugins/ngc4/initng_ngc4.c	Wed Apr  5 22:57:12 2006
@@ -92,8 +92,8 @@
 
     list_for_each_entry_prev(current, &local_commands_db.list, list)
     {
-        if (current->command_id == cid)
-            return (current);
+	if (current->command_id == cid)
+	    return (current);
     }
     return (NULL);
 }
@@ -104,8 +104,8 @@
 
     list_for_each_entry_prev(current, &local_commands_db.list, list)
     {
-        if (current->long_id && strcmp(current->long_id, name) == 0)
-            return (current);
+	if (current->long_id && strcmp(current->long_id, name) == 0)
+	    return (current);
     }
     return (NULL);
 }
@@ -115,7 +115,7 @@
 {
     /* Check if we need to remove hooks */
     if (fdh.fds < 0)
-        return;
+	return;
     D_("closesock %d\n", fdh.fds);
 
     /* close socket and set to 0 */
@@ -138,8 +138,8 @@
     reload = initng_command_find_by_command_id('c');
     if (reload && reload->u.void_command_call)
     {
-        /* call the reload call in that s_command */
-        (*reload->u.void_command_call) (NULL);
+	/* call the reload call in that s_command */
+	(*reload->u.void_command_call) (NULL);
     }
 }
 
@@ -150,7 +150,7 @@
     void *header_data = NULL;
     ssize_t sent = 0;
 
-    s_command *tmp_cmd;         /* temporary storage for a command */
+    s_command *tmp_cmd;		/* temporary storage for a command */
 
     assert(fd > 0);
 
@@ -158,17 +158,17 @@
 
     /* use file descriptor, because fread hangs here? */
     if (TEMP_FAILURE_RETRY(recv(fd, &header, sizeof(read_header), 0)) <
-        (signed) sizeof(read_header))
+	(signed) sizeof(read_header))
     {
-        F_("Could not read header.\n");
-        return;
+	F_("Could not read header.\n");
+	return;
     }
 
     if (header.p_ver != PROTOCOL_4_VERSION)
     {
-        F_("ngc protcol_version miss-match, server_protocol_version :%i, client_protocol_version :%i !\n Will try to hot-reload initng.", PROTOCOL_4_VERSION, header.p_ver);
-        initng_reload();
-        return;
+	F_("ngc protcol_version miss-match, server_protocol_version :%i, client_protocol_version :%i !\n Will try to hot-reload initng.", PROTOCOL_4_VERSION, header.p_ver);
+	initng_reload();
+	return;
     }
 
     header.l[100] = '\0';
@@ -176,31 +176,31 @@
        header.l, header.p_ver);
     if (header.body_len > 0)
     {
-        D_("There is a body to read!\n");
-        header_data = i_calloc(1, header.body_len + 1);
-        if (!header_data)
-        {
-            F_("Could not allocate memory for header_data\n");
-            return;
-        }
-
-        /* yost so ngc got a chance to fill header_data again */
-        usleep(10);
-
-        if (TEMP_FAILURE_RETRY(recv(fd, header_data, header.body_len, 0)) <
-            (signed) header.body_len)
-        {
-            F_("Could not read header_data\n");
-            if (header_data)
-                free(header_data);
-            return;
-        }
+	D_("There is a body to read!\n");
+	header_data = i_calloc(1, header.body_len + 1);
+	if (!header_data)
+	{
+	    F_("Could not allocate memory for header_data\n");
+	    return;
+	}
+
+	/* yost so ngc got a chance to fill header_data again */
+	usleep(10);
+
+	if (TEMP_FAILURE_RETRY(recv(fd, header_data, header.body_len, 0)) <
+	    (signed) header.body_len)
+	{
+	    F_("Could not read header_data\n");
+	    if (header_data)
+		free(header_data);
+	    return;
+	}
     }
 
     /* allocate space for the result we will send */
     result = i_calloc(1, sizeof(result_desc));
     if (!result)
-        return;
+	return;
 
     /* set version */
     strncpy(result->version, INITNG_VERSION, 100);
@@ -209,85 +209,85 @@
     /* ping check : */
     if (header.c == 'X')
     {
-        result->c = 'Y';
-        result->t = VOID_COMMAND;
-        result->s = S_TRUE;
-        result->payload = 0;
-        D_("Ping received, sending pong\n");
-        send(fd, result, sizeof(result_desc), 0);
-        if (header_data)
-            free(header_data);
-        if (result)
-            free(result);
-        return;
+	result->c = 'Y';
+	result->t = VOID_COMMAND;
+	result->s = S_TRUE;
+	result->payload = 0;
+	D_("Ping received, sending pong\n");
+	send(fd, result, sizeof(result_desc), 0);
+	if (header_data)
+	    free(header_data);
+	if (result)
+	    free(result);
+	return;
     }
 
     /* Find the command requesting in the command database */
-    if (header.c)                           /* find by short opt */
+    if (header.c)			    /* find by short opt */
     {
-        /* first search in the local db */
-        tmp_cmd = lfbc(header.c);
-        if (!tmp_cmd)
-            tmp_cmd = initng_command_find_by_command_id(header.c);
-    }
-    else if (header.l)                      /* find by long opt */
-    {
-        /* first search in the local db */
-        tmp_cmd = lfbs(header.l);
-        if (!tmp_cmd)
-            tmp_cmd = initng_command_find_by_command_string(header.l);
+	/* first search in the local db */
+	tmp_cmd = lfbc(header.c);
+	if (!tmp_cmd)
+	    tmp_cmd = initng_command_find_by_command_id(header.c);
+    }
+    else if (header.l)			    /* find by long opt */
+    {
+	/* first search in the local db */
+	tmp_cmd = lfbs(header.l);
+	if (!tmp_cmd)
+	    tmp_cmd = initng_command_find_by_command_string(header.l);
     }
     else
     {
-        if (header_data)
-            free(header_data);
-        if (result)
-            free(result);
-        return;
+	if (header_data)
+	    free(header_data);
+	if (result)
+	    free(result);
+	return;
     }
 
     /* Make sure the command we got is valid, else return an bad result */
     if (!tmp_cmd || tmp_cmd->com_type == 0)
     {
-        D_("command type '%c', long \"%s\"\n", header.c, header.l);
-        result->c = header.c;
-        result->t = COMMAND_FAIL;
-        result->payload = 0;
-        result->s = S_COMMAND_NOT_FOUND;
-        send(fd, result, sizeof(result_desc), 0);
-        if (header_data)
-            free(header_data);
-        if (result)
-            free(result);
-        return;
+	D_("command type '%c', long \"%s\"\n", header.c, header.l);
+	result->c = header.c;
+	result->t = COMMAND_FAIL;
+	result->payload = 0;
+	result->s = S_COMMAND_NOT_FOUND;
+	send(fd, result, sizeof(result_desc), 0);
+	if (header_data)
+	    free(header_data);
+	if (result)
+	    free(result);
+	return;
     }
 
     /* check if command requires option, and option is not set */
     if (tmp_cmd->opt_type == REQUIRES_OPT && header.body_len < 1)
     {
-        D_("Command %c - %s, requires an option!\n", header.c, header.l);
-        result->c = header.c;
-        result->t = COMMAND_FAIL;
-        result->payload = 0;
-        result->s = S_REQUIRES_OPT;
-        send(fd, result, sizeof(result_desc), 0);
-        if (header_data)
-            free(header_data);
-        return;
+	D_("Command %c - %s, requires an option!\n", header.c, header.l);
+	result->c = header.c;
+	result->t = COMMAND_FAIL;
+	result->payload = 0;
+	result->s = S_REQUIRES_OPT;
+	send(fd, result, sizeof(result_desc), 0);
+	if (header_data)
+	    free(header_data);
+	return;
     }
 
     /* check if command is not using and option, and option is set */
     if (tmp_cmd->opt_type == NO_OPT && header.body_len > 0)
     {
-        D_("Command %c - %s, don't want an option!\n", header.c, header.l);
-        result->c = header.c;
-        result->t = COMMAND_FAIL;
-        result->payload = 0;
-        result->s = S_NOT_REQUIRES_OPT;
-        send(fd, result, sizeof(result_desc), 0);
-        if (header_data)
-            free(header_data);
-        return;
+	D_("Command %c - %s, don't want an option!\n", header.c, header.l);
+	result->c = header.c;
+	result->t = COMMAND_FAIL;
+	result->payload = 0;
+	result->s = S_NOT_REQUIRES_OPT;
+	send(fd, result, sizeof(result_desc), 0);
+	if (header_data)
+	    free(header_data);
+	return;
     }
 
     /* set the result statics. */
@@ -297,181 +297,181 @@
     switch (tmp_cmd->com_type)
     {
 
-        case TRUE_OR_FALSE_COMMAND:
-        case INT_COMMAND:
-            {
-                int ret = 0;
-
-                assert(tmp_cmd->u.int_command_call);
-                D_("Calling an int or true or false command.\n");
-
-                /* execute command */
-                ret = (int) (*tmp_cmd->u.
-                             int_command_call) ((char *) header_data);
-
-                /* Write a header respond */
-                result->s = S_TRUE;
-                result->payload = sizeof(int);
-
-                /* send the result */
-                if ((sent =
-                     send(fd, result, sizeof(result_desc),
-                          0)) != sizeof(result_desc))
-                {
-                    F_("failed to send result, sent: %i of %i.\n", sent,
-                       sizeof(result_desc));
-                    break;
-                }
-
-                /* send the payload */
-                if ((sent =
-                     send(fd, &ret, result->payload,
-                          0)) != (signed) result->payload)
-                {
-                    F_("Could not send complete payload, sent %i of %i.",
-                       sent, result->payload);
-                    break;
-                }
-                break;
-            }
-        case STRING_COMMAND:
-            {
-                char *send_buf = NULL;
-
-                assert(tmp_cmd->u.string_command_call);
-                D_("Calling an string command.\n");
-
-                /* execute command */
-                send_buf = (*tmp_cmd->u.
-                            string_command_call) ((char *) header_data);
-                if (!send_buf)
-                    break;
-
-                /* write an header respond */
-                result->s = S_TRUE;
-                result->payload = strlen(send_buf) * sizeof(char);
-
-                /* send the result */
-                if ((sent =
-                     send(fd, result, sizeof(result_desc),
-                          0)) != sizeof(result_desc))
-                {
-                    F_("failed to send result, sent: %i of %i.\n", sent,
-                       sizeof(result_desc));
-                    break;
-                }
-                /* send the payload */
-                if ((sent =
-                     send(fd, send_buf, result->payload,
-                          0)) != (signed) result->payload)
-                {
-                    F_("Could not send complete payload, sent %i of %i.",
-                       sent, result->payload);
-                    break;
-                }
-
-                /* free and clear */
-                free(send_buf);
-                break;
-            }
-        case VOID_COMMAND:
-            {
-                assert(tmp_cmd->u.void_command_call);
-                D_("Calling a void command!\n");
-
-                /* execute command */
-                (*tmp_cmd->u.void_command_call) ((char *) header_data);
-
-                /* write an header respond */
-                result->s = S_TRUE;
-                result->payload = 0;        /* unknown payload size here, TODO FIX THIS */
-
-                /* sent result */
-                if ((sent =
-                     send(fd, result, sizeof(result_desc),
-                          0)) != sizeof(result_desc))
-                {
-                    F_("failed to send result, sent: %i of %i.\n", sent,
-                       sizeof(result_desc));
-                    break;
-                }
-                break;
-            }
-        case PAYLOAD_COMMAND:
-        case DATA_COMMANDS_ROW:
-        case DATA_ACTIVE_ROW:
-        case DATA_OPTION_ROW:
-            {
-                /* iniziate a data payload variable */
-                s_payload payload;
-
-                /* clear payload */
-                memset(&payload, 0, sizeof(s_payload));
-
-                assert(tmp_cmd->u.data_command_call);
-                D_("Calling an data_command.\n");
-
-                /* execute command */
-                (*tmp_cmd->u.data_command_call) ((char *) header_data,
-                                                 &payload);
-
-
-                /* write an header respond */
-                result->s = S_TRUE;
-                result->payload = payload.s;
-
-                /* send the result */
-                if ((sent =
-                     send(fd, result, sizeof(result_desc),
-                          0)) != sizeof(result_desc))
-                {
-                    F_("failed to send result, sent: %i of %i.\n", sent,
-                       sizeof(result_desc));
-                    break;
-                }
-
-                /* with out this, the client wont get the 2ond send. WHY? */
-                usleep(1);
-
-                /* send the payload */
-                D_("Sending a payload of %i bytes.\n", result->payload);
-                if ((sent =
-                     send(fd, payload.p, result->payload,
-                          0)) != (signed) result->payload)
-                {
-                    F_("Could not send complete payload, sent %i of %i.",
-                       sent, result->payload);
-                    break;
-                }
-
-                /* cleanup and free */
-                free(payload.p);
-                break;
-            }
-        case COMMAND_FAIL:
-
-            /* return FAIL header respond */
-            result->s = S_INVALID_TYPE;
-            if ((sent =
-                 send(fd, result, sizeof(result_desc),
-                      0)) != (signed) sizeof(result_desc))
-            {
-                F_("failed to send result, sent: %i of %i.\n", sent,
-                   sizeof(result_desc));
-                break;
-            }
-            /* TODO: really continue?? */
-
-            D_("Invalid command type '%c', line '%s'\n", header.c, header.l);
-            if (header_data)
-                free(header_data);
-            return;
+	case TRUE_OR_FALSE_COMMAND:
+	case INT_COMMAND:
+	    {
+		int ret = 0;
+
+		assert(tmp_cmd->u.int_command_call);
+		D_("Calling an int or true or false command.\n");
+
+		/* execute command */
+		ret = (int) (*tmp_cmd->u.
+			     int_command_call) ((char *) header_data);
+
+		/* Write a header respond */
+		result->s = S_TRUE;
+		result->payload = sizeof(int);
+
+		/* send the result */
+		if ((sent =
+		     send(fd, result, sizeof(result_desc),
+			  0)) != sizeof(result_desc))
+		{
+		    F_("failed to send result, sent: %i of %i.\n", sent,
+		       sizeof(result_desc));
+		    break;
+		}
+
+		/* send the payload */
+		if ((sent =
+		     send(fd, &ret, result->payload,
+			  0)) != (signed) result->payload)
+		{
+		    F_("Could not send complete payload, sent %i of %i.",
+		       sent, result->payload);
+		    break;
+		}
+		break;
+	    }
+	case STRING_COMMAND:
+	    {
+		char *send_buf = NULL;
+
+		assert(tmp_cmd->u.string_command_call);
+		D_("Calling an string command.\n");
+
+		/* execute command */
+		send_buf = (*tmp_cmd->u.
+			    string_command_call) ((char *) header_data);
+		if (!send_buf)
+		    break;
+
+		/* write an header respond */
+		result->s = S_TRUE;
+		result->payload = strlen(send_buf) * sizeof(char);
+
+		/* send the result */
+		if ((sent =
+		     send(fd, result, sizeof(result_desc),
+			  0)) != sizeof(result_desc))
+		{
+		    F_("failed to send result, sent: %i of %i.\n", sent,
+		       sizeof(result_desc));
+		    break;
+		}
+		/* send the payload */
+		if ((sent =
+		     send(fd, send_buf, result->payload,
+			  0)) != (signed) result->payload)
+		{
+		    F_("Could not send complete payload, sent %i of %i.",
+		       sent, result->payload);
+		    break;
+		}
+
+		/* free and clear */
+		free(send_buf);
+		break;
+	    }
+	case VOID_COMMAND:
+	    {
+		assert(tmp_cmd->u.void_command_call);
+		D_("Calling a void command!\n");
+
+		/* execute command */
+		(*tmp_cmd->u.void_command_call) ((char *) header_data);
+
+		/* write an header respond */
+		result->s = S_TRUE;
+		result->payload = 0;	    /* unknown payload size here, TODO FIX THIS */
+
+		/* sent result */
+		if ((sent =
+		     send(fd, result, sizeof(result_desc),
+			  0)) != sizeof(result_desc))
+		{
+		    F_("failed to send result, sent: %i of %i.\n", sent,
+		       sizeof(result_desc));
+		    break;
+		}
+		break;
+	    }
+	case PAYLOAD_COMMAND:
+	case DATA_COMMANDS_ROW:
+	case DATA_ACTIVE_ROW:
+	case DATA_OPTION_ROW:
+	    {
+		/* iniziate a data payload variable */
+		s_payload payload;
+
+		/* clear payload */
+		memset(&payload, 0, sizeof(s_payload));
+
+		assert(tmp_cmd->u.data_command_call);
+		D_("Calling an data_command.\n");
+
+		/* execute command */
+		(*tmp_cmd->u.data_command_call) ((char *) header_data,
+						 &payload);
+
+
+		/* write an header respond */
+		result->s = S_TRUE;
+		result->payload = payload.s;
+
+		/* send the result */
+		if ((sent =
+		     send(fd, result, sizeof(result_desc),
+			  0)) != sizeof(result_desc))
+		{
+		    F_("failed to send result, sent: %i of %i.\n", sent,
+		       sizeof(result_desc));
+		    break;
+		}
+
+		/* with out this, the client wont get the 2ond send. WHY? */
+		usleep(1);
+
+		/* send the payload */
+		D_("Sending a payload of %i bytes.\n", result->payload);
+		if ((sent =
+		     send(fd, payload.p, result->payload,
+			  0)) != (signed) result->payload)
+		{
+		    F_("Could not send complete payload, sent %i of %i.",
+		       sent, result->payload);
+		    break;
+		}
+
+		/* cleanup and free */
+		free(payload.p);
+		break;
+	    }
+	case COMMAND_FAIL:
+
+	    /* return FAIL header respond */
+	    result->s = S_INVALID_TYPE;
+	    if ((sent =
+		 send(fd, result, sizeof(result_desc),
+		      0)) != (signed) sizeof(result_desc))
+	    {
+		F_("failed to send result, sent: %i of %i.\n", sent,
+		   sizeof(result_desc));
+		break;
+	    }
+	    /* TODO: really continue?? */
+
+	    D_("Invalid command type '%c', line '%s'\n", header.c, header.l);
+	    if (header_data)
+		free(header_data);
+	    return;
     }
     D_("Returned successfully.\n");
     if (header_data)
-        free(header_data);
+	free(header_data);
     if (result)
-        free(result);
+	free(result);
     return;
 }
 
@@ -483,7 +483,7 @@
 
     /* make a dumb check */
     if (from != &fdh)
-        return;
+	return;
 
     D_("Got here from fd hook.\n");
     /* we try to fix socket after every service start
@@ -491,35 +491,35 @@
        up, and we shouldn't manually try to fix anything. */
     if (fdh.fds <= 0)
     {
-        /* socket is invalid but we were called, call closesocket to make sure it wont happen again */
-        F_("accepted client called with fdh.fds %d, report bug\n", fdh.fds);
-        closesock();
-        F_("Attempting to reopen socket\n");
-        open_socket();
-        return;
+	/* socket is invalid but we were called, call closesocket to make sure it wont happen again */
+	F_("accepted client called with fdh.fds %d, report bug\n", fdh.fds);
+	closesock();
+	F_("Attempting to reopen socket\n");
+	open_socket();
+	return;
     }
 
     /* create a new socket, for reading */
     if ((newsock = accept(fdh.fds, NULL, NULL)) > 0)
     {
-        /*file_sock = fdopen(newsock, "r+");
-           D_("read socket open, now reading\n"); */
+	/*file_sock = fdopen(newsock, "r+");
+	   D_("read socket open, now reading\n"); */
 
-        /* read the data, by the handle_client function */
-        handle_client(newsock);
+	/* read the data, by the handle_client function */
+	handle_client(newsock);
 
-        /*close(newsock); */
-        /*  clean up, and return
-           fclose(file_sock); */
-        D_("Success!\n");
-        return;
+	/*close(newsock); */
+	/*  clean up, and return
+	   fclose(file_sock); */
+	D_("Success!\n");
+	return;
     }
 
     /* temporary unavailable */
     if ((errno == EAGAIN) || (errno == EWOULDBLOCK))
     {
-        W_("errno = EAGAIN!\n");
-        return;
+	W_("errno = EAGAIN!\n");
+	return;
     }
 
     /* This'll generally happen on shutdown, don't cry about it. */
@@ -546,8 +546,8 @@
     client = socket(PF_UNIX, SOCK_STREAM, 0);
     if (client < 0)
     {
-        F_("Failed to init socket\n");
-        return FALSE;
+	F_("Failed to init socket\n");
+	return FALSE;
     }
 
     /* Bind a name to the socket. */
@@ -557,11 +557,11 @@
 
     /* Try to connect */
     if (connect
-        (client, (struct sockaddr *) &sockname,
-         (strlen(sockname.sun_path) + sizeof(sockname.sun_family))) < 0)
+	(client, (struct sockaddr *) &sockname,
+	 (strlen(sockname.sun_path) + sizeof(sockname.sun_family))) < 0)
     {
-        close(client);
-        return FALSE;
+	close(client);
+	return FALSE;
     }
 
     /* Write X to ping ourselves */
@@ -571,11 +571,11 @@
 
     D_("Sending PING..\n");
     if (write(client, &header, sizeof(read_header)) <
-        (signed) sizeof(read_header))
+	(signed) sizeof(read_header))
     {
-        F_("Unable to send PING!\n");
-        close(client);
-        return (FALSE);
+	F_("Unable to send PING!\n");
+	close(client);
+	return (FALSE);
     }
     D_("PING sent..\n");
 
@@ -584,12 +584,12 @@
 
     D_("Reading PONG..\n");
     if ((read(client, &result, sizeof(result_desc)) <
-         (signed) sizeof(result_desc)) || result.c != 'Y'
-        || result.s != S_TRUE)
+	 (signed) sizeof(result_desc)) || result.c != 'Y'
+	|| result.s != S_TRUE)
     {
-        F_("Unable to receive PONG!\n");
-        close(client);
-        return (FALSE);
+	F_("Unable to receive PONG!\n");
+	close(client);
+	return (FALSE);
     }
 
     D_("Got pong\n");
@@ -609,33 +609,33 @@
 
     /* Make /dev/initng if it doesn't exist (try either way) */
     if (mkdir(SOCKET_4_ROOTPATH, S_IRUSR | S_IWUSR | S_IXUSR) == -1
-        && errno != EEXIST)
+	&& errno != EEXIST)
     {
-        if (errno != EROFS)
-            F_("Could not create " SOCKET_4_ROOTPATH
-               " : %s, may be / fs not mounted read-write yet?, will retry until I succeed.\n",
-               strerror(errno));
-        return (FALSE);
+	if (errno != EROFS)
+	    F_("Could not create " SOCKET_4_ROOTPATH
+	       " : %s, may be / fs not mounted read-write yet?, will retry until I succeed.\n",
+	       strerror(errno));
+	return (FALSE);
     }
 
     /* chmod root path for root use only */
     if (chmod(SOCKET_4_ROOTPATH, S_IRUSR | S_IWUSR | S_IXUSR) == -1)
     {
-        /* path doesn't exist, we don't have /dev yet. */
-        if (errno == ENOENT || errno == EROFS)
-            return (FALSE);
+	/* path doesn't exist, we don't have /dev yet. */
+	if (errno == ENOENT || errno == EROFS)
+	    return (FALSE);
 
-        F_("CRITICAL, failed to chmod %s, THIS IS A SECURITY PROBLEM.\n",
-           SOCKET_4_ROOTPATH);
+	F_("CRITICAL, failed to chmod %s, THIS IS A SECURITY PROBLEM.\n",
+	   SOCKET_4_ROOTPATH);
     }
 
     /* Create the socket. */
     fdh.fds = socket(PF_UNIX, SOCK_STREAM, 0);
     if (fdh.fds < 1)
     {
-        F_("Failed to init socket (%s)\n", strerror(errno));
-        fdh.fds = -1;
-        return (FALSE);
+	F_("Failed to init socket (%s)\n", strerror(errno));
+	fdh.fds = -1;
+	return (FALSE);
     }
 
     /* Set socket to non blocking mode */
@@ -665,24 +665,24 @@
 
     /* Try to bind */
     if (bind
-        (fdh.fds, (struct sockaddr *) &serv_sockname,
-         (strlen(serv_sockname.sun_path) +
-          sizeof(serv_sockname.sun_family))) < 0)
-    {
-        F_("Error binding to socket (errno: %d str: '%s')\n", errno,
-           strerror(errno));
-        closesock();
-        unlink(serv_sockname.sun_path);
-        return (FALSE);
+	(fdh.fds, (struct sockaddr *) &serv_sockname,
+	 (strlen(serv_sockname.sun_path) +
+	  sizeof(serv_sockname.sun_family))) < 0)
+    {
+	F_("Error binding to socket (errno: %d str: '%s')\n", errno,
+	   strerror(errno));
+	closesock();
+	unlink(serv_sockname.sun_path);
+	return (FALSE);
     }
 
     /* chmod socket for root only use */
     if (chmod(serv_sockname.sun_path, S_IRUSR | S_IWUSR) == -1)
     {
-        F_("CRITICAL, failed to chmod %s, THIS IS A SECURITY PROBLEM.\n",
-           serv_sockname.sun_path);
-        closesock();
-        return (FALSE);
+	F_("CRITICAL, failed to chmod %s, THIS IS A SECURITY PROBLEM.\n",
+	   serv_sockname.sun_path);
+	closesock();
+	return (FALSE);
     }
 
     /* store sock_stat for checking if we need to recreate socket later */
@@ -691,10 +691,10 @@
     /* Listen to socket */
     if (listen(fdh.fds, 5))
     {
-        F_("Error on listen (errno: %d str: '%s')\n", errno, strerror(errno));
-        closesock();
-        unlink(serv_sockname.sun_path);
-        return (FALSE);
+	F_("Error on listen (errno: %d str: '%s')\n", errno, strerror(errno));
+	closesock();
+	unlink(serv_sockname.sun_path);
+	return (FALSE);
     }
 
 
@@ -702,9 +702,9 @@
     /* Run check : */
     if (!sendping())
     {
-        F_("Sendping check failed, ngc2 communication not available (if you see this open a bug)\n");
-        closesock();
-        return (FALSE);
+	F_("Sendping check failed, ngc2 communication not available (if you see this open a bug)\n");
+	closesock();
+	return (FALSE);
     }
 
     return (TRUE);
@@ -716,34 +716,34 @@
     struct stat st;
 
     if (signal != SIGHUP)
-        return;
+	return;
 
     D_("Checking socket\n");
 
     /* Check if socket needs reopening */
     if (fdh.fds <= 0)
     {
-        D_("fdh.fds not set, opening new socket.\n");
-        open_socket();
-        return;
+	D_("fdh.fds not set, opening new socket.\n");
+	open_socket();
+	return;
     }
 
     /* stat the socket, reopen on failure */
     memset(&st, 0, sizeof(st));
     if (stat(socket_filename, &st) < 0)
     {
-        W_("Stat failed! Opening new socket.\n");
-        open_socket();
-        return;
+	W_("Stat failed! Opening new socket.\n");
+	open_socket();
+	return;
     }
 
     /* compare socket file, with the one that we know, reopen on failure */
     if (st.st_dev != sock_stat.st_dev || st.st_ino != sock_stat.st_ino
-        || st.st_mtime != sock_stat.st_mtime)
+	|| st.st_mtime != sock_stat.st_mtime)
     {
-        F_("Invalid socket found, reopening\n");
-        open_socket();
-        return;
+	F_("Invalid socket found, reopening\n");
+	open_socket();
+	return;
     }
 
     D_("Socket ok.\n");
@@ -766,54 +766,54 @@
 
     list_for_each_entry_prev(current, &local_commands_db.list, list)
     {
-        help_row *row = payload->p + (i * sizeof(help_row));
+	help_row *row = payload->p + (i * sizeof(help_row));
 
-        if (current->opt_vissible != STANDARD_COMMAND)
-            continue;
+	if (current->opt_vissible != STANDARD_COMMAND)
+	    continue;
 
-        row->c = current->command_id;
-        row->t = current->com_type;
-        row->o = current->opt_type;
-
-        /* copy description */
-        if (current->description)
-            strncpy(row->d, current->description, 200);
-        else
-            row->d[0] = '\0';
-
-        /* copy long id */
-        if (current->long_id)
-            strncpy(row->l, current->long_id, 100);
-        else
-            row->l[0] = '\0';
+	row->c = current->command_id;
+	row->t = current->com_type;
+	row->o = current->opt_type;
+
+	/* copy description */
+	if (current->description)
+	    strncpy(row->d, current->description, 200);
+	else
+	    row->d[0] = '\0';
+
+	/* copy long id */
+	if (current->long_id)
+	    strncpy(row->l, current->long_id, 100);
+	else
+	    row->l[0] = '\0';
 
-        i++;
+	i++;
     }
     current = NULL;
     while_command_db(current)
     {
-        help_row *row = payload->p + (i * sizeof(help_row));
+	help_row *row = payload->p + (i * sizeof(help_row));
 
-        if (current->opt_vissible != STANDARD_COMMAND)
-            continue;
+	if (current->opt_vissible != STANDARD_COMMAND)
+	    continue;
 
-        row->c = current->command_id;
-        row->t = current->com_type;
-        row->o = current->opt_type;
-
-        /* copy description */
-        if (current->description)
-            strncpy(row->d, current->description, 200);
-        else
-            row->d[0] = '\0';
-
-        /* copy long id */
-        if (current->long_id)
-            strncpy(row->l, current->long_id, 100);
-        else
-            row->l[0] = '\0';
+	row->c = current->command_id;
+	row->t = current->com_type;
+	row->o = current->opt_type;
+
+	/* copy description */
+	if (current->description)
+	    strncpy(row->d, current->description, 200);
+	else
+	    row->d[0] = '\0';
+
+	/* copy long id */
+	if (current->long_id)
+	    strncpy(row->l, current->long_id, 100);
+	else
+	    row->l[0] = '\0';
 
-        i++;
+	i++;
     }
 
     /* set up the payload info */
@@ -834,53 +834,53 @@
 
     list_for_each_entry_prev(current, &local_commands_db.list, list)
     {
-        help_row *row = payload->p + (i * sizeof(help_row));
+	help_row *row = payload->p + (i * sizeof(help_row));
 
-        if (current->opt_vissible != STANDARD_COMMAND
-            && current->opt_vissible != ADVANCHED_COMMAND)
-            continue;
-
-        row->c = current->command_id;
-        row->t = current->com_type;
-        row->o = current->opt_type;
-        /* copy description */
-        if (current->description)
-            strncpy(row->d, current->description, 200);
-        else
-            row->d[0] = '\0';
-
-        /* copy long id */
-        if (current->long_id)
-            strncpy(row->l, current->long_id, 100);
-        else
-            row->l[0] = '\0';
-        i++;
+	if (current->opt_vissible != STANDARD_COMMAND
+	    && current->opt_vissible != ADVANCHED_COMMAND)
+	    continue;
+
+	row->c = current->command_id;
+	row->t = current->com_type;
+	row->o = current->opt_type;
+	/* copy description */
+	if (current->description)
+	    strncpy(row->d, current->description, 200);
+	else
+	    row->d[0] = '\0';
+
+	/* copy long id */
+	if (current->long_id)
+	    strncpy(row->l, current->long_id, 100);
+	else
+	    row->l[0] = '\0';
+	i++;
     }
 
     current = NULL;
     while_command_db(current)
     {
-        help_row *row = payload->p + (i * sizeof(help_row));
+	help_row *row = payload->p + (i * sizeof(help_row));
 
-        if (current->opt_vissible != STANDARD_COMMAND
-            && current->opt_vissible != ADVANCHED_COMMAND)
-            continue;
-
-        row->c = current->command_id;
-        row->t = current->com_type;
-        row->o = current->opt_type;
-        /* copy description */
-        if (current->description)
-            strncpy(row->d, current->description, 200);
-        else
-            row->d[0] = '\0';
-
-        /* copy long id */
-        if (current->long_id)
-            strncpy(row->l, current->long_id, 100);
-        else
-            row->l[0] = '\0';
-        i++;
+	if (current->opt_vissible != STANDARD_COMMAND
+	    && current->opt_vissible != ADVANCHED_COMMAND)
+	    continue;
+
+	row->c = current->command_id;
+	row->t = current->com_type;
+	row->o = current->opt_type;
+	/* copy description */
+	if (current->description)
+	    strncpy(row->d, current->description, 200);
+	else
+	    row->d[0] = '\0';
+
+	/* copy long id */
+	if (current->long_id)
+	    strncpy(row->l, current->long_id, 100);
+	else
+	    row->l[0] = '\0';
+	i++;
     }
 
     /* set up the payload info */
@@ -899,47 +899,47 @@
     /* argument required */
     if (!arg || strlen(arg) < 2)
     {
-        strcpy(row->state, "NOT_FOUND");
-        row->is = IS_FAILED;
-        return;
+	strcpy(row->state, "NOT_FOUND");
+	row->is = IS_FAILED;
+	return;
     }
 
     /* Find the service in the db */
     serv = initng_active_db_find_by_name(arg);
     if (serv)
     {
-        memcpy(&row->time_set, &serv->time_current_state,
-               sizeof(struct timeval));
-        strncpy(row->name, serv->name, 100);
-        if (IS_UP(serv))
-        {
-            /* set status == ALREADY_RUNNING */
-            strcpy(row->state, "ALREADY_RUNNING");
-        }
-        else
-        {
-            /* Try start this service */
-            initng_handler_start_service(serv);
-            /* set current status instead */
-            strncpy(row->state, serv->current_state->state_name, 100);
-        }
-
-        /* the routh state */
-        row->is = serv->current_state->is;
-
-        /* Copy service type name */
-        if (serv->type && serv->type->name)
-            strncpy(row->type, serv->type->name, 100);
-        return;
+	memcpy(&row->time_set, &serv->time_current_state,
+	       sizeof(struct timeval));
+	strncpy(row->name, serv->name, 100);
+	if (IS_UP(serv))
+	{
+	    /* set status == ALREADY_RUNNING */
+	    strcpy(row->state, "ALREADY_RUNNING");
+	}
+	else
+	{
+	    /* Try start this service */
+	    initng_handler_start_service(serv);
+	    /* set current status instead */
+	    strncpy(row->state, serv->current_state->state_name, 100);
+	}
+
+	/* the routh state */
+	row->is = serv->current_state->is;
+
+	/* Copy service type name */
+	if (serv->type && serv->type->name)
+	    strncpy(row->type, serv->type->name, 100);
+	return;
     }
 
     serv = initng_handler_start_new_service_named(arg);
     if (!serv)
     {
-        strncpy(row->name, arg, 100);
-        strcpy(row->state, "NOT_FOUND");
-        row->is = IS_FAILED;
-        return;
+	strncpy(row->name, arg, 100);
+	strcpy(row->state, "NOT_FOUND");
+	row->is = IS_FAILED;
+	return;
     }
 
     memcpy(&row->time_set, &serv->time_current_state, sizeof(struct timeval));
@@ -947,11 +947,11 @@
 
     if (serv->current_state && serv->current_state->state_name)
     {
-        row->is = serv->current_state->is;
-        strncpy(row->state, serv->current_state->state_name, 100);
-        /* Copy service type name */
-        if (serv->type && serv->type->name)
-            strncpy(row->type, serv->type->name, 100);
+	row->is = serv->current_state->is;
+	strncpy(row->state, serv->current_state->state_name, 100);
+	/* Copy service type name */
+	if (serv->type && serv->type->name)
+	    strncpy(row->type, serv->type->name, 100);
     }
 }
 
@@ -967,19 +967,19 @@
     /* argument required */
     if (!arg || strlen(arg) < 2)
     {
-        strcpy(row->name, "UNSET");
-        strcpy(row->state, "NOT_FOUND");
-        row->is = IS_FAILED;
-        return;
+	strcpy(row->name, "UNSET");
+	strcpy(row->state, "NOT_FOUND");
+	row->is = IS_FAILED;
+	return;
     }
 
     serv = initng_active_db_find_in_name(arg);
     if (!serv)
     {
-        strncpy(row->name, arg, 100);
-        strcpy(row->state, "NOT_FOUND");
-        row->is = IS_FAILED;
-        return;
+	strncpy(row->name, arg, 100);
+	strcpy(row->state, "NOT_FOUND");
+	row->is = IS_FAILED;
+	return;
     }
 
     initng_handler_stop_service(serv);
@@ -989,19 +989,19 @@
 
     if (serv->current_state && serv->current_state->state_name)
     {
-        row->is = serv->current_state->is;
+	row->is = serv->current_state->is;
 
-        /* Copy service type name */
-        if (serv->type && serv->type->name)
-            strncpy(row->type, serv->type->name, 100);
+	/* Copy service type name */
+	if (serv->type && serv->type->name)
+	    strncpy(row->type, serv->type->name, 100);
 
-        /* Copy state name */
-        strncpy(row->state, serv->current_state->state_name, 100);
+	/* Copy state name */
+	strncpy(row->state, serv->current_state->state_name, 100);
     }
     else
     {
-        row->is = 0;
-        row->state[0] = '\0';
+	row->is = 0;
+	row->state[0] = '\0';
     }
 }
 
@@ -1014,30 +1014,30 @@
     /* if an argument is provided */
     if (arg && strlen(arg) > 1)
     {
-        /* malloc some space for it */
-        payload->p = (option_row *) i_calloc(1, sizeof(option_row));
-        memset(payload->p, 0, sizeof(option_row));
-        option_row *row = payload->p;
-
-        strncpy(row->n, arg, 100);
-        strcpy(row->d, "NOT_FOUND");
-        row->t = 0;
-        strcpy(row->o, "UNKNOWN");
-        current = initng_service_data_types_find(arg);
-
-        if (current)
-        {
-            if (current->opt_name)
-                strncpy(row->n, current->opt_name, 100);
-            if (current->opt_desc)
-                strncpy(row->d, current->opt_desc, 300);
-
-            row->t = current->opt_type;
-            strncpy(row->o, current->ot->name, 100);
-        }
+	/* malloc some space for it */
+	payload->p = (option_row *) i_calloc(1, sizeof(option_row));
+	memset(payload->p, 0, sizeof(option_row));
+	option_row *row = payload->p;
+
+	strncpy(row->n, arg, 100);
+	strcpy(row->d, "NOT_FOUND");
+	row->t = 0;
+	strcpy(row->o, "UNKNOWN");
+	current = initng_service_data_types_find(arg);
+
+	if (current)
+	{
+	    if (current->opt_name)
+		strncpy(row->n, current->opt_name, 100);
+	    if (current->opt_desc)
+		strncpy(row->d, current->opt_desc, 300);
+
+	    row->t = current->opt_type;
+	    strncpy(row->o, current->ot->name, 100);
+	}
 
-        payload->s = sizeof(option_row);
-        return;
+	payload->s = sizeof(option_row);
+	return;
     }
 
 
@@ -1047,24 +1047,24 @@
 
     while_service_data_types(current)
     {
-        option_row *row = payload->p + (i * sizeof(option_row));
+	option_row *row = payload->p + (i * sizeof(option_row));
 
-        if (!current->opt_name)
-            continue;
+	if (!current->opt_name)
+	    continue;
 
-        row->d[0] = '\0';
+	row->d[0] = '\0';
 
-        strncpy(row->n, current->opt_name, 100);
-        if (current->opt_desc)
-            strncpy(row->d, current->opt_desc, 300);
+	strncpy(row->n, current->opt_name, 100);
+	if (current->opt_desc)
+	    strncpy(row->d, current->opt_desc, 300);
 
-        row->t = current->opt_type;
-        if (current->ot)
-            strncpy(row->o, current->ot->name, 100);
-        else
-            strcpy(row->o, "all");
+	row->t = current->opt_type;
+	if (current->ot)
+	    strncpy(row->o, current->ot->name, 100);
+	else
+	    strcpy(row->o, "all");
 
-        i++;
+	i++;
     }
 
     /* Last, put s, to indicat that there is data */
@@ -1081,37 +1081,37 @@
     /* if an argument is provided */
     if (arg && strlen(arg) > 1)
     {
-        /* malloc some space for it */
-        payload->p = (active_row *) i_calloc(1, sizeof(active_row));
-        memset(payload->p, 0, sizeof(active_row));
-        active_row *row = payload->p;
-
-        /* fill with defaults, if no data is found */
-        strncpy(row->name, arg, 100);
-        strcpy(row->state, "NOT_FOUND");
-        row->is = IS_FAILED;
-        if ((current = initng_active_db_find_in_name(arg)))
-        {
-            if (current->current_state && current->current_state->state_name)
-            {
-                row->is = current->current_state->is;
-                strncpy(row->state, current->current_state->state_name, 100);
-
-                /* Copy service type name */
-                if (current->type && current->type->name)
-                    strncpy(row->type, current->type->name, 100);
-
-            }
-            else
-            {
-                row->is = 0;
-                row->state[0] = '\0';
-            }
-            row->time_set = current->time_current_state;
-            strncpy(row->name, current->name, 100);
-        }
-        payload->s = sizeof(active_row);
-        return;
+	/* malloc some space for it */
+	payload->p = (active_row *) i_calloc(1, sizeof(active_row));
+	memset(payload->p, 0, sizeof(active_row));
+	active_row *row = payload->p;
+
+	/* fill with defaults, if no data is found */
+	strncpy(row->name, arg, 100);
+	strcpy(row->state, "NOT_FOUND");
+	row->is = IS_FAILED;
+	if ((current = initng_active_db_find_in_name(arg)))
+	{
+	    if (current->current_state && current->current_state->state_name)
+	    {
+		row->is = current->current_state->is;
+		strncpy(row->state, current->current_state->state_name, 100);
+
+		/* Copy service type name */
+		if (current->type && current->type->name)
+		    strncpy(row->type, current->type->name, 100);
+
+	    }
+	    else
+	    {
+		row->is = 0;
+		row->state[0] = '\0';
+	    }
+	    row->time_set = current->time_current_state;
+	    strncpy(row->name, current->name, 100);
+	}
+	payload->s = sizeof(active_row);
+	return;
     }
 
     /* else */
@@ -1122,24 +1122,24 @@
     current = NULL;
     while_active_db(current)
     {
-        active_row *row = payload->p + (i * sizeof(active_row));
+	active_row *row = payload->p + (i * sizeof(active_row));
 
-        if (current->current_state && current->current_state->state_name)
-        {
-            row->is = current->current_state->is;
-            strncpy(row->state, current->current_state->state_name, 100);
-            /* Copy service type name */
-            if (current->type && current->type->name)
-                strncpy(row->type, current->type->name, 100);
-        }
-        else
-        {
-            row->is = 0;
-            row->state[0] = '\0';
-        }
-        row->time_set = current->time_current_state;
-        strncpy(row->name, current->name, 100);
-        i++;
+	if (current->current_state && current->current_state->state_name)
+	{
+	    row->is = current->current_state->is;
+	    strncpy(row->state, current->current_state->state_name, 100);
+	    /* Copy service type name */
+	    if (current->type && current->type->name)
+		strncpy(row->type, current->type->name, 100);
+	}
+	else
+	{
+	    row->is = 0;
+	    row->state[0] = '\0';
+	}
+	row->time_set = current->time_current_state;
+	strncpy(row->name, current->name, 100);
+	i++;
     }
 
     payload->s = i * sizeof(active_row);
@@ -1187,8 +1187,8 @@
     D_("module_init(ngc2);\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     /* initziate the local commands db */
@@ -1201,9 +1201,9 @@
 
     /* decide which socket to use */
     if (g.i_am_init)
-        socket_filename = SOCKET_4_FILENAME_REAL;
+	socket_filename = SOCKET_4_FILENAME_REAL;
     else
-        socket_filename = SOCKET_4_FILENAME_TEST;
+	socket_filename = SOCKET_4_FILENAME_TEST;
 
     D_("Socket is: %s\n", socket_filename);
 

Modified: initng/trunk/plugins/ngc4/initng_ngc4.h
==============================================================================
--- initng/trunk/plugins/ngc4/initng_ngc4.h	(original)
+++ initng/trunk/plugins/ngc4/initng_ngc4.h	Wed Apr  5 22:57:12 2006
@@ -44,11 +44,11 @@
 /* this is a structure for an active_row payload */
 typedef struct
 {
-    char state[101];            /* status, a word describing the status */
-    char name[101];             /* name of service */
-    struct timeval time_set;    /* time status set */
-    e_is is;                    /* is status, status in a number */
-    char type[101];             /* Type of service this is */
+    char state[101];		/* status, a word describing the status */
+    char name[101];		/* name of service */
+    struct timeval time_set;	/* time status set */
+    e_is is;			/* is status, status in a number */
+    char type[101];		/* Type of service this is */
 } active_row;
 
 /* this is a structure for an option_row payload */
@@ -77,9 +77,9 @@
  */
 typedef struct
 {
-    e_suceed s;                 /* succeed, TRUE or FALSE */
+    e_suceed s;			/* succeed, TRUE or FALSE */
     char c;
-    e_com_type t;               /* type of data got back */
+    e_com_type t;		/* type of data got back */
     char version[101];
     int p_ver;
     size_t payload;

Modified: initng/trunk/plugins/ngc4/libngcclient.c
==============================================================================
--- initng/trunk/plugins/ngc4/libngcclient.c	(original)
+++ initng/trunk/plugins/ngc4/libngcclient.c	Wed Apr  5 22:57:12 2006
@@ -73,8 +73,8 @@
     sock = socket(PF_UNIX, SOCK_STREAM, 0);
     if (sock < 0)
     {
-        ngcclient_error = "Failed to init socket";
-        return (FALSE);
+	ngcclient_error = "Failed to init socket";
+	return (FALSE);
     }
 
     /* Bind a name to the socket. */
@@ -86,9 +86,9 @@
 
     if (connect(sock, (struct sockaddr *) &sockname, len) < 0)
     {
-        close(sock);
-        ngcclient_error = "Error connecting to initng socket";
-        return (FALSE);
+	close(sock);
+	ngcclient_error = "Error connecting to initng socket";
+	return (FALSE);
     }
 
 
@@ -110,8 +110,8 @@
 {
     if (sock != -1)
     {
-        close(sock);
-        sock = -1;
+	close(sock);
+	sock = -1;
     }
 }
 
@@ -120,7 +120,7 @@
 
 /* send a command */
 reply *ngcclient_send_command(const char *path, const char c, const char *l,
-                              const char *o)
+			      const char *o)
 {
     read_header header;
     reply *rep;
@@ -136,39 +136,39 @@
     /* fill the header with data */
     header.c = c;
     if (l)
-        strncpy(header.l, l, 100);
+	strncpy(header.l, l, 100);
     else
-        header.l[0] = '\0';
+	header.l[0] = '\0';
 
     /* if there is an option string, we have to know length */
     if (o)
-        header.body_len = strlen(o) * sizeof(char);
+	header.body_len = strlen(o) * sizeof(char);
 
     /*print_out("Sending: %c, %s, %s\n", c, l ,o); */
 
     /* open the socket two way to initng */
     if ((sock = ngcclient_open_socket(path)) < 1)
     {
-        /*
-         * Set in ngcclient_open_socket()
-         * ngcclient_error="Socket is not open, or failed to open!";
-         */
-        return (NULL);
+	/*
+	 * Set in ngcclient_open_socket()
+	 * ngcclient_error="Socket is not open, or failed to open!";
+	 */
+	return (NULL);
     }
 
     /* send the header */
     if (send(sock, &header, sizeof(read_header), 0) <
-        (signed) sizeof(read_header))
+	(signed) sizeof(read_header))
     {
-        ngcclient_error = "Could not send header!";
-        return (NULL);
+	ngcclient_error = "Could not send header!";
+	return (NULL);
     }
 
     /* Also send the content of body (usually a string) */
     if (send(sock, o, header.body_len, 0) < (signed) header.body_len)
     {
-        ngcclient_error = "Could not send body!";
-        return (NULL);
+	ngcclient_error = "Could not send body!";
+	return (NULL);
     }
 
     /* no idea to stress initng */
@@ -181,19 +181,19 @@
      */
     if (header.c == 'c')
     {
-        ngcclient_error = NULL;
-        ngcclient_close_socket(sock);
+	ngcclient_error = NULL;
+	ngcclient_close_socket(sock);
 
-        /* fabricate an reply, and return that */
-        rep->result.s = TRUE;
-        rep->result.c = 'c';
-        rep->result.t = STRING_COMMAND;
-        strcpy(rep->result.version, "Fake reply, not from initng\n");
-        rep->result.p_ver = PROTOCOL_4_VERSION;
-        rep->payload = (char *) strdup("On ngc -c, initng reloads itself. By that it closes the connection to ngc and so can not return if this command succeds or not.");
-        rep->result.payload = strlen(rep->payload) * sizeof(char);
+	/* fabricate an reply, and return that */
+	rep->result.s = TRUE;
+	rep->result.c = 'c';
+	rep->result.t = STRING_COMMAND;
+	strcpy(rep->result.version, "Fake reply, not from initng\n");
+	rep->result.p_ver = PROTOCOL_4_VERSION;
+	rep->payload = (char *) strdup("On ngc -c, initng reloads itself. By that it closes the connection to ngc and so can not return if this command succeds or not.");
+	rep->result.payload = strlen(rep->payload) * sizeof(char);
 
-        return (rep);
+	return (rep);
     }
 
     /* FETCH THE RESULT */
@@ -202,11 +202,11 @@
 
     /* read header data */
     res = TEMP_FAILURE_RETRY(recv
-                             (sock, &rep->result, sizeof(result_desc), 0));
+			     (sock, &rep->result, sizeof(result_desc), 0));
     if (res < (signed) sizeof(result_desc))
     {
-        ngcclient_error = "failed to fetch the result.";
-        return (NULL);
+	ngcclient_error = "failed to fetch the result.";
+	return (NULL);
     }
 
 
@@ -219,73 +219,73 @@
     /* check that protocol matches */
     if (rep->result.p_ver != PROTOCOL_4_VERSION)
     {
-        printf("protocol missmatch %i:%i\n", rep->result.p_ver,
-               PROTOCOL_4_VERSION);
-        ngcclient_error = "PROTOCOL_4_VERSION missmatch!";
-        free(rep);
-        return (NULL);
+	printf("protocol missmatch %i:%i\n", rep->result.p_ver,
+	       PROTOCOL_4_VERSION);
+	ngcclient_error = "PROTOCOL_4_VERSION missmatch!";
+	free(rep);
+	return (NULL);
     }
 
     /* ok, parse how inting thinks this request succeds */
     switch (rep->result.s)
     {
-        case S_FALSE:
-            ngcclient_error = "Request returns negative.";
-            free(rep);
-            return (NULL);
-
-        case S_REQUIRES_OPT:
-            ngcclient_error = "The command requires an option!";
-            free(rep);
-            return (NULL);
-
-        case S_NOT_REQUIRES_OPT:
-            ngcclient_error = "The command cant have an option!";
-            free(rep);
-            return (NULL);
-
-        case S_INVALID_TYPE:
-            ngcclient_error = "The data returning of this command is an unknown type.";
-            free(rep);
-            return (NULL);
-
-        case S_COMMAND_NOT_FOUND:
-            ngcclient_error = "Command not found.";
-            free(rep);
-            return (NULL);
-
-            /* This is a good one */
-        case S_TRUE:
-            break;
-
-        default:
-            ngcclient_error = "Unknown error.";
-            free(rep);
-            return (NULL);
+	case S_FALSE:
+	    ngcclient_error = "Request returns negative.";
+	    free(rep);
+	    return (NULL);
+
+	case S_REQUIRES_OPT:
+	    ngcclient_error = "The command requires an option!";
+	    free(rep);
+	    return (NULL);
+
+	case S_NOT_REQUIRES_OPT:
+	    ngcclient_error = "The command cant have an option!";
+	    free(rep);
+	    return (NULL);
+
+	case S_INVALID_TYPE:
+	    ngcclient_error = "The data returning of this command is an unknown type.";
+	    free(rep);
+	    return (NULL);
+
+	case S_COMMAND_NOT_FOUND:
+	    ngcclient_error = "Command not found.";
+	    free(rep);
+	    return (NULL);
+
+	    /* This is a good one */
+	case S_TRUE:
+	    break;
+
+	default:
+	    ngcclient_error = "Unknown error.";
+	    free(rep);
+	    return (NULL);
     }
 
     /* if there was a payload, download that too */
     if (rep->result.payload > 0)
     {
-        ssize_t got = 0;
+	ssize_t got = 0;
 
-        /*printf("There is a payload.\n"); */
+	/*printf("There is a payload.\n"); */
 
-        /* i allocate 1 byte extra, to be sure a null on the end */
-        rep->payload = calloc(1, rep->result.payload + 1);
-        if (!rep->payload)
-        {
-            ngcclient_error = "Unable to allocate space for payload.";
-            return (NULL);
-        }
-
-        /* sleep a bit, to make sure initng filled the buffer */
-        usleep(50000);
-
-        got = TEMP_FAILURE_RETRY(recv
-                                 (sock, rep->payload, rep->result.payload,
-                                  0));
-        /* printf("got an payload of: %i bytes, suposed to be %i. #errno %i\n", got, rep->result.payload, errno); */
+	/* i allocate 1 byte extra, to be sure a null on the end */
+	rep->payload = calloc(1, rep->result.payload + 1);
+	if (!rep->payload)
+	{
+	    ngcclient_error = "Unable to allocate space for payload.";
+	    return (NULL);
+	}
+
+	/* sleep a bit, to make sure initng filled the buffer */
+	usleep(50000);
+
+	got = TEMP_FAILURE_RETRY(recv
+				 (sock, rep->payload, rep->result.payload,
+				  0));
+	/* printf("got an payload of: %i bytes, suposed to be %i. #errno %i\n", got, rep->result.payload, errno); */
     }
 
 
@@ -301,10 +301,10 @@
  */
 static int mprintf(char **p, const char *format, ...)
 {
-    va_list arg;                /* used for the variable lists */
+    va_list arg;		/* used for the variable lists */
 
-    int len = 0;                /* will contain lent for current string */
-    int add_len = 0;            /* This mutch more strings are we gonna alloc for */
+    int len = 0;		/* will contain lent for current string */
+    int add_len = 0;		/* This mutch more strings are we gonna alloc for */
 
     assert(p);
 
@@ -312,7 +312,7 @@
 
     /* count old chars */
     if (*p)
-        len = strlen(*p);
+	len = strlen(*p);
 
     /*
      * format contains the minimum needed chars that
@@ -329,32 +329,32 @@
      */
     /*printf("Changing size to %i\n", len + add_len); */
     if (!(*p = realloc(*p, ((len + add_len) * sizeof(char)))))
-        return (-1);
+	return (-1);
 
     /* Ok, have a try until vsnprintf succeds */
     while (1)
     {
-        /* start filling the newly allocaded area */
-        va_start(arg, format);
-        int done = vsnprintf((*p) + len, add_len, format, arg);
-
-        va_end(arg);
-
-        /* check if that was enouth */
-        if (done > -1 && done < add_len)
-        {
-            /*printf("GOOD: done : %i, len: %i\n", done, add_len); */
-
-            /* Ok return happily */
-            return (done);
-        }
-        /*printf("BAD: done : %i, len: %i\n", done, add_len); */
-
-        /* try increase it a bit. */
-        add_len = (done < 0 ? add_len * 2 : done + 1);
-        /*printf("Changing size to %i\n", len + add_len); */
-        if (!(*p = realloc(*p, ((len + add_len) * sizeof(char)))))
-            return (-1);
+	/* start filling the newly allocaded area */
+	va_start(arg, format);
+	int done = vsnprintf((*p) + len, add_len, format, arg);
+
+	va_end(arg);
+
+	/* check if that was enouth */
+	if (done > -1 && done < add_len)
+	{
+	    /*printf("GOOD: done : %i, len: %i\n", done, add_len); */
+
+	    /* Ok return happily */
+	    return (done);
+	}
+	/*printf("BAD: done : %i, len: %i\n", done, add_len); */
+
+	/* try increase it a bit. */
+	add_len = (done < 0 ? add_len * 2 : done + 1);
+	/*printf("Changing size to %i\n", len + add_len); */
+	if (!(*p = realloc(*p, ((len + add_len) * sizeof(char)))))
+	    return (-1);
 
     }
 
@@ -374,95 +374,95 @@
      */
     if (ngcclient_error)
     {
-        string = strdup(ngcclient_error);
-        return (string);
+	string = strdup(ngcclient_error);
+	return (string);
     }
 
     /* Make sure we got the result */
     if (!rep)
     {
-        string = strdup("Unable to get reply.");
-        return (string);
+	string = strdup("Unable to get reply.");
+	return (string);
     }
 
 
     /* Have a look what the result is */
     switch (rep->result.t)
     {
-            /* if it returned a string, print it */
-        case STRING_COMMAND:
-            if (!rep->payload || rep->result.payload == 0)
-            {
-                string = strdup("No payload.\n");
-                return (string);
-            }
-            string = (char *) rep->payload;
-            break;
-            /* if it returned some data, call data handlers */
-        case PAYLOAD_COMMAND:
-            string = strdup("Command not supported.");
-            break;
-        case DATA_COMMANDS_ROW:
-            if (!rep->payload || rep->result.payload == 0)
-            {
-                string = strdup("No payload.\n");
-                return (string);
-            }
-            string = ngc_hlp(rep, ansi);
-            break;
-        case DATA_ACTIVE_ROW:
-            if (!rep->payload || rep->result.payload == 0)
-            {
-                string = strdup("No payload.\n");
-                return (string);
-            }
-            string = ngc_active_db(rep, ansi);
-            break;
-        case DATA_OPTION_ROW:
-            if (!rep->payload || rep->result.payload == 0)
-            {
-                string = strdup("No payload.\n");
-                return (string);
-            }
-            string = ngc_option_db(rep, ansi);
-            break;
-        case INT_COMMAND:
-            if (!rep->payload || rep->result.payload == 0)
-            {
-                string = strdup("No payload.\n");
-                return (string);
-            }
-            {
-                /* simplest create an int pointer */
-                int *p = rep->payload;
-
-                sprintf(string, "%i", *p);
-                break;
-            }
-        case VOID_COMMAND:
-            string = strdup("Command succeded without reply.");
-            break;
-        case COMMAND_FAIL:
-            string = strdup("Command replied a failure.");
-            break;
-        case TRUE_OR_FALSE_COMMAND:
-            if (!rep->payload || rep->result.payload == 0)
-            {
-                string = strdup("No payload.\n");
-                return (string);
-            }
-            {
-                int *p = rep->payload;
-
-                if (*p > 0)
-                {
-                    string = strdup("Command POSITIVE.");
-                    break;
-                }
-
-                string = strdup("Command NEGATIVE.");
-                break;
-            }
+	    /* if it returned a string, print it */
+	case STRING_COMMAND:
+	    if (!rep->payload || rep->result.payload == 0)
+	    {
+		string = strdup("No payload.\n");
+		return (string);
+	    }
+	    string = (char *) rep->payload;
+	    break;
+	    /* if it returned some data, call data handlers */
+	case PAYLOAD_COMMAND:
+	    string = strdup("Command not supported.");
+	    break;
+	case DATA_COMMANDS_ROW:
+	    if (!rep->payload || rep->result.payload == 0)
+	    {
+		string = strdup("No payload.\n");
+		return (string);
+	    }
+	    string = ngc_hlp(rep, ansi);
+	    break;
+	case DATA_ACTIVE_ROW:
+	    if (!rep->payload || rep->result.payload == 0)
+	    {
+		string = strdup("No payload.\n");
+		return (string);
+	    }
+	    string = ngc_active_db(rep, ansi);
+	    break;
+	case DATA_OPTION_ROW:
+	    if (!rep->payload || rep->result.payload == 0)
+	    {
+		string = strdup("No payload.\n");
+		return (string);
+	    }
+	    string = ngc_option_db(rep, ansi);
+	    break;
+	case INT_COMMAND:
+	    if (!rep->payload || rep->result.payload == 0)
+	    {
+		string = strdup("No payload.\n");
+		return (string);
+	    }
+	    {
+		/* simplest create an int pointer */
+		int *p = rep->payload;
+
+		sprintf(string, "%i", *p);
+		break;
+	    }
+	case VOID_COMMAND:
+	    string = strdup("Command succeded without reply.");
+	    break;
+	case COMMAND_FAIL:
+	    string = strdup("Command replied a failure.");
+	    break;
+	case TRUE_OR_FALSE_COMMAND:
+	    if (!rep->payload || rep->result.payload == 0)
+	    {
+		string = strdup("No payload.\n");
+		return (string);
+	    }
+	    {
+		int *p = rep->payload;
+
+		if (*p > 0)
+		{
+		    string = strdup("Command POSITIVE.");
+		    break;
+		}
+
+		string = strdup("Command NEGATIVE.");
+		break;
+	    }
     }
 
     /* free */
@@ -486,70 +486,70 @@
     /* print head */
     mprintf(&string, " ngc understand this commands:\n\n");
     mprintf(&string,
-            " short Option                          : description\n");
+	    " short Option                          : description\n");
     mprintf(&string,
-            " ----------------------------------------------------------\n");
+	    " ----------------------------------------------------------\n");
 
     while (row->c)
     {
-        char lname[256];
+	char lname[256];
 
-        /* copy name to the new static array */
-        strncpy(lname, row->l, 200);
+	/* copy name to the new static array */
+	strncpy(lname, row->l, 200);
 
-        if (ansi)
-        {
-            switch (row->o)
-            {
-                case USES_OPT:
-                    strcat(lname, C_FG_YELLOW " <opt>" C_OFF);
-                    break;
-                case REQUIRES_OPT:
-                    strcat(lname, C_FG_CYAN " opt" C_OFF);
-                    break;
-                default:
-                    strcat(lname, C_FG_CYAN C_OFF);
-                    break;
-            }
-        }
-        else
-        {
-            switch (row->o)
-            {
-                case USES_OPT:
-                    strcat(lname, " <opt>");
-                    break;
-                case REQUIRES_OPT:
-                    strcat(lname, " opt");
-                    break;
-                default:
-                    break;
-            }
-        }
-
-        /* to prevent an possible overflow */
-        lname[255] = '\0';
-
-        if (row->c != '\0')
-        {
-            if (ansi)
-            {
-                mprintf(&string,
-                        " [" C_FG_LIGHT_RED "-%c" C_OFF "] --%-40s: %s\n",
-                        row->c, lname, row->d);
-            }
-            else
-            {
-                mprintf(&string, " [-%c] --%-40s: %s\n",
-                        row->c, lname, row->d);
-            }
-        }
-        else
-        {
-            mprintf(&string, "       --%-40s: %s\n", lname, row->d);
-        }
+	if (ansi)
+	{
+	    switch (row->o)
+	    {
+		case USES_OPT:
+		    strcat(lname, C_FG_YELLOW " <opt>" C_OFF);
+		    break;
+		case REQUIRES_OPT:
+		    strcat(lname, C_FG_CYAN " opt" C_OFF);
+		    break;
+		default:
+		    strcat(lname, C_FG_CYAN C_OFF);
+		    break;
+	    }
+	}
+	else
+	{
+	    switch (row->o)
+	    {
+		case USES_OPT:
+		    strcat(lname, " <opt>");
+		    break;
+		case REQUIRES_OPT:
+		    strcat(lname, " opt");
+		    break;
+		default:
+		    break;
+	    }
+	}
+
+	/* to prevent an possible overflow */
+	lname[255] = '\0';
+
+	if (row->c != '\0')
+	{
+	    if (ansi)
+	    {
+		mprintf(&string,
+			" [" C_FG_LIGHT_RED "-%c" C_OFF "] --%-40s: %s\n",
+			row->c, lname, row->d);
+	    }
+	    else
+	    {
+		mprintf(&string, " [-%c] --%-40s: %s\n",
+			row->c, lname, row->d);
+	    }
+	}
+	else
+	{
+	    mprintf(&string, "       --%-40s: %s\n", lname, row->d);
+	}
 
-        row++;
+	row++;
 
     }
     return (string);
@@ -569,77 +569,77 @@
     /* print head */
     if (ansi)
     {
-        mprintf(&string, C_FG_LIGHT_RED "hh:mm:ss" C_OFF
-                C_FG_CYAN " T " C_OFF
-                "service                             : " C_FG_NEON_GREEN
-                "status\n" C_OFF);
+	mprintf(&string, C_FG_LIGHT_RED "hh:mm:ss" C_OFF
+		C_FG_CYAN " T " C_OFF
+		"service                             : " C_FG_NEON_GREEN
+		"status\n" C_OFF);
     }
     else
     {
-        mprintf(&string,
-                "hh:mm:ss T service                             : status\n");
+	mprintf(&string,
+		"hh:mm:ss T service                             : status\n");
     }
 
     /* don't make it weighter! only 80chars, not weighter. */
     mprintf(&string,
-            "----------------------------------------------------------------\n");
+	    "----------------------------------------------------------------\n");
 
     while (row->state[0])
     {
-        struct tm *ts = localtime(&row->time_set.tv_sec);
+	struct tm *ts = localtime(&row->time_set.tv_sec);
 
-        /* don't make it weighter! only 80chars, not weighter. */
-        if (ansi)
-        {
-            mprintf(&string,
-                    C_FG_LIGHT_RED "%.2i:%.2i:%.2i" C_OFF C_FG_CYAN " %c"
-                    C_OFF " %-35s : ", ts->tm_hour, ts->tm_min, ts->tm_sec,
-                    (char) toupper((int) row->type[0]), row->name);
-        }
-        else
-        {
-            mprintf(&string, "%.2i:%.2i:%.2i %c %-35s : ",
-                    ts->tm_hour, ts->tm_min, ts->tm_sec,
-                    (char) toupper((int) row->type), row->name);
-        }
-
-        if (ansi)
-        {
-            switch (row->is)
-            {
-                case IS_UP:
-                    mprintf(&string, C_FG_NEON_GREEN "%s" C_OFF "\n",
-                            row->state);
-                    break;
-                case IS_DOWN:
-                    mprintf(&string, C_FG_LIGHT_BLUE "%s" C_OFF "\n",
-                            row->state);
-                    break;
-                case IS_FAILED:
-                    mprintf(&string, C_FG_LIGHT_RED "%s" C_OFF "\n",
-                            row->state);
-                    break;
-                case IS_STARTING:
-                    mprintf(&string, C_FG_YELLOW "%s" C_OFF "\n", row->state);
-                    break;
-                case IS_STOPPING:
-                    mprintf(&string, C_FG_CYAN "%s" C_OFF "\n", row->state);
-                    break;
-                case IS_WAITING:
-                    mprintf(&string, C_FG_MAGENTA "%s" C_OFF "\n",
-                            row->state);
-                    break;
-                case IS_UNKNOWN:
-                    mprintf(&string, "%s\n", row->state);
-                    break;
-            }
-        }
-        else
-        {
-            mprintf(&string, "%s\n", row->state);
-        }
+	/* don't make it weighter! only 80chars, not weighter. */
+	if (ansi)
+	{
+	    mprintf(&string,
+		    C_FG_LIGHT_RED "%.2i:%.2i:%.2i" C_OFF C_FG_CYAN " %c"
+		    C_OFF " %-35s : ", ts->tm_hour, ts->tm_min, ts->tm_sec,
+		    (char) toupper((int) row->type[0]), row->name);
+	}
+	else
+	{
+	    mprintf(&string, "%.2i:%.2i:%.2i %c %-35s : ",
+		    ts->tm_hour, ts->tm_min, ts->tm_sec,
+		    (char) toupper((int) row->type), row->name);
+	}
+
+	if (ansi)
+	{
+	    switch (row->is)
+	    {
+		case IS_UP:
+		    mprintf(&string, C_FG_NEON_GREEN "%s" C_OFF "\n",
+			    row->state);
+		    break;
+		case IS_DOWN:
+		    mprintf(&string, C_FG_LIGHT_BLUE "%s" C_OFF "\n",
+			    row->state);
+		    break;
+		case IS_FAILED:
+		    mprintf(&string, C_FG_LIGHT_RED "%s" C_OFF "\n",
+			    row->state);
+		    break;
+		case IS_STARTING:
+		    mprintf(&string, C_FG_YELLOW "%s" C_OFF "\n", row->state);
+		    break;
+		case IS_STOPPING:
+		    mprintf(&string, C_FG_CYAN "%s" C_OFF "\n", row->state);
+		    break;
+		case IS_WAITING:
+		    mprintf(&string, C_FG_MAGENTA "%s" C_OFF "\n",
+			    row->state);
+		    break;
+		case IS_UNKNOWN:
+		    mprintf(&string, "%s\n", row->state);
+		    break;
+	    }
+	}
+	else
+	{
+	    mprintf(&string, "%s\n", row->state);
+	}
 
-        row++;
+	row++;
     }
     return (string);
 }
@@ -656,73 +656,73 @@
     /* print head */
     if (ansi)
     {
-        mprintf(&string,
-                " " C_FG_LIGHT_RED "%-10s" C_OFF C_FG_CYAN "%-8s" C_OFF
-                " %-24s %s\n", "Where", "Type", "Name", "Description");
+	mprintf(&string,
+		" " C_FG_LIGHT_RED "%-10s" C_OFF C_FG_CYAN "%-8s" C_OFF
+		" %-24s %s\n", "Where", "Type", "Name", "Description");
     }
     else
     {
-        mprintf(&string, " %-10s%-8s %-24s %s\n", "Where", "Type", "Name",
-                "Description");
+	mprintf(&string, " %-10s%-8s %-24s %s\n", "Where", "Type", "Name",
+		"Description");
     }
 
     mprintf(&string,
-            " ----------------------------------------------------------------\n");
+	    " ----------------------------------------------------------------\n");
 
     while (row->n[0])
     {
-        switch (row->t)
-        {
-            case STRING:
-                strcpy(ct, "STRING");
-                break;
-            case VARIABLE_STRING:
-                strcpy(ct, "V_STRING");
-                break;
-            case STRINGS:
-                strcpy(ct, "STRINGS");
-                break;
-            case VARIABLE_STRINGS:
-                strcpy(ct, "V_STRINGS");
-                break;
-            case SET:
-                strcpy(ct, "SET");
-                break;
-            case VARIABLE_SET:
-                strcpy(ct, "V_SET");
-                break;
-            case INT:
-                strcpy(ct, "INT");
-                break;
-            case VARIABLE_INT:
-                strcpy(ct, "V_INT");
-                break;
-            case ALIAS:
-                strcpy(ct, "ALIAS");
-                break;
-            case U_D_T:
-                strcpy(ct, "U_D_T");
-                break;
-            case TIME_T:
-                strcpy(ct, "TIME_T");
-                break;
-            case VARIABLE_TIME_T:
-                strcpy(ct, "V_TIME_T");
-                break;
-        }
-
-        if (ansi)
-        {
-            mprintf(&string,
-                    " " C_FG_LIGHT_RED "%-10s" C_OFF C_FG_CYAN "%-8s" C_OFF
-                    " %-24s %s\n", row->o, ct, row->n, row->d);
-        }
-        else
-        {
-            mprintf(&string, " %-10s%-8s %-24s %s\n", row->o, ct, row->n,
-                    row->d);
-        }
-        row++;
+	switch (row->t)
+	{
+	    case STRING:
+		strcpy(ct, "STRING");
+		break;
+	    case VARIABLE_STRING:
+		strcpy(ct, "V_STRING");
+		break;
+	    case STRINGS:
+		strcpy(ct, "STRINGS");
+		break;
+	    case VARIABLE_STRINGS:
+		strcpy(ct, "V_STRINGS");
+		break;
+	    case SET:
+		strcpy(ct, "SET");
+		break;
+	    case VARIABLE_SET:
+		strcpy(ct, "V_SET");
+		break;
+	    case INT:
+		strcpy(ct, "INT");
+		break;
+	    case VARIABLE_INT:
+		strcpy(ct, "V_INT");
+		break;
+	    case ALIAS:
+		strcpy(ct, "ALIAS");
+		break;
+	    case U_D_T:
+		strcpy(ct, "U_D_T");
+		break;
+	    case TIME_T:
+		strcpy(ct, "TIME_T");
+		break;
+	    case VARIABLE_TIME_T:
+		strcpy(ct, "V_TIME_T");
+		break;
+	}
+
+	if (ansi)
+	{
+	    mprintf(&string,
+		    " " C_FG_LIGHT_RED "%-10s" C_OFF C_FG_CYAN "%-8s" C_OFF
+		    " %-24s %s\n", row->o, ct, row->n, row->d);
+	}
+	else
+	{
+	    mprintf(&string, " %-10s%-8s %-24s %s\n", row->o, ct, row->n,
+		    row->d);
+	}
+	row++;
     }
 
     /* return the string */

Modified: initng/trunk/plugins/ngc4/libngcclient.h
==============================================================================
--- initng/trunk/plugins/ngc4/libngcclient.h	(original)
+++ initng/trunk/plugins/ngc4/libngcclient.h	Wed Apr  5 22:57:12 2006
@@ -33,7 +33,7 @@
 #define ngcclient_send_short_command(c, o) ngcclient_send_command(c, NULL, o)
 #define ngcclient_send_long_command(l, o)  ngcclient_send_command('\0', l, o)
 reply *ngcclient_send_command(const char *path, const char c, const char *l,
-                              const char *o);
+			      const char *o);
 
 extern const char *ngcclient_error;
 

Modified: initng/trunk/plugins/ngc4/ngc4.c
==============================================================================
--- initng/trunk/plugins/ngc4/ngc4.c	(original)
+++ initng/trunk/plugins/ngc4/ngc4.c	Wed Apr  5 22:57:12 2006
@@ -75,40 +75,40 @@
 {
     if (strcmp(service_starting_stopping->name, service) != 0)
     {
-        /*printf("Dont wanna lissen on \"%s\"\n", service); */
-        return;
+	/*printf("Dont wanna lissen on \"%s\"\n", service); */
+	return;
     }
 
     switch (is)
     {
-        case IS_UP:
-            printf("\nService \"%s\" is started!\n", service);
-            /* Close the event socket, and ngclient_exec() should return */
-            ngeclient_close_socket(e);
-            break;
-        case IS_DOWN:
-            printf("\nService \"%s\" have stopped!\n", service);
-            /* Close the event socket, and ngclient_exec() should return */
-            ngeclient_close_socket(e);
-            break;
-        case IS_FAILED:
-            printf("\nService \"%s\" have failed!\n", service);
-            /* Close the event socket, and ngclient_exec() should return */
-            ngeclient_close_socket(e);
-            break;
-        default:
-            printf("\nService \"%s\" is now in state: %s\n", service, state);
-            break;
+	case IS_UP:
+	    printf("\nService \"%s\" is started!\n", service);
+	    /* Close the event socket, and ngclient_exec() should return */
+	    ngeclient_close_socket(e);
+	    break;
+	case IS_DOWN:
+	    printf("\nService \"%s\" have stopped!\n", service);
+	    /* Close the event socket, and ngclient_exec() should return */
+	    ngeclient_close_socket(e);
+	    break;
+	case IS_FAILED:
+	    printf("\nService \"%s\" have failed!\n", service);
+	    /* Close the event socket, and ngclient_exec() should return */
+	    ngeclient_close_socket(e);
+	    break;
+	default:
+	    printf("\nService \"%s\" is now in state: %s\n", service, state);
+	    break;
     }
 }
 
 
 static void service_output(nge_event * e, char *service, char *process,
-                           char *output)
+			   char *output)
 {
     if (strcmp(service_starting_stopping->name, service) != 0)
 
-        return;
+	return;
     fprintf(stdout, "%s", output);
 }
 
@@ -122,28 +122,28 @@
     /* check what state they are in */
     switch (service_starting_stopping->is)
     {
-        case IS_STARTING:
-            print_out("Starting service \"%s\", hang on..\n",
-                      service_starting_stopping->name);
-            break;
-        case IS_STOPPING:
-            print_out("Stopping service \"%s\", hang on..\n\n\n",
-                      service_starting_stopping->name);
-            break;
-        case IS_DOWN:
-            printf("Service %s is already down.\n\n\n",
-                   service_starting_stopping->name);
-            return (FALSE);
-
-        case IS_UP:
-            printf("Service %s is already up.\n",
-                   service_starting_stopping->name);
-            return (FALSE);
-
-        default:
-            print_out("Service has state: %s\n",
-                      service_starting_stopping->state);
-            return (FALSE);
+	case IS_STARTING:
+	    print_out("Starting service \"%s\", hang on..\n",
+		      service_starting_stopping->name);
+	    break;
+	case IS_STOPPING:
+	    print_out("Stopping service \"%s\", hang on..\n\n\n",
+		      service_starting_stopping->name);
+	    break;
+	case IS_DOWN:
+	    printf("Service %s is already down.\n\n\n",
+		   service_starting_stopping->name);
+	    return (FALSE);
+
+	case IS_UP:
+	    printf("Service %s is already up.\n",
+		   service_starting_stopping->name);
+	    return (FALSE);
+
+	default:
+	    print_out("Service has state: %s\n",
+		      service_starting_stopping->state);
+	    return (FALSE);
     }
 
     /*
@@ -161,15 +161,15 @@
 
     /* open correct socket */
     if (debug == TRUE)
-        ngeclient_open_socket(&e, NGE_TEST);
+	ngeclient_open_socket(&e, NGE_TEST);
     else
-        ngeclient_open_socket(&e, NGE_REAL);
+	ngeclient_open_socket(&e, NGE_REAL);
 
     /* if open_socket fails, ngeclient_error is set */
     if (ngeclient_error)
     {
-        fprintf(stderr, "%s\n", ngeclient_error);
-        return (FALSE);
+	fprintf(stderr, "%s\n", ngeclient_error);
+	return (FALSE);
     }
 
     /* this is the MAIN LOOP for ngeclient */
@@ -178,7 +178,7 @@
     /* check for failures */
     if (ngeclient_error)
     {
-        fprintf(stderr, "%s\n", ngeclient_error);
+	fprintf(stderr, "%s\n", ngeclient_error);
     }
 
     return (TRUE);
@@ -186,7 +186,7 @@
 #endif
 
 static int send_and_handle(const char c, const char *l, const char *opt,
-                           int instant)
+			   int instant)
 {
     char *string = NULL;
     reply *rep = NULL;
@@ -199,23 +199,23 @@
 
     if (debug == TRUE)
     {
-        rep = ngcclient_send_command(SOCKET_4_FILENAME_TEST, c, l, opt);
+	rep = ngcclient_send_command(SOCKET_4_FILENAME_TEST, c, l, opt);
     }
     else
     {
-        rep = ngcclient_send_command(SOCKET_4_FILENAME_REAL, c, l, opt);
+	rep = ngcclient_send_command(SOCKET_4_FILENAME_REAL, c, l, opt);
     }
 
     if (ngcclient_error)
     {
-        print_out("%s\n", ngcclient_error);
-        return (FALSE);
+	print_out("%s\n", ngcclient_error);
+	return (FALSE);
     }
 
     if (!rep)
     {
-        print_out("Command failed.\n");
-        return (FALSE);
+	print_out("Command failed.\n");
+	return (FALSE);
     }
 
 
@@ -223,38 +223,38 @@
     /* TODO, put initng version from rep here */
     if (header_printed == FALSE && quiet == FALSE)
     {
-        /* print banner */
-        print_out(C_FG_LIGHT_BLUE " Next Generation init Control. version ( "
-                  C_FG_WHITE "%s" C_OFF
-                  C_FG_LIGHT_BLUE " )" C_OFF
-                  C_FG_LIGHT_RED "\n (c) Jimmy Wennlund, " C_OFF
-                  C_FG_NEON_GREEN "http://initng.thinktux.net/" C_OFF,
-                  VERSION);
-        header_printed = TRUE;
+	/* print banner */
+	print_out(C_FG_LIGHT_BLUE " Next Generation init Control. version ( "
+		  C_FG_WHITE "%s" C_OFF
+		  C_FG_LIGHT_BLUE " )" C_OFF
+		  C_FG_LIGHT_RED "\n (c) Jimmy Wennlund, " C_OFF
+		  C_FG_NEON_GREEN "http://initng.thinktux.net/" C_OFF,
+		  VERSION);
+	header_printed = TRUE;
     }
 
 
 #ifdef HAVE_NGE
     if (instant == FALSE && quiet == FALSE)
     {
-        /*
-         * there are special commands, where we wanna 
-         * initziate nge, and follow the service.
-         */
-        if (rep->result.c == 'u' || rep->result.c == 'd')
-        {
-            return (start_or_stop_command(rep));
-        }
+	/*
+	 * there are special commands, where we wanna 
+	 * initziate nge, and follow the service.
+	 */
+	if (rep->result.c == 'u' || rep->result.c == 'd')
+	{
+	    return (start_or_stop_command(rep));
+	}
     }
 #endif
 
     /* only print when not quiet */
     if (quiet == FALSE)
     {
-        string = ngcclient_reply_to_string(rep, TRUE);
-        print_out("\n\n%s\n", string);
-        if (string)
-            free(string);
+	string = ngcclient_reply_to_string(rep, TRUE);
+	print_out("\n\n%s\n", string);
+	if (string)
+	    free(string);
     }
 
     free(rep);
@@ -287,149 +287,149 @@
      * example argv[0] == "./ngstart" then Argv == "ngstart"
      */
     {
-        i = 0;
+	i = 0;
 
-        /* skip to last char of "/sbin/ngc" */
-        while (argv[0][i])
-            i++;
-
-        /* then walk backwards, to the first '/' found */
-        while (i > 0 && argv[0][i] != '/')
-        {
-            i--;
-        }
-
-        /* Here we have the program name */
-        Argv = &argv[0][i];
-
-        /* Make sure there is no stale '/' char in beginning */
-        if (Argv[0] == '/')
-            Argv++;
-
-        /*
-         * Special case, libtool test adds lt-ngc to path
-         * when running in make dir.
-         * So translate "lt-ngc" to "ngc"
-         */
-        if (Argv[0] == 'l' && Argv[1] == 't' && Argv[2] == '-')
-            Argv += 3;
-
-        /* Only for testing.
-         * printf("Argv: %s argv[0]: %s\n", Argv, argv[0]);
-         */
+	/* skip to last char of "/sbin/ngc" */
+	while (argv[0][i])
+	    i++;
+
+	/* then walk backwards, to the first '/' found */
+	while (i > 0 && argv[0][i] != '/')
+	{
+	    i--;
+	}
+
+	/* Here we have the program name */
+	Argv = &argv[0][i];
+
+	/* Make sure there is no stale '/' char in beginning */
+	if (Argv[0] == '/')
+	    Argv++;
+
+	/*
+	 * Special case, libtool test adds lt-ngc to path
+	 * when running in make dir.
+	 * So translate "lt-ngc" to "ngc"
+	 */
+	if (Argv[0] == 'l' && Argv[1] == 't' && Argv[2] == '-')
+	    Argv += 3;
+
+	/* Only for testing.
+	 * printf("Argv: %s argv[0]: %s\n", Argv, argv[0]);
+	 */
     }
 
     /* check if cmd-line contains "ngdc", if set debug */
     if (strncasecmp(Argv, "ngd", 3) == 0)
     {
-        print_out(C_FG_YELLOW "Warning. This is ngdc!" C_OFF "\n");
-        debug = TRUE;
+	print_out(C_FG_YELLOW "Warning. This is ngdc!" C_OFF "\n");
+	debug = TRUE;
     }
 
 
     if (debug == FALSE && getuid() != 0)
     {
-        print_out(C_ERROR "You need root access to communicate with initng."
-                  C_OFF "\n");
-        exit(2);
+	print_out(C_ERROR "You need root access to communicate with initng."
+		  C_OFF "\n");
+	exit(2);
     }
 
     /* check that Argc string is not ngc, NGC, ngdc, NGDC */
     if (strcasecmp(Argv, "ngc") != 0 && strcasecmp(Argv, "ngdc") != 0 &&
-        strcasecmp(Argv, "ngc4") != 0 && strcasecmp(Argv, "ngdc4") != 0)
+	strcasecmp(Argv, "ngc4") != 0 && strcasecmp(Argv, "ngdc4") != 0)
     {
-        /*printf("Not standard ngc or ngdc command.\n"); */
-        /* check if argv0 starts with "ng..." */
-        if (Argv[0] == 'n' && Argv[1] == 'g' && Argv[2])
-        {
-            /* if its ngstart, call send_and_handle("start"); */
-            if (Argv[2] == 'd' && Argv[3])
-            {
-                /* check if is a string or char */
-                if (Argv[4])
-                    return (send_and_handle
-                            ('\0', &Argv[3], argv[1], instant));
-                else
-                    return (send_and_handle(Argv[3], NULL, argv[1], instant));
-            }
-            else
-            {
-                /* check if its a string or char */
-                if (Argv[3])
-                    return (send_and_handle
-                            ('\0', &Argv[2], argv[1], instant));
-                else
-                    return (send_and_handle(Argv[2], NULL, argv[1], instant));
-            }
-        }
+	/*printf("Not standard ngc or ngdc command.\n"); */
+	/* check if argv0 starts with "ng..." */
+	if (Argv[0] == 'n' && Argv[1] == 'g' && Argv[2])
+	{
+	    /* if its ngstart, call send_and_handle("start"); */
+	    if (Argv[2] == 'd' && Argv[3])
+	    {
+		/* check if is a string or char */
+		if (Argv[4])
+		    return (send_and_handle
+			    ('\0', &Argv[3], argv[1], instant));
+		else
+		    return (send_and_handle(Argv[3], NULL, argv[1], instant));
+	    }
+	    else
+	    {
+		/* check if its a string or char */
+		if (Argv[3])
+		    return (send_and_handle
+			    ('\0', &Argv[2], argv[1], instant));
+		else
+		    return (send_and_handle(Argv[2], NULL, argv[1], instant));
+	    }
+	}
 
-        /* else call standard */
-        return (send_and_handle('\0', Argv, argv[1], instant));
+	/* else call standard */
+	return (send_and_handle('\0', Argv, argv[1], instant));
     }
 
     /* make sure there are any arguments at all */
     if (argc <= 1)
     {
-        send_and_handle('h', NULL, NULL, instant);
-        exit(0);
+	send_and_handle('h', NULL, NULL, instant);
+	exit(0);
     }
 
     /* walk thru all arguments */
     while (argv[cc])
     {
-        char *opt = NULL;
+	char *opt = NULL;
 
-        /* every fresh start needs a '-' char */
-        if (argv[cc][0] != '-')
-        {
-            send_and_handle('h', NULL, NULL, instant);
-            exit(1);
-        }
-
-        /* check that there is a char after the '-' */
-        if (!argv[cc][1])
-        {
-            send_and_handle('h', NULL, NULL, instant);
-            exit(1);
-        }
-
-        /* if next option contains data, but not starting with an '-', its considered an option */
-        if (argv[cc + 1] && argv[cc + 1][0] != '-')
-            opt = argv[cc + 1];
-
-
-        /* if it is an --option */
-        if (argv[cc][1] == '-')
-        {
-
-            /* handle local --instant */
-            if (strcmp(&argv[cc][2], "instant") == 0)
-            {
-                instant = TRUE;
-                cc++;
-                continue;
-            }
-
-            /* handle local --quiet */
-            if (strcmp(&argv[cc][2], "quiet") == 0)
-            {
-                quiet = TRUE;
-                cc++;
-                continue;
-            }
-
-            if (!send_and_handle('\0', &argv[cc][2], opt, instant))
-                exit(1);
-        }
-        else
-        {
-            if (!send_and_handle(argv[cc][1], NULL, opt, instant))
-                exit(1);
-        }
-
-        cc++;
-        if (opt)
-            cc++;
+	/* every fresh start needs a '-' char */
+	if (argv[cc][0] != '-')
+	{
+	    send_and_handle('h', NULL, NULL, instant);
+	    exit(1);
+	}
+
+	/* check that there is a char after the '-' */
+	if (!argv[cc][1])
+	{
+	    send_and_handle('h', NULL, NULL, instant);
+	    exit(1);
+	}
+
+	/* if next option contains data, but not starting with an '-', its considered an option */
+	if (argv[cc + 1] && argv[cc + 1][0] != '-')
+	    opt = argv[cc + 1];
+
+
+	/* if it is an --option */
+	if (argv[cc][1] == '-')
+	{
+
+	    /* handle local --instant */
+	    if (strcmp(&argv[cc][2], "instant") == 0)
+	    {
+		instant = TRUE;
+		cc++;
+		continue;
+	    }
+
+	    /* handle local --quiet */
+	    if (strcmp(&argv[cc][2], "quiet") == 0)
+	    {
+		quiet = TRUE;
+		cc++;
+		continue;
+	    }
+
+	    if (!send_and_handle('\0', &argv[cc][2], opt, instant))
+		exit(1);
+	}
+	else
+	{
+	    if (!send_and_handle(argv[cc][1], NULL, opt, instant))
+		exit(1);
+	}
+
+	cc++;
+	if (opt)
+	    cc++;
 
 
     }

Modified: initng/trunk/plugins/ngcs/initng_ngcs.c
==============================================================================
--- initng/trunk/plugins/ngcs/initng_ngcs.c	(original)
+++ initng/trunk/plugins/ngcs/initng_ngcs.c	Wed Apr  5 22:57:12 2006
@@ -103,7 +103,7 @@
 {
     /* Check if we need to remove hooks */
     if (fdh.fds < 0)
-        return;
+	return;
     D_("closesock %d\n", fdh.fds);
 
     /* close socket and set to 0 */
@@ -123,7 +123,7 @@
 
     /* make a dumb check */
     if (from != &fdh)
-        return;
+	return;
 
     D_("Got here from fd hook.\n");
     /* we try to fix socket after every service start
@@ -131,60 +131,60 @@
        up, and we shouldn't manually try to fix anything. */
     if (fdh.fds <= 0)
     {
-        /* socket is invalid but we were called, call closesocket to make sure it wont happen again */
-        F_("accepted client called with fdh.fds %d, report bug\n", fdh.fds);
-        closesock();
-        F_("Attempting to reopen socket\n");
-        open_socket();
-        return;
+	/* socket is invalid but we were called, call closesocket to make sure it wont happen again */
+	F_("accepted client called with fdh.fds %d, report bug\n", fdh.fds);
+	closesock();
+	F_("Attempting to reopen socket\n");
+	open_socket();
+	return;
     }
 
     /* create a new socket, for reading */
     if ((newsock = accept(fdh.fds, NULL, NULL)) > 0)
     {
-        D_("read socket open, now setting options\n");
-        conn = (ngcs_svr_conn *) i_calloc(1, sizeof(ngcs_svr_conn));
-        if (conn == NULL)
-        {
-            F_("Couldn't allocate ngcs_svr_conn!");
-            close(newsock);
-            return;
-        }
-
-        conn->conn = ngcs_conn_from_fd(newsock, conn, &handle_close);
-        if (conn->conn == NULL)
-        {
-            F_("Couldn't allocate ngcs_conn!");
-            close(newsock);
-            free(conn);
-            return;
-        }
-
-        chan0 = ngcs_chan_reg(conn->conn, 0, &handle_chan0, NULL);
-        if (chan0 == NULL)
-        {
-            F_("Couldn't register channel 0!");
-            ngcs_conn_free(conn->conn);
-            free(conn);
-            return;
-        }
-
-        conn->fdw.fds = conn->conn->fd;
-        conn->fdw.what = FDW_READ;
-        conn->fdw.call_module = data_ready;
-        conn->nextid = 1;
-        conn->list.next = 0;
-        conn->list.prev = 0;
-        list_add(&conn->list, &ngcs_conns.list);
-        initng_plugin_hook_add(&g.FDWATCHERS, 30, &conn->fdw);
-        return;
+	D_("read socket open, now setting options\n");
+	conn = (ngcs_svr_conn *) i_calloc(1, sizeof(ngcs_svr_conn));
+	if (conn == NULL)
+	{
+	    F_("Couldn't allocate ngcs_svr_conn!");
+	    close(newsock);
+	    return;
+	}
+
+	conn->conn = ngcs_conn_from_fd(newsock, conn, &handle_close);
+	if (conn->conn == NULL)
+	{
+	    F_("Couldn't allocate ngcs_conn!");
+	    close(newsock);
+	    free(conn);
+	    return;
+	}
+
+	chan0 = ngcs_chan_reg(conn->conn, 0, &handle_chan0, NULL);
+	if (chan0 == NULL)
+	{
+	    F_("Couldn't register channel 0!");
+	    ngcs_conn_free(conn->conn);
+	    free(conn);
+	    return;
+	}
+
+	conn->fdw.fds = conn->conn->fd;
+	conn->fdw.what = FDW_READ;
+	conn->fdw.call_module = data_ready;
+	conn->nextid = 1;
+	conn->list.next = 0;
+	conn->list.prev = 0;
+	list_add(&conn->list, &ngcs_conns.list);
+	initng_plugin_hook_add(&g.FDWATCHERS, 30, &conn->fdw);
+	return;
     }
 
     /* temporary unavailable */
     if ((errno == EAGAIN) || (errno == EWOULDBLOCK))
     {
-        W_("errno = EAGAIN!\n");
-        return;
+	W_("errno = EAGAIN!\n");
+	return;
     }
 
     /* This'll generally happen on shutdown, don't cry about it. */
@@ -218,13 +218,13 @@
     /* sanity checks on message */
     if (len < 0)
     {
-        return;
+	return;
     }
     else if (type != NGCS_TYPE_STRUCT || len == 0)
     {
-        F_("Invalid chan0 message with type=%i, len=%i\n", type, len);
-        ngcs_chan_send(chan, NGCS_TYPE_ERROR, 11, "BAD_REQUEST");
-        return;
+	F_("Invalid chan0 message with type=%i, len=%i\n", type, len);
+	ngcs_chan_send(chan, NGCS_TYPE_ERROR, 11, "BAD_REQUEST");
+	return;
     }
 
     /* unpack message */
@@ -232,46 +232,46 @@
     req.argc = ngcs_unpack(data, len, &req.argv);
     if (req.argc <= 0 || req.argv[0].type != NGCS_TYPE_STRING)
     {
-        F_("Bad unpacked message\n");
-        if (req.argc >= 0)
-            free(req.argv);
-        ngcs_chan_send(chan, NGCS_TYPE_ERROR, 11, "BAD_REQUEST");
-        return;
+	F_("Bad unpacked message\n");
+	if (req.argc >= 0)
+	    free(req.argv);
+	ngcs_chan_send(chan, NGCS_TYPE_ERROR, 11, "BAD_REQUEST");
+	return;
     }
 
     req.chan = chan;
-    req.conn = chan->conn;                  /* backwards compatibility */
+    req.conn = chan->conn;		    /* backwards compatibility */
     req.sent_resp_flag = 0;
 
     /* run the associated command */
     while_ngcs_cmds(cmd)
     {
-        if (cmd->name != NULL && strcmp(cmd->name, req.argv[0].d.s) == 0)
-        {
-            cmd->func(&req);
-            if (!req.sent_resp_flag)
-            {
-                /* if the command handler didn't send a response,
-                   we send a default one to keep the protocol in sync */
-                ngcs_chan_send(chan, NGCS_TYPE_NULL, 0, NULL);
-            }
-            ngcs_free_unpack(req.argc, req.argv);
-            return;
-        }
+	if (cmd->name != NULL && strcmp(cmd->name, req.argv[0].d.s) == 0)
+	{
+	    cmd->func(&req);
+	    if (!req.sent_resp_flag)
+	    {
+		/* if the command handler didn't send a response,
+		   we send a default one to keep the protocol in sync */
+		ngcs_chan_send(chan, NGCS_TYPE_NULL, 0, NULL);
+	    }
+	    ngcs_free_unpack(req.argc, req.argv);
+	    return;
+	}
     }
 
     /* Command handlers which do multiple commands - TODO document this */
     while_ngcs_cmds(cmd)
     {
-        if (cmd->name == NULL)
-        {
-            cmd->func(&req);
-            if (req.sent_resp_flag)
-            {
-                ngcs_free_unpack(req.argc, req.argv);
-                return;
-            }
-        }
+	if (cmd->name == NULL)
+	{
+	    cmd->func(&req);
+	    if (req.sent_resp_flag)
+	    {
+		ngcs_free_unpack(req.argc, req.argv);
+		return;
+	    }
+	}
     }
 
     F_("Unknown ngcs command: %s\n", req.argv[0].d.s);
@@ -288,94 +288,94 @@
     char *sret;
 
     if (req->argv[0].type != NGCS_TYPE_STRING || req->argv[0].d.s[0] != '-')
-        return;
+	return;
 
     if (req->argv[0].d.s[1] == '-')
     {
-        while_command_db(cur)
-        {
-            if (cur->long_id
-                && strcmp(cur->long_id, req->argv[0].d.s + 2) == 0)
-            {
-                cmd = cur;
-                break;
-            }
-        }
+	while_command_db(cur)
+	{
+	    if (cur->long_id
+		&& strcmp(cur->long_id, req->argv[0].d.s + 2) == 0)
+	    {
+		cmd = cur;
+		break;
+	    }
+	}
     }
     else if (req->argv[0].d.s[1] != 0 && req->argv[0].d.s[2] == 0)
     {
-        while_command_db(cur)
-        {
-            if (cur->command_id == req->argv[0].d.s[1])
-            {
-                cmd = cur;
-                break;
-            }
-        }
+	while_command_db(cur)
+	{
+	    if (cur->command_id == req->argv[0].d.s[1])
+	    {
+		cmd = cur;
+		break;
+	    }
+	}
     }
 
     if (cmd == NULL)
-        return;
+	return;
 
     if (req->argc > 2)
     {
-        ngcs_send_response(req, NGCS_TYPE_ERROR, 13, "TOO_MANY_ARGS");
-        return;
+	ngcs_send_response(req, NGCS_TYPE_ERROR, 13, "TOO_MANY_ARGS");
+	return;
     }
 
     if (req->argc == 2 && req->argv[1].type != NGCS_TYPE_STRING)
     {
-        ngcs_send_response(req, NGCS_TYPE_ERROR, 8, "BAD_ARGS");
-        return;
+	ngcs_send_response(req, NGCS_TYPE_ERROR, 8, "BAD_ARGS");
+	return;
     }
 
     if (cmd->opt_type == NO_OPT && req->argc > 1)
     {
-        ngcs_send_response(req, NGCS_TYPE_ERROR, 13, "TOO_MANY_ARGS");
-        return;
+	ngcs_send_response(req, NGCS_TYPE_ERROR, 13, "TOO_MANY_ARGS");
+	return;
     }
 
     if (cmd->opt_type == REQUIRES_OPT && req->argc < 2)
     {
-        ngcs_send_response(req, NGCS_TYPE_ERROR, 12, "TOO_FEW_ARGS");
-        return;
+	ngcs_send_response(req, NGCS_TYPE_ERROR, 12, "TOO_FEW_ARGS");
+	return;
     }
 
     arg = req->argc > 1 ? req->argv[1].d.s : NULL;
 
     switch (cmd->com_type)
     {
-        case TRUE_OR_FALSE_COMMAND:
-        case INT_COMMAND:
-            assert(cmd->u.int_command_call);
-
-            ret = cmd->u.int_command_call(arg);
-            ngcs_send_response(req, (cmd->com_type == INT_COMMAND ?
-                                     NGCS_TYPE_INT : NGCS_TYPE_BOOL),
-                               sizeof(int), (char *) &ret);
-            break;
-
-        case VOID_COMMAND:
-            assert(cmd->u.void_command_call);
-            cmd->u.void_command_call(arg);
-            ngcs_send_response(req, NGCS_TYPE_NULL, 0, NULL);
-            break;
-
-        case STRING_COMMAND:
-            assert(cmd->u.string_command_call);
-            sret = cmd->u.string_command_call(arg);
-            if (sret)
-                ngcs_send_response(req, NGCS_TYPE_STRING, strlen(sret), sret);
-            else
-                ngcs_send_response(req, NGCS_TYPE_NULL, 0, NULL);
-            break;
-
-            /* case DATA_COMMAND: - TODO */
-
-        default:
-            F_("Unknown s_command command type\n");
-            ngcs_send_response(req, NGCS_TYPE_ERROR, 12, "INTERNAL_ERROR");
-            return;
+	case TRUE_OR_FALSE_COMMAND:
+	case INT_COMMAND:
+	    assert(cmd->u.int_command_call);
+
+	    ret = cmd->u.int_command_call(arg);
+	    ngcs_send_response(req, (cmd->com_type == INT_COMMAND ?
+				     NGCS_TYPE_INT : NGCS_TYPE_BOOL),
+			       sizeof(int), (char *) &ret);
+	    break;
+
+	case VOID_COMMAND:
+	    assert(cmd->u.void_command_call);
+	    cmd->u.void_command_call(arg);
+	    ngcs_send_response(req, NGCS_TYPE_NULL, 0, NULL);
+	    break;
+
+	case STRING_COMMAND:
+	    assert(cmd->u.string_command_call);
+	    sret = cmd->u.string_command_call(arg);
+	    if (sret)
+		ngcs_send_response(req, NGCS_TYPE_STRING, strlen(sret), sret);
+	    else
+		ngcs_send_response(req, NGCS_TYPE_NULL, 0, NULL);
+	    break;
+
+	    /* case DATA_COMMAND: - TODO */
+
+	default:
+	    F_("Unknown s_command command type\n");
+	    ngcs_send_response(req, NGCS_TYPE_ERROR, 12, "INTERNAL_ERROR");
+	    return;
 
     }
 
@@ -389,16 +389,16 @@
 
     while_ngcs_dead_conns_safe(curr, tmp)
     {
-        ngcs_conn_free(curr->conn);
-        list_del(&curr->list);
-        free(curr);
+	ngcs_conn_free(curr->conn);
+	list_del(&curr->list);
+	free(curr);
     }
 }
 
 ngcs_chan *ngcs_open_channel(ngcs_conn * conn,
-                             void (*gotdata) (ngcs_chan *, int, int,
-                                              char *),
-                             void (*chanfree) (ngcs_chan *))
+			     void (*gotdata) (ngcs_chan *, int, int,
+					      char *),
+			     void (*chanfree) (ngcs_chan *))
 {
     ngcs_svr_conn *sconn = (ngcs_svr_conn *) conn->userdata;
 
@@ -412,11 +412,11 @@
 }
 
 int ngcs_send_response(ngcs_request * req, int type, int len,
-                       const char *data)
+		       const char *data)
 {
     assert(req);
     if (req->sent_resp_flag)
-        return 1;
+	return 1;
     req->sent_resp_flag = 1;
     return ngcs_chan_send(req->chan, type, len, data);
 }
@@ -451,8 +451,8 @@
     client = socket(PF_UNIX, SOCK_STREAM, 0);
     if (client < 0)
     {
-        F_("Failed to init socket\n");
-        return FALSE;
+	F_("Failed to init socket\n");
+	return FALSE;
     }
 
     /* Bind a name to the socket. */
@@ -462,19 +462,19 @@
 
     /* Try to connect */
     if (connect
-        (client, (struct sockaddr *) &sockname,
-         (strlen(sockname.sun_path) + sizeof(sockname.sun_family))) < 0)
+	(client, (struct sockaddr *) &sockname,
+	 (strlen(sockname.sun_path) + sizeof(sockname.sun_family))) < 0)
     {
-        close(client);
-        return FALSE;
+	close(client);
+	return FALSE;
     }
 
     D_("Sending PING..\n");
     if (ngcs_sendmsg(NGCS_PING, 0, 123, NULL, 0)) ;
     {
-        F_("Unable to send PING!\n");
-        close(client);
-        return (FALSE);
+	F_("Unable to send PING!\n");
+	close(client);
+	return (FALSE);
     }
     D_("PING sent..\n");
 
@@ -485,9 +485,9 @@
     D_("Reading PONG..\n");
     if (ngcs_recvall(client, &head, sizeof(head)))
     {
-        F_("Unable to receive PONG!\n");
-        close(client);
-        return (FALSE);
+	F_("Unable to receive PONG!\n");
+	close(client);
+	return (FALSE);
     }
 
     D_("Got pong\n");
@@ -508,33 +508,33 @@
 
     /* Make /dev/initng if it doesn't exist (try either way) */
     if (mkdir(SOCKET_ROOTPATH, S_IRUSR | S_IWUSR | S_IXUSR) == -1
-        && errno != EEXIST)
+	&& errno != EEXIST)
     {
-        if (errno != EROFS)
-            F_("Could not create " SOCKET_ROOTPATH
-               " : %s, may be / fs not mounted read-write yet?, will retry until I succeed.\n",
-               strerror(errno));
-        return (FALSE);
+	if (errno != EROFS)
+	    F_("Could not create " SOCKET_ROOTPATH
+	       " : %s, may be / fs not mounted read-write yet?, will retry until I succeed.\n",
+	       strerror(errno));
+	return (FALSE);
     }
 
     /* chmod root path for root use only */
     if (chmod(SOCKET_ROOTPATH, S_IRUSR | S_IWUSR | S_IXUSR) == -1)
     {
-        /* path doesn't exist, we don't have /dev yet. */
-        if (errno == ENOENT || errno == EROFS)
-            return (FALSE);
+	/* path doesn't exist, we don't have /dev yet. */
+	if (errno == ENOENT || errno == EROFS)
+	    return (FALSE);
 
-        F_("CRITICAL, failed to chmod %s, THIS IS A SECURITY PROBLEM.\n",
-           SOCKET_ROOTPATH);
+	F_("CRITICAL, failed to chmod %s, THIS IS A SECURITY PROBLEM.\n",
+	   SOCKET_ROOTPATH);
     }
 
     /* Create the socket. */
     fdh.fds = socket(PF_UNIX, SOCK_STREAM, 0);
     if (fdh.fds < 1)
     {
-        F_("Failed to init socket (%s)\n", strerror(errno));
-        fdh.fds = -1;
-        return (FALSE);
+	F_("Failed to init socket (%s)\n", strerror(errno));
+	fdh.fds = -1;
+	return (FALSE);
     }
 
     /* Bind a name to the socket. */
@@ -547,24 +547,24 @@
 
     /* Try to bind */
     if (bind
-        (fdh.fds, (struct sockaddr *) &serv_sockname,
-         (strlen(serv_sockname.sun_path) +
-          sizeof(serv_sockname.sun_family))) < 0)
-    {
-        F_("Error binding to socket (errno: %d str: '%s')\n", errno,
-           strerror(errno));
-        closesock();
-        unlink(serv_sockname.sun_path);
-        return (FALSE);
+	(fdh.fds, (struct sockaddr *) &serv_sockname,
+	 (strlen(serv_sockname.sun_path) +
+	  sizeof(serv_sockname.sun_family))) < 0)
+    {
+	F_("Error binding to socket (errno: %d str: '%s')\n", errno,
+	   strerror(errno));
+	closesock();
+	unlink(serv_sockname.sun_path);
+	return (FALSE);
     }
 
     /* chmod socket for root only use */
     if (chmod(serv_sockname.sun_path, S_IRUSR | S_IWUSR) == -1)
     {
-        F_("CRITICAL, failed to chmod %s, THIS IS A SECURITY PROBLEM.\n",
-           serv_sockname.sun_path);
-        closesock();
-        return (FALSE);
+	F_("CRITICAL, failed to chmod %s, THIS IS A SECURITY PROBLEM.\n",
+	   serv_sockname.sun_path);
+	closesock();
+	return (FALSE);
     }
 
     /* store sock_stat for checking if we need to recreate socket later */
@@ -573,10 +573,10 @@
     /* Listen to socket */
     if (listen(fdh.fds, 5))
     {
-        F_("Error on listen (errno: %d str: '%s')\n", errno, strerror(errno));
-        closesock();
-        unlink(serv_sockname.sun_path);
-        return (FALSE);
+	F_("Error on listen (errno: %d str: '%s')\n", errno, strerror(errno));
+	closesock();
+	unlink(serv_sockname.sun_path);
+	return (FALSE);
     }
 
     /* Run check : */
@@ -600,27 +600,27 @@
     /* Check if socket needs reopening */
     if (fdh.fds <= 0)
     {
-        D_("fdh.fds not set, opening new socket.\n");
-        open_socket();
-        return;
+	D_("fdh.fds not set, opening new socket.\n");
+	open_socket();
+	return;
     }
 
     /* stat the socket, reopen on failure */
     memset(&st, 0, sizeof(st));
     if (stat(socket_filename, &st) < 0)
     {
-        W_("Stat failed! Opening new socket.\n");
-        open_socket();
-        return;
+	W_("Stat failed! Opening new socket.\n");
+	open_socket();
+	return;
     }
 
     /* compare socket file, with the one that we know, reopen on failure */
     if (st.st_dev != sock_stat.st_dev || st.st_ino != sock_stat.st_ino
-        || st.st_mtime != sock_stat.st_mtime)
+	|| st.st_mtime != sock_stat.st_mtime)
     {
-        F_("Invalid socket found, reopening\n");
-        open_socket();
-        return;
+	F_("Invalid socket found, reopening\n");
+	open_socket();
+	return;
     }
 
     D_("Socket ok.\n");
@@ -632,7 +632,7 @@
 {
     /* only try open, when a service got up */
     if (IS_UP(service))
-        check_socket();
+	check_socket();
 
     return (TRUE);
 }
@@ -643,8 +643,8 @@
 
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     /* zero globals */
@@ -656,9 +656,9 @@
 
     /* decide which socket to use */
     if (g.i_am_init)
-        socket_filename = SOCKET_FILENAME_REAL;
+	socket_filename = SOCKET_FILENAME_REAL;
     else
-        socket_filename = SOCKET_FILENAME_TEST;
+	socket_filename = SOCKET_FILENAME_TEST;
     D_("Socket is: %s\n", socket_filename);
 
     D_("adding hook, that will reopen socket, for every started service.\n");
@@ -686,7 +686,7 @@
     closesock();
     while_ngcs_conns_safe(curr, tmp)
     {
-        ngcs_conn_free(curr->conn);
+	ngcs_conn_free(curr->conn);
     }
     clean_dead_conns();
 

Modified: initng/trunk/plugins/ngcs/initng_ngcs.h
==============================================================================
--- initng/trunk/plugins/ngcs/initng_ngcs.h	(original)
+++ initng/trunk/plugins/ngcs/initng_ngcs.h	Wed Apr  5 22:57:12 2006
@@ -81,9 +81,9 @@
  * \sa ngcs_chan_reg
  */
 ngcs_chan *ngcs_open_channel(ngcs_conn * conn,
-                             void (*gotdata) (ngcs_chan *, int, int,
-                                              char *),
-                             void (*chanfree) (ngcs_chan *));
+			     void (*gotdata) (ngcs_chan *, int, int,
+					      char *),
+			     void (*chanfree) (ngcs_chan *));
 
 /* \brief Send a response to a request
  *
@@ -99,7 +99,7 @@
  * \sa ngcs_sendmsg() ngcs_cmd
  */
 int ngcs_send_response(ngcs_request * req, int type, int len,
-                       const char *data);
+		       const char *data);
 
 /*! \brief Ngcs command handler
  *

Modified: initng/trunk/plugins/ngcs/initng_ngcs_cmds.c
==============================================================================
--- initng/trunk/plugins/ngcs/initng_ngcs_cmds.c	(original)
+++ initng/trunk/plugins/ngcs/initng_ngcs_cmds.c	Wed Apr  5 22:57:12 2006
@@ -77,7 +77,7 @@
 static void ngcs_cmd_watch(ngcs_request * req);
 static void ngcs_free_watch(ngcs_chan * chan);
 static int service_output_watch(active_db_h * service, process_h * x,
-                                char *buffer_pos);
+				char *buffer_pos);
 static ngcs_watch *ngcs_add_watch(ngcs_conn * conn, char *svcname, int flags);
 static void ngcs_cmd_start(ngcs_request * req);
 static int ngcs_watch_initial(ngcs_watch * watch);
@@ -89,7 +89,7 @@
 static void ngcs_cmd_swatch(ngcs_request * req);
 static void ngcs_cmd_ewatch(ngcs_request * req);
 static int error_watch(e_mt mt, const char *file, const char *func,
-                       int line, const char *format, va_list arg);
+		       int line, const char *format, va_list arg);
 
 ngcs_cmd ngcs_start_cmd = {
     "start",
@@ -158,12 +158,12 @@
 
     list_for_each_entry_prev_safe(watch, nextwatch, &swatches.list, list)
     {
-        ngcs_chan_send(watch->chan, NGCS_TYPE_INT, sizeof(int), (char *) &i);
+	ngcs_chan_send(watch->chan, NGCS_TYPE_INT, sizeof(int), (char *) &i);
     }
 }
 
 static int error_watch(e_mt mt, const char *file, const char *func,
-                       int line, const char *format, va_list arg)
+		       int line, const char *format, va_list arg)
 {
     ngcs_genwatch *watch, *nextwatch;
     int len, size;
@@ -173,7 +173,7 @@
 
     /* Don't do the processing if we're just going to throw away the result */
     if (list_empty(&ewatches.list))
-        return FALSE;
+	return FALSE;
 
     dat[0].type = NGCS_TYPE_INT;
     dat[0].d.i = mt;
@@ -193,24 +193,24 @@
     len = vsnprintf(dat[4].d.s, 256, format, arg);
     while (len < 0 || len >= size)
     {
-        /* Some glibc versions apparently return -1 if buffer too small */
-        size = (len < 0 ? size * 2 : len + 1);
-        free(dat[4].d.s);
-        dat[4].d.s = i_calloc(1, size);
-        len = vsnprintf(dat[4].d.s, 256, format, arg);
+	/* Some glibc versions apparently return -1 if buffer too small */
+	size = (len < 0 ? size * 2 : len + 1);
+	free(dat[4].d.s);
+	dat[4].d.s = i_calloc(1, size);
+	len = vsnprintf(dat[4].d.s, 256, format, arg);
     }
     dat[4].len = len;
 
     len = ngcs_pack(dat, 5, NULL);
     assert(len >= 0);
     buf = i_calloc(1, len);
-    assert(buf);                            /* should always succeed */
+    assert(buf);			    /* should always succeed */
     len = ngcs_pack(dat, 5, buf);
     assert(len >= 0);
 
     list_for_each_entry_prev_safe(watch, nextwatch, &ewatches.list, list)
     {
-        ngcs_chan_send(watch->chan, NGCS_TYPE_STRUCT, len, buf);
+	ngcs_chan_send(watch->chan, NGCS_TYPE_STRUCT, len, buf);
     }
 
     free(dat[4].d.s);
@@ -227,25 +227,25 @@
     len = ngcs_marshal_active_db_h(service, NULL);
     list_for_each_entry_prev_safe(watch, nextwatch, &watches.list, list)
     {
-        if ((watch->flags & NGCS_WATCH_STATUS) &&
-            (watch->name == NULL || strcmp(watch->name, service->name) == 0))
-        {
-            if (!buf)
-            {
-                buf = i_calloc(1, len);
-                len = ngcs_marshal_active_db_h(service, buf);
-                if (len < 0)
-                {
-                    F_("ngcs_marshal_active_db_h() failed!\n");
-                    free(buf);
-                    return TRUE;
-                }
-            }
-            ngcs_chan_send(watch->chan, NGCS_TYPE_STRUCT, len, buf);
-        }
+	if ((watch->flags & NGCS_WATCH_STATUS) &&
+	    (watch->name == NULL || strcmp(watch->name, service->name) == 0))
+	{
+	    if (!buf)
+	    {
+		buf = i_calloc(1, len);
+		len = ngcs_marshal_active_db_h(service, buf);
+		if (len < 0)
+		{
+		    F_("ngcs_marshal_active_db_h() failed!\n");
+		    free(buf);
+		    return TRUE;
+		}
+	    }
+	    ngcs_chan_send(watch->chan, NGCS_TYPE_STRUCT, len, buf);
+	}
     }
     if (buf)
-        free(buf);
+	free(buf);
     return TRUE;
 }
 
@@ -253,44 +253,44 @@
 {
     if (watch->flags & NGCS_CURRENT_STATUS)
     {
-        active_db_h *current;
+	active_db_h *current;
 
-        current = NULL;
-        while_active_db(current)
-        {
-            if (watch->name == NULL
-                || strcmp(watch->name, current->name) == 0)
-            {
-                int len = 0;
-                char *buf = NULL;
-
-                len = ngcs_marshal_active_db_h(current, NULL);
-                buf = i_calloc(1, len);
-                len = ngcs_marshal_active_db_h(current, buf);
-                if (len < 0)
-                {
-                    F_("ngcs_marshal_active_db_h() failed!\n");
-                    free(buf);
-                    return 1;
-                }
-                if (ngcs_chan_send(watch->chan, NGCS_TYPE_STRUCT, len, buf))
-                {
-                    free(buf);
-                    return 1;
-                };
-                free(buf);
-            }
-        }
+	current = NULL;
+	while_active_db(current)
+	{
+	    if (watch->name == NULL
+		|| strcmp(watch->name, current->name) == 0)
+	    {
+		int len = 0;
+		char *buf = NULL;
+
+		len = ngcs_marshal_active_db_h(current, NULL);
+		buf = i_calloc(1, len);
+		len = ngcs_marshal_active_db_h(current, buf);
+		if (len < 0)
+		{
+		    F_("ngcs_marshal_active_db_h() failed!\n");
+		    free(buf);
+		    return 1;
+		}
+		if (ngcs_chan_send(watch->chan, NGCS_TYPE_STRUCT, len, buf))
+		{
+		    free(buf);
+		    return 1;
+		};
+		free(buf);
+	    }
+	}
     }
 
     if (ngcs_chan_send(watch->chan, NGCS_TYPE_NULL, 0, NULL))
-        return 1;
+	return 1;
 
     return 0;
 }
 
 static int service_output_watch(active_db_h * service, process_h * x,
-                                char *buffer_pos)
+				char *buffer_pos)
 {
     ngcs_watch *watch, *nextwatch;
     ngcs_data dat[2];
@@ -306,26 +306,26 @@
 
     list_for_each_entry_prev_safe(watch, nextwatch, &watches.list, list)
     {
-        if ((watch->flags & NGCS_WATCH_OUTPUT) &&
-            (watch->name == NULL || strcmp(watch->name, service->name) == 0))
-        {
-            if (!buf)
-            {
-                len = ngcs_pack(dat, 2, NULL);
-                assert(len >= 0);
-                buf = i_calloc(1, len);
-                len = ngcs_pack(dat, 2, buf);
-                assert(len >= 0);
-            }
-            if (ngcs_chan_send(watch->chan, NGCS_TYPE_STRUCT, len, buf))
-            {
-                free(buf);
-                return FALSE;
-            };
-        }
+	if ((watch->flags & NGCS_WATCH_OUTPUT) &&
+	    (watch->name == NULL || strcmp(watch->name, service->name) == 0))
+	{
+	    if (!buf)
+	    {
+		len = ngcs_pack(dat, 2, NULL);
+		assert(len >= 0);
+		buf = i_calloc(1, len);
+		len = ngcs_pack(dat, 2, buf);
+		assert(len >= 0);
+	    }
+	    if (ngcs_chan_send(watch->chan, NGCS_TYPE_STRUCT, len, buf))
+	    {
+		free(buf);
+		return FALSE;
+	    };
+	}
     }
     if (buf)
-        free(buf);
+	free(buf);
     return FALSE;
 }
 
@@ -337,11 +337,11 @@
     char *svcname = NULL;
 
     if (req->argc != 2 || req->argv[1].type != NGCS_TYPE_STRING ||
-        req->argv[1].len <= 0)
+	req->argv[1].len <= 0)
     {
-        F_("Bad call to ngcs command 'stop'\n");
-        ngcs_send_response(req, NGCS_TYPE_STRING, 8, "BAD_CALL");
-        return;
+	F_("Bad call to ngcs command 'stop'\n");
+	ngcs_send_response(req, NGCS_TYPE_STRING, 8, "BAD_CALL");
+	return;
     }
 
     svcname = req->argv[1].d.s;
@@ -349,15 +349,15 @@
     serv = initng_active_db_find_in_name(svcname);
     if (!serv)
     {
-        ngcs_send_response(req, NGCS_TYPE_STRING, 9, "NOT_FOUND");
-        return;
+	ngcs_send_response(req, NGCS_TYPE_STRING, 9, "NOT_FOUND");
+	return;
     }
 
     watch = ngcs_add_watch(req->conn, serv->name,
-                           NGCS_WATCH_STATUS | NGCS_WATCH_OUTPUT |
-                           NGCS_CURRENT_STATUS);
+			   NGCS_WATCH_STATUS | NGCS_WATCH_OUTPUT |
+			   NGCS_CURRENT_STATUS);
     if (watch)
-        i = watch->chan->id;
+	i = watch->chan->id;
     ngcs_send_response(req, NGCS_TYPE_INT, sizeof(int), (char *) &i);
     ngcs_watch_initial(watch);
     initng_handler_stop_service(serv);
@@ -373,11 +373,11 @@
     char *svcname = NULL;
 
     if (req->argc != 2 || req->argv[1].type != NGCS_TYPE_STRING ||
-        req->argv[1].len <= 0)
+	req->argv[1].len <= 0)
     {
-        F_("Bad call to ngcs command 'start'\n");
-        ngcs_send_response(req, NGCS_TYPE_STRING, 8, "BAD_CALL");
-        return;
+	F_("Bad call to ngcs command 'start'\n");
+	ngcs_send_response(req, NGCS_TYPE_STRING, 8, "BAD_CALL");
+	return;
     }
 
     svcname = req->argv[1].d.s;
@@ -385,29 +385,29 @@
     serv = initng_active_db_find_in_name(svcname);
     if (serv)
     {
-        watch = ngcs_add_watch(req->conn, serv->name,
-                               NGCS_WATCH_STATUS | NGCS_WATCH_OUTPUT |
-                               NGCS_CURRENT_STATUS);
-        if (watch)
-            i = watch->chan->id;
-        ngcs_send_response(req, NGCS_TYPE_INT, sizeof(int), (char *) &i);
-        ngcs_watch_initial(watch);
-        if (!IS_UP(serv))
-            initng_handler_start_service(serv);
-        return;
+	watch = ngcs_add_watch(req->conn, serv->name,
+			       NGCS_WATCH_STATUS | NGCS_WATCH_OUTPUT |
+			       NGCS_CURRENT_STATUS);
+	if (watch)
+	    i = watch->chan->id;
+	ngcs_send_response(req, NGCS_TYPE_INT, sizeof(int), (char *) &i);
+	ngcs_watch_initial(watch);
+	if (!IS_UP(serv))
+	    initng_handler_start_service(serv);
+	return;
     }
 
     serv = initng_handler_start_new_service_named(svcname);
     if (!serv)
     {
-        ngcs_send_response(req, NGCS_TYPE_STRING, 9, "NOT_FOUND");
-        return;
+	ngcs_send_response(req, NGCS_TYPE_STRING, 9, "NOT_FOUND");
+	return;
     }
 
     watch = ngcs_add_watch(req->conn, serv->name,
-                           NGCS_WATCH_STATUS | NGCS_WATCH_OUTPUT);
+			   NGCS_WATCH_STATUS | NGCS_WATCH_OUTPUT);
     if (watch)
-        i = watch->chan->id;
+	i = watch->chan->id;
     ngcs_send_response(req, NGCS_TYPE_INT, sizeof(int), (char *) &i);
     ngcs_watch_initial(watch);
     return;
@@ -424,14 +424,14 @@
     chan = ngcs_open_channel(conn, NULL, ngcs_free_watch);
     if (!chan)
     {
-        F_("ngcs_open_channel failed!\n");
-        free(watch);
-        return 0;
+	F_("ngcs_open_channel failed!\n");
+	free(watch);
+	return 0;
     }
     if (svcname)
-        watch->name = i_strdup(svcname);
+	watch->name = i_strdup(svcname);
     else
-        watch->name = NULL;
+	watch->name = NULL;
     watch->flags = flags;
     watch->chan = chan;
     watch->list.prev = 0;
@@ -452,9 +452,9 @@
     chan = ngcs_open_channel(req->conn, NULL, &ngcs_free_genwatch);
     if (!chan)
     {
-        F_("ngcs_open_channel failed!\n");
-        free(watch);
-        return;
+	F_("ngcs_open_channel failed!\n");
+	free(watch);
+	return;
     }
     watch->chan = chan;
     watch->list.prev = 0;
@@ -476,9 +476,9 @@
     chan = ngcs_open_channel(req->conn, NULL, &ngcs_free_genwatch);
     if (!chan)
     {
-        F_("ngcs_open_channel failed!\n");
-        free(watch);
-        return;
+	F_("ngcs_open_channel failed!\n");
+	free(watch);
+	return;
     }
     watch->chan = chan;
     watch->list.prev = 0;
@@ -496,21 +496,21 @@
     char *name;
 
     if (req->argc != 3 || req->argv[1].type != NGCS_TYPE_INT ||
-        (req->argv[2].type != NGCS_TYPE_STRING && req->argv[2].type !=
-         NGCS_TYPE_NULL))
+	(req->argv[2].type != NGCS_TYPE_STRING && req->argv[2].type !=
+	 NGCS_TYPE_NULL))
     {
-        F_("Bad watch command\n");
-        ngcs_send_response(req, NGCS_TYPE_INT, sizeof(int), (char *) &i);
-        return;
+	F_("Bad watch command\n");
+	ngcs_send_response(req, NGCS_TYPE_INT, sizeof(int), (char *) &i);
+	return;
     }
     if (req->argv[2].type == NGCS_TYPE_NULL || req->argv[2].d.s[0] == '\0')
-        name = NULL;
+	name = NULL;
     else
-        name = req->argv[2].d.s;
+	name = req->argv[2].d.s;
 
     watch = ngcs_add_watch(req->conn, name, req->argv[1].d.i);
     if (watch)
-        i = watch->chan->id;
+	i = watch->chan->id;
     ngcs_send_response(req, NGCS_TYPE_INT, sizeof(int), (char *) &i);
     ngcs_watch_initial(watch);
 }
@@ -520,10 +520,10 @@
     ngcs_watch *watch = chan->user_data;
 
     if (!watch)
-        return;
+	return;
     list_del(&watch->list);
     if (watch->name)
-        free(watch->name);
+	free(watch->name);
     free(watch);
     chan->user_data = 0;
 }
@@ -533,7 +533,7 @@
     ngcs_genwatch *watch = chan->user_data;
 
     if (!watch)
-        return;
+	return;
     list_del(&watch->list);
     free(watch);
     chan->user_data = 0;
@@ -582,14 +582,14 @@
 
     if (req->argc != 2 || req->argv[1].type != NGCS_TYPE_STRING)
     {
-        ngcs_send_response(req, NGCS_TYPE_NULL, 0, NULL);
-        return;
+	ngcs_send_response(req, NGCS_TYPE_NULL, 0, NULL);
+	return;
     }
 
     if (!(apt = initng_active_db_find_in_name(req->argv[1].d.s)))
     {
-        ngcs_send_response(req, NGCS_TYPE_STRING, 9, "NOT_FOUND");
-        return;
+	ngcs_send_response(req, NGCS_TYPE_STRING, 9, "NOT_FOUND");
+	return;
     }
 
     initng_active_db_del(apt);
@@ -616,24 +616,24 @@
 
     if (retval == TRUE)
     {
-        ngcs_send_response(req, NGCS_TYPE_BOOL, sizeof(int), (char *) &i);
-        D_("exec()ing initng\n");
-        new_argv[0] = i_strdup("/sbin/initng");
-        new_argv[1] = i_strdup("--hot_reload");
-        new_argv[2] = NULL;
+	ngcs_send_response(req, NGCS_TYPE_BOOL, sizeof(int), (char *) &i);
+	D_("exec()ing initng\n");
+	new_argv[0] = i_strdup("/sbin/initng");
+	new_argv[1] = i_strdup("--hot_reload");
+	new_argv[2] = NULL;
 
-        execve("/sbin/initng", new_argv, environ);
-        F_("Failed to reload initng!\n");
+	execve("/sbin/initng", new_argv, environ);
+	F_("Failed to reload initng!\n");
     }
     else if (retval == FALSE)
     {
-        F_("No plugin was willing to dump state\n");
-        ngcs_send_response(req, NGCS_TYPE_ERROR, 13,
-                           (char *) "NOT_AVAILABLE");
+	F_("No plugin was willing to dump state\n");
+	ngcs_send_response(req, NGCS_TYPE_ERROR, 13,
+			   (char *) "NOT_AVAILABLE");
     }
     else
     {
-        F_("dump_state failed!\n");
-        ngcs_send_response(req, NGCS_TYPE_ERROR, 10, (char *) "DUMP_ERROR");
+	F_("dump_state failed!\n");
+	ngcs_send_response(req, NGCS_TYPE_ERROR, 10, (char *) "DUMP_ERROR");
     }
 }

Modified: initng/trunk/plugins/ngcs/ngcs_common.c
==============================================================================
--- initng/trunk/plugins/ngcs/ngcs_common.c	(original)
+++ initng/trunk/plugins/ngcs/ngcs_common.c	Wed Apr  5 22:57:12 2006
@@ -29,16 +29,16 @@
     int head[3];
 
     if (len > 0)
-        assert(data);
+	assert(data);
     head[0] = chan;
     head[1] = type;
     head[2] = len;
     if (ngcs_sendall(sock, head, 3 * sizeof(int)))
-        return 1;
+	return 1;
     if (len <= 0)
-        return 0;
+	return 0;
     if (ngcs_sendall(sock, data, len))
-        return 1;
+	return 1;
     return 0;
 }
 
@@ -52,20 +52,20 @@
     assert(data);
 
     if (ngcs_recvall(sock, head, 3 * sizeof(int)))
-        return 1;
+	return 1;
     *chan = head[0];
     *type = head[1];
     *len = head[2];
     if (*len < 0)
     {
-        *data = NULL;
-        return 0;
+	*data = NULL;
+	return 0;
     }
     *data = malloc(*len);
     if (*data == NULL)
-        return 1;
+	return 1;
     if (ngcs_recvall(sock, *data, *len))
-        return 1;
+	return 1;
     return 0;
 }
 
@@ -76,62 +76,62 @@
 
     for (n = 0; n < cnt; n++)
     {
-        if (buf)
-        {
-            *(int *) buf = data[n].type;
-            buf += sizeof(int);
-        }
-        switch (data[n].type)
-        {
-            case NGCS_TYPE_INT:
-            case NGCS_TYPE_BOOL:
-                outcnt += 3 * sizeof(int);
-                if (buf)
-                {
-                    *(int *) buf = sizeof(int);
-                    buf += sizeof(int);
-                    *(int *) buf = data[n].d.i;
-                    buf += sizeof(int);
-                }
-                break;
-            case NGCS_TYPE_LONG:
-                outcnt += 2 * sizeof(int) + sizeof(long);
-                if (buf)
-                {
-                    *(int *) buf = sizeof(long);
-                    buf += sizeof(int);
-                    *(int *) buf = data[n].d.l;
-                    buf += sizeof(long);
-                }
-                break;
-            case NGCS_TYPE_ERROR:
-            case NGCS_TYPE_STRING:
-                if (data[n].len < 0)
-                    data[n].len = strlen(data[n].d.s);
-                outcnt += 2 * sizeof(int) + data[n].len;
-                if (buf)
-                {
-                    *(int *) buf = data[n].len;
-                    buf += sizeof(int);
-                    if (data[n].len)
-                        memcpy(buf, data[n].d.s, data[n].len);
-                    buf += data[n].len;
-                }
-                break;
-            default:
-                if (data[n].len < 0)
-                    return 1;
-                outcnt += 2 * sizeof(int) + data[n].len;
-                if (buf)
-                {
-                    *(int *) buf = data[n].len;
-                    buf += sizeof(int);
-                    if (data[n].len)
-                        memcpy(buf, data[n].d.p, data[n].len);
-                    buf += data[n].len;
-                }
-                break;
-        }
+	if (buf)
+	{
+	    *(int *) buf = data[n].type;
+	    buf += sizeof(int);
+	}
+	switch (data[n].type)
+	{
+	    case NGCS_TYPE_INT:
+	    case NGCS_TYPE_BOOL:
+		outcnt += 3 * sizeof(int);
+		if (buf)
+		{
+		    *(int *) buf = sizeof(int);
+		    buf += sizeof(int);
+		    *(int *) buf = data[n].d.i;
+		    buf += sizeof(int);
+		}
+		break;
+	    case NGCS_TYPE_LONG:
+		outcnt += 2 * sizeof(int) + sizeof(long);
+		if (buf)
+		{
+		    *(int *) buf = sizeof(long);
+		    buf += sizeof(int);
+		    *(int *) buf = data[n].d.l;
+		    buf += sizeof(long);
+		}
+		break;
+	    case NGCS_TYPE_ERROR:
+	    case NGCS_TYPE_STRING:
+		if (data[n].len < 0)
+		    data[n].len = strlen(data[n].d.s);
+		outcnt += 2 * sizeof(int) + data[n].len;
+		if (buf)
+		{
+		    *(int *) buf = data[n].len;
+		    buf += sizeof(int);
+		    if (data[n].len)
+			memcpy(buf, data[n].d.s, data[n].len);
+		    buf += data[n].len;
+		}
+		break;
+	    default:
+		if (data[n].len < 0)
+		    return 1;
+		outcnt += 2 * sizeof(int) + data[n].len;
+		if (buf)
+		{
+		    *(int *) buf = data[n].len;
+		    buf += sizeof(int);
+		    if (data[n].len)
+			memcpy(buf, data[n].d.p, data[n].len);
+		    buf += data[n].len;
+		}
+		break;
+	}
     }
     return outcnt;
 }
@@ -144,13 +144,13 @@
     int cnt = 0;
     while (l >= 2 * (int) sizeof(int))
     {
-        int head[2];
-        memcpy(head, d, 2 * sizeof(int));
-        if (head[1] < 0)
-            return -1;
-        d += 2 * sizeof(int) + head[1];
-        l -= 2 * sizeof(int) + head[1];
-        cnt++;
+	int head[2];
+	memcpy(head, d, 2 * sizeof(int));
+	if (head[1] < 0)
+	    return -1;
+	d += 2 * sizeof(int) + head[1];
+	l -= 2 * sizeof(int) + head[1];
+	cnt++;
     }
     d = data;
     l = len;
@@ -158,71 +158,71 @@
     cnt = 0;
     while (l >= 2 * (int) sizeof(int))
     {
-        int head[2];
-        memcpy(head, d, 2 * sizeof(int));
-        (*res)[cnt].type = head[0];
-        (*res)[cnt].len = head[1];
-        if (head[1] < 0)
-        {
-            free(*res);
-            *res = NULL;
-            return -1;
-        }
-        d += 2 * sizeof(int);
-        l -= 2 * sizeof(int);
-        if (l < (*res)[cnt].len)
-        {
-            free(*res);
-            *res = NULL;
-            return -1;
-        }
-        switch ((*res)[cnt].type)
-        {
-            case NGCS_TYPE_INT:
-            case NGCS_TYPE_BOOL:
-                if ((*res)[cnt].len != sizeof(int))
-                {
-                    free(*res);
-                    *res = NULL;
-                    return -1;
-                }
-                (*res)[cnt].d.i = *(int *) d;
-                break;
-            case NGCS_TYPE_LONG:
-                if ((*res)[cnt].len != sizeof(long))
-                {
-                    free(*res);
-                    *res = NULL;
-                    return -1;
-                }
-                (*res)[cnt].d.i = *(int *) d;
-                break;
-            case NGCS_TYPE_ERROR:
-            case NGCS_TYPE_STRING:
-                (*res)[cnt].d.s = malloc((*res)[cnt].len + 1);
-                if (!(*res)[cnt].d.s)
-                {
-                    free(*res);
-                    *res = NULL;
-                    return -1;
-                }
-                memcpy((*res)[cnt].d.s, d, (*res)[cnt].len);
-                (*res)[cnt].d.s[(*res)[cnt].len] = 0;
-                break;
-            default:
-                (*res)[cnt].d.p = malloc((*res)[cnt].len);
-                if (!(*res)[cnt].d.p)
-                {
-                    free(*res);
-                    *res = NULL;
-                    return -1;
-                }
-                memcpy((*res)[cnt].d.p, d, (*res)[cnt].len);
-                break;
-        }
-        d += (*res)[cnt].len;
-        l -= (*res)[cnt].len;
-        cnt++;
+	int head[2];
+	memcpy(head, d, 2 * sizeof(int));
+	(*res)[cnt].type = head[0];
+	(*res)[cnt].len = head[1];
+	if (head[1] < 0)
+	{
+	    free(*res);
+	    *res = NULL;
+	    return -1;
+	}
+	d += 2 * sizeof(int);
+	l -= 2 * sizeof(int);
+	if (l < (*res)[cnt].len)
+	{
+	    free(*res);
+	    *res = NULL;
+	    return -1;
+	}
+	switch ((*res)[cnt].type)
+	{
+	    case NGCS_TYPE_INT:
+	    case NGCS_TYPE_BOOL:
+		if ((*res)[cnt].len != sizeof(int))
+		{
+		    free(*res);
+		    *res = NULL;
+		    return -1;
+		}
+		(*res)[cnt].d.i = *(int *) d;
+		break;
+	    case NGCS_TYPE_LONG:
+		if ((*res)[cnt].len != sizeof(long))
+		{
+		    free(*res);
+		    *res = NULL;
+		    return -1;
+		}
+		(*res)[cnt].d.i = *(int *) d;
+		break;
+	    case NGCS_TYPE_ERROR:
+	    case NGCS_TYPE_STRING:
+		(*res)[cnt].d.s = malloc((*res)[cnt].len + 1);
+		if (!(*res)[cnt].d.s)
+		{
+		    free(*res);
+		    *res = NULL;
+		    return -1;
+		}
+		memcpy((*res)[cnt].d.s, d, (*res)[cnt].len);
+		(*res)[cnt].d.s[(*res)[cnt].len] = 0;
+		break;
+	    default:
+		(*res)[cnt].d.p = malloc((*res)[cnt].len);
+		if (!(*res)[cnt].d.p)
+		{
+		    free(*res);
+		    *res = NULL;
+		    return -1;
+		}
+		memcpy((*res)[cnt].d.p, d, (*res)[cnt].len);
+		break;
+	}
+	d += (*res)[cnt].len;
+	l -= (*res)[cnt].len;
+	cnt++;
     }
     return cnt;
 }
@@ -233,42 +233,42 @@
 
     for (n = 0; n < len; n++)
     {
-        switch (res[n].type)
-        {
-            case NGCS_TYPE_INT:
-            case NGCS_TYPE_LONG:
-                break;
-            case NGCS_TYPE_STRING:
-                if (res[n].d.s)
-                    free(res[n].d.s);
-                break;
-            default:
-                if (res[n].d.p)
-                    free(res[n].d.p);
-                break;
-        }
+	switch (res[n].type)
+	{
+	    case NGCS_TYPE_INT:
+	    case NGCS_TYPE_LONG:
+		break;
+	    case NGCS_TYPE_STRING:
+		if (res[n].d.s)
+		    free(res[n].d.s);
+		break;
+	    default:
+		if (res[n].d.p)
+		    free(res[n].d.p);
+		break;
+	}
     }
     free(res);
 }
 
 ngcs_conn *ngcs_conn_from_fd(int fd, void *userdata,
-                             void (*close_hook) (ngcs_conn * conn))
+			     void (*close_hook) (ngcs_conn * conn))
 {
     ngcs_conn *conn;
     struct timeval tv;
 
     conn = malloc(sizeof(ngcs_conn));
     if (conn == NULL)
-        return NULL;
+	return NULL;
 
     /* FIXME - should set non-blocking and use buffering */
     tv.tv_sec = 2;
     tv.tv_usec = 0;
     if (setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &tv, sizeof(tv)) ||
-        setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv)))
+	setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv)))
     {
-        /* FIXME - shoupd print error? */
-        return NULL;
+	/* FIXME - shoupd print error? */
+	return NULL;
     }
 
 
@@ -281,14 +281,14 @@
 
 
 ngcs_chan *ngcs_chan_reg(ngcs_conn * conn, int chanid,
-                         void (*gotdata) (ngcs_chan *, int, int,
-                                          char *),
-                         void (*chanfree) (ngcs_chan *))
+			 void (*gotdata) (ngcs_chan *, int, int,
+					  char *),
+			 void (*chanfree) (ngcs_chan *))
 {
     ngcs_chan *chan = malloc(sizeof(ngcs_chan));
 
     if (!chan)
-        return NULL;
+	return NULL;
 
     chan->id = chanid;
     chan->conn = conn;
@@ -304,7 +304,7 @@
 void ngcs_chan_del(ngcs_chan * chan)
 {
     if (chan->conn->fd >= 0 && chan->free)
-        chan->free(chan);
+	chan->free(chan);
     list_del(&chan->list);
     free(chan);
 }
@@ -319,22 +319,22 @@
     /* Get message */
     if (ngcs_recvmsg(conn->fd, &chanid, &type, &len, &data))
     {
-        ngcs_conn_close(conn);
-        return;
+	ngcs_conn_close(conn);
+	return;
     }
 
     /* Dispatch to handler for this channel */
     while_ngcs_chans(chan, conn) if (chan->id == chanid)
     {
-        if (chan->gotdata)
-            chan->gotdata(chan, type, len, data);
-        free(data);
-        return;
+	if (chan->gotdata)
+	    chan->gotdata(chan, type, len, data);
+	free(data);
+	return;
     }
 
     /* Unknown channel - close it */
     if (ngcs_sendmsg(conn->fd, chanid, NGCS_TYPE_NULL, -1, NULL))
-        ngcs_conn_close(conn);
+	ngcs_conn_close(conn);
     free(data);
     return;
 }
@@ -344,16 +344,16 @@
     ngcs_chan *chan, *tmp;
 
     if (conn->fd < 0)
-        return;
+	return;
     close(conn->fd);
     conn->fd = -1;
     while_ngcs_chans_safe(chan, tmp, conn)
     {
-        if (chan->free)
-            chan->free(chan);
+	if (chan->free)
+	    chan->free(chan);
     }
     if (conn->close_hook)
-        conn->close_hook(conn);
+	conn->close_hook(conn);
 }
 
 void ngcs_conn_free(ngcs_conn * conn)
@@ -363,8 +363,8 @@
     ngcs_conn_close(conn);
     while_ngcs_chans_safe(chan, tmp, conn)
     {
-        list_del(&chan->list);
-        free(chan);
+	list_del(&chan->list);
+	free(chan);
     }
     free(conn);
     /* TODO */
@@ -376,16 +376,16 @@
 
     while (len > 0)
     {
-        ret = send(sock, buf, len, 0);
-        if (ret <= 0)
-        {
-            return 1;
-        }
-        else
-        {
-            buf += ret;
-            len -= ret;
-        }
+	ret = send(sock, buf, len, 0);
+	if (ret <= 0)
+	{
+	    return 1;
+	}
+	else
+	{
+	    buf += ret;
+	    len -= ret;
+	}
     }
     return 0;
 }
@@ -396,16 +396,16 @@
 
     while (len > 0)
     {
-        ret = recv(sock, buf, len, 0);
-        if (ret <= 0)
-        {
-            return 1;
-        }
-        else
-        {
-            buf += ret;
-            len -= ret;
-        }
+	ret = recv(sock, buf, len, 0);
+	if (ret <= 0)
+	{
+	    return 1;
+	}
+	else
+	{
+	    buf += ret;
+	    len -= ret;
+	}
     }
     return 0;
 }
@@ -413,11 +413,11 @@
 int ngcs_chan_send(ngcs_chan * chan, int type, int len, const char *data)
 {
     if (chan->conn->fd < 0)
-        return 1;
+	return 1;
     if (ngcs_sendmsg(chan->conn->fd, chan->id, type, len, data))
     {
-        ngcs_conn_close(chan->conn);
-        return 1;
+	ngcs_conn_close(chan->conn);
+	return 1;
     }
     return 0;
 }

Modified: initng/trunk/plugins/ngcs/ngcs_common.h
==============================================================================
--- initng/trunk/plugins/ngcs/ngcs_common.h	(original)
+++ initng/trunk/plugins/ngcs/ngcs_common.h	Wed Apr  5 22:57:12 2006
@@ -94,7 +94,7 @@
 
     /*! \brief A function called when data is received on the channel */
     void (*gotdata) (ngcs_chan *, int /* type */ , int /* len */ ,
-                     char * /* data */ );
+		     char * /* data */ );
 
     /*! \brief A function called when the channel is closed (possibly at 
        connection termination) */
@@ -113,17 +113,17 @@
     int len;
     union
     {
-        /*! \brief The data as an integer, if type == NGCS_TYPE_INT */
-        int i;
+	/*! \brief The data as an integer, if type == NGCS_TYPE_INT */
+	int i;
 
-        /*! \brief The data as a long, if type == NGCS_TYPE_LONG */
-        long l;
+	/*! \brief The data as a long, if type == NGCS_TYPE_LONG */
+	long l;
 
-        /*! \brief The data as a null-terminated string, if type == NGCS_TYPE_STRING */
-        char *s;
+	/*! \brief The data as a null-terminated string, if type == NGCS_TYPE_STRING */
+	char *s;
 
-        /*! \brief The raw data, in cases not specifically covered */
-        void *p;
+	/*! \brief The raw data, in cases not specifically covered */
+	void *p;
     } d;
 } ngcs_data;
 
@@ -253,7 +253,7 @@
  *        careful what you put in it.
  */
 ngcs_conn *ngcs_conn_from_fd(int fd, void *userdata,
-                             void (*close_hook) (ngcs_conn * conn));
+			     void (*close_hook) (ngcs_conn * conn));
 
 /*! \brief Registers a channel handler on the specified connection
  * 
@@ -271,9 +271,9 @@
  *         free it), or NULL on failure
  */
 ngcs_chan *ngcs_chan_reg(ngcs_conn * conn, int chanid,
-                         void (*gotdata) (ngcs_chan *, int, int,
-                                          char *),
-                         void (*chanfree) (ngcs_chan *));
+			 void (*gotdata) (ngcs_chan *, int, int,
+					  char *),
+			 void (*chanfree) (ngcs_chan *));
 
 /*! \brief Unregisters the specified channel handler
  *

Modified: initng/trunk/plugins/nge/initng_nge.c
==============================================================================
--- initng/trunk/plugins/nge/initng_nge.c	(original)
+++ initng/trunk/plugins/nge/initng_nge.c	Wed Apr  5 22:57:12 2006
@@ -75,9 +75,9 @@
 static int astatus_change(active_db_h * service);
 static void system_state_change(e_is state);
 static int system_pipe_watchers(active_db_h * service, process_h * process,
-                                char *output);
+				char *output);
 static int print_error(e_mt mt, const char *file, const char *func, int line,
-                       const char *format, va_list arg);
+		       const char *format, va_list arg);
 
 /* todo, when last lissener closed, del hooks to save cpu cykles */
 
@@ -89,13 +89,13 @@
 
     for (i = 0; i < MAX_LISSENERS; i++)
     {
-        if (lisseners[i] > 0)
-        {
-            send(lisseners[i], "</disconnect>\n", sizeof(char) * 16, 0);
-
-            close(lisseners[i]);
-            lisseners[i] = -1;
-        }
+	if (lisseners[i] > 0)
+	{
+	    send(lisseners[i], "</disconnect>\n", sizeof(char) * 16, 0);
+
+	    close(lisseners[i]);
+	    lisseners[i] = -1;
+	}
     }
 }
 
@@ -103,20 +103,20 @@
 {
     /* Check if we need to remove hooks */
     if (fd_event_acceptor.fds < 0)
-        return;
+	return;
 
     /* only remove if hook is added */
     if (is_active)
     {
-        /*
-         * UnRegister that hooks, that we forwards events from.
-         */
-        initng_plugin_hook_del(&g.ASTATUS_CHANGE, &astatus_change);
-        initng_plugin_hook_del(&g.SWATCHERS, &system_state_change);
-        initng_plugin_hook_del(&g.PIPEWATCHERS, &system_pipe_watchers);
-        initng_plugin_hook_del(&g.ERR_MSG, &print_error);
+	/*
+	 * UnRegister that hooks, that we forwards events from.
+	 */
+	initng_plugin_hook_del(&g.ASTATUS_CHANGE, &astatus_change);
+	initng_plugin_hook_del(&g.SWATCHERS, &system_state_change);
+	initng_plugin_hook_del(&g.PIPEWATCHERS, &system_pipe_watchers);
+	initng_plugin_hook_del(&g.ERR_MSG, &print_error);
 
-        is_active = FALSE;
+	is_active = FALSE;
     }
 
     /* close socket and set to 0 */
@@ -136,20 +136,20 @@
     /* walk all lissiners */
     for (i = 0; i < MAX_LISSENERS; i++)
     {
-        /* if its not set */
-        if (lisseners[i] < 1)
-            continue;
-
-        D_("Sending to lisseners[%i] fd %i : %s\n", i, lisseners[i],
-           (char *) buf);
-        /* if not succed to send */
-        if (send(lisseners[i], buf, len, 0) < (signed) len)
-        {
-            D_("Fd %i must have been closed.\n", lisseners[i]);
-            /* close it */
-            close(lisseners[i]);
-            lisseners[i] = -1;
-        }
+	/* if its not set */
+	if (lisseners[i] < 1)
+	    continue;
+
+	D_("Sending to lisseners[%i] fd %i : %s\n", i, lisseners[i],
+	   (char *) buf);
+	/* if not succed to send */
+	if (send(lisseners[i], buf, len, 0) < (signed) len)
+	{
+	    D_("Fd %i must have been closed.\n", lisseners[i]);
+	    /* close it */
+	    close(lisseners[i]);
+	    lisseners[i] = -1;
+	}
     }
 
 }
@@ -166,101 +166,101 @@
 
     /* make a dumb check */
     if (from != &fd_event_acceptor)
-        return;
+	return;
 
     /* skipp all set lisseners, so we dont owerwrite them */
     while (lisseners[lis] > 0 && lis != MAX_LISSENERS)
-        lis++;
+	lis++;
     if (lis == MAX_LISSENERS)
     {
-        F_("Maximum no of lisseners reached.\n");
-        return;
+	F_("Maximum no of lisseners reached.\n");
+	return;
     }
 
     D_("Adding new lissener lissensers[%i]\n", lis);
     if (is_active == FALSE)
     {
-        /*
-         * Register that hooks, that we forwards events from.
-         */
-        initng_plugin_hook_add(&g.ASTATUS_CHANGE, 50, &astatus_change);
-        initng_plugin_hook_add(&g.SWATCHERS, 50, &system_state_change);
-        initng_plugin_hook_add(&g.PIPEWATCHERS, 50, &system_pipe_watchers);
-        initng_plugin_hook_add(&g.ERR_MSG, 50, &print_error);
-        is_active = TRUE;
+	/*
+	 * Register that hooks, that we forwards events from.
+	 */
+	initng_plugin_hook_add(&g.ASTATUS_CHANGE, 50, &astatus_change);
+	initng_plugin_hook_add(&g.SWATCHERS, 50, &system_state_change);
+	initng_plugin_hook_add(&g.PIPEWATCHERS, 50, &system_pipe_watchers);
+	initng_plugin_hook_add(&g.ERR_MSG, 50, &print_error);
+	is_active = TRUE;
     }
     /* create a new socket, for reading */
     if ((lisseners[lis] = accept(fd_event_acceptor.fds, NULL, NULL)) < 1)
     {
-        F_("Failed to accept lissener!\n");
-        return;
+	F_("Failed to accept lissener!\n");
+	return;
     }
 
     D_("opening lissener no #%i.\n", lis);
 
     /* send header */
     {
-        send(lisseners[lis], "<? xml version=\"1.0\" ?/>\n",
-             sizeof(char) * 25, 0);
+	send(lisseners[lis], "<? xml version=\"1.0\" ?/>\n",
+	     sizeof(char) * 25, 0);
     }
 
     /* send protocol info */
     {
-        string = i_calloc(70 + strlen(INITNG_VERSION), sizeof(char));
+	string = i_calloc(70 + strlen(INITNG_VERSION), sizeof(char));
 
-        /* Make a string ready for sending */
-        len = sprintf(string,
-                      "<connect protocol_version=\"%i\", initng_version=\"%s\"/>\n",
-                      NGE_VERSION, INITNG_VERSION);
-
-        /* send the init string to this socket */
-        send(lisseners[lis], string, sizeof(char) * len, 0);
-
-        /* free the initial string */
-        free(string);
-        string = NULL;
+	/* Make a string ready for sending */
+	len = sprintf(string,
+		      "<connect protocol_version=\"%i\", initng_version=\"%s\"/>\n",
+		      NGE_VERSION, INITNG_VERSION);
+
+	/* send the init string to this socket */
+	send(lisseners[lis], string, sizeof(char) * len, 0);
+
+	/* free the initial string */
+	free(string);
+	string = NULL;
     }
 
     /* send system initiating state */
     {
-        string = i_calloc(70, sizeof(char));
-        len = sprintf(string,
-                      "<event type=\"initial_system_state\" system_state=\"%i\" />\n",
-                      g.sys_state);
-
-        /* send the init string to this socket */
-        send(lisseners[lis], string, sizeof(char) * len, 0);
-
-        /* free the initial string */
-        free(string);
-        string = NULL;
+	string = i_calloc(70, sizeof(char));
+	len = sprintf(string,
+		      "<event type=\"initial_system_state\" system_state=\"%i\" />\n",
+		      g.sys_state);
+
+	/* send the init string to this socket */
+	send(lisseners[lis], string, sizeof(char) * len, 0);
+
+	/* free the initial string */
+	free(string);
+	string = NULL;
     }
 
     /* send all current services states */
     {
-        active_db_h *service = NULL;
+	active_db_h *service = NULL;
 
-        while_active_db(service)
-        {
-            string = i_realloc(string, (120 + strlen(service->name) +
-                                        strlen(service->current_state->
-                                               state_name)) * sizeof(char));
-
-            len = sprintf(string,
-                          "<event type=\"initial_service_state\" service=\"%s\" is=\"%i\" state=\"%s\" />\n",
-                          service->name, service->current_state->is,
-                          service->current_state->state_name);
-
-            /* send the init string to this socket */
-            send(lisseners[lis], string, sizeof(char) * len, 0);
-        }
-
-        if (string)
-        {
-            /* free the initial string */
-            free(string);
-            string = NULL;
-        }
+	while_active_db(service)
+	{
+	    string = i_realloc(string, (120 + strlen(service->name) +
+					strlen(service->current_state->
+					       state_name)) * sizeof(char));
+
+	    len = sprintf(string,
+			  "<event type=\"initial_service_state\" service=\"%s\" is=\"%i\" state=\"%s\" />\n",
+			  service->name, service->current_state->is,
+			  service->current_state->state_name);
+
+	    /* send the init string to this socket */
+	    send(lisseners[lis], string, sizeof(char) * len, 0);
+	}
+
+	if (string)
+	{
+	    /* free the initial string */
+	    free(string);
+	    string = NULL;
+	}
     }
 }
 
@@ -276,33 +276,33 @@
 
     /* Make NGE_PREFIX (/dev/initng) if it doesn't exist (try either way) */
     if (mkdir(NGE_PREFIX, S_IRUSR | S_IWUSR | S_IXUSR) == -1
-        && errno != EEXIST)
+	&& errno != EEXIST)
     {
-        if (errno != EROFS)
-            F_("Could not create " NGE_PREFIX
-               " : %s, may be / fs not mounted read-write yet?, will retry until I succeed.\n",
-               strerror(errno));
-        return (FALSE);
+	if (errno != EROFS)
+	    F_("Could not create " NGE_PREFIX
+	       " : %s, may be / fs not mounted read-write yet?, will retry until I succeed.\n",
+	       strerror(errno));
+	return (FALSE);
     }
 
     /* chmod root path for root use only */
     if (chmod(NGE_PREFIX, S_IRUSR | S_IWUSR | S_IXUSR) == -1)
     {
-        /* path doesn't exist, we don't have /dev yet. */
-        if (errno == ENOENT || errno == EROFS)
-            return (FALSE);
+	/* path doesn't exist, we don't have /dev yet. */
+	if (errno == ENOENT || errno == EROFS)
+	    return (FALSE);
 
-        F_("CRITICAL, failed to chmod %s, THIS IS A SECURITY PROBLEM.\n",
-           NGE_PREFIX);
+	F_("CRITICAL, failed to chmod %s, THIS IS A SECURITY PROBLEM.\n",
+	   NGE_PREFIX);
     }
 
     /* Create the socket. */
     fd_event_acceptor.fds = socket(PF_UNIX, SOCK_STREAM, 0);
     if (fd_event_acceptor.fds < 1)
     {
-        F_("Failed to init socket (%s)\n", strerror(errno));
-        fd_event_acceptor.fds = -1;
-        return (FALSE);
+	F_("Failed to init socket (%s)\n", strerror(errno));
+	fd_event_acceptor.fds = -1;
+	return (FALSE);
     }
 
     /* Bind a name to the socket. */
@@ -316,24 +316,24 @@
 
     /* Try to bind */
     if (bind
-        (fd_event_acceptor.fds, (struct sockaddr *) &serv_sockname,
-         (strlen(serv_sockname.sun_path) +
-          sizeof(serv_sockname.sun_family))) < 0)
-    {
-        F_("Error binding to socket (errno: %d str: '%s')\n", errno,
-           strerror(errno));
-        close_initziator_socket();
-        unlink(serv_sockname.sun_path);
-        return (FALSE);
+	(fd_event_acceptor.fds, (struct sockaddr *) &serv_sockname,
+	 (strlen(serv_sockname.sun_path) +
+	  sizeof(serv_sockname.sun_family))) < 0)
+    {
+	F_("Error binding to socket (errno: %d str: '%s')\n", errno,
+	   strerror(errno));
+	close_initziator_socket();
+	unlink(serv_sockname.sun_path);
+	return (FALSE);
     }
 
     /* chmod socket for root only use */
     if (chmod(serv_sockname.sun_path, S_IRUSR | S_IWUSR) == -1)
     {
-        F_("CRITICAL, failed to chmod %s, THIS IS A SECURITY PROBLEM.\n",
-           serv_sockname.sun_path);
-        close_initziator_socket();
-        return (FALSE);
+	F_("CRITICAL, failed to chmod %s, THIS IS A SECURITY PROBLEM.\n",
+	   serv_sockname.sun_path);
+	close_initziator_socket();
+	return (FALSE);
     }
 
     /* store sock_stat for checking if we need to recreate socket later */
@@ -342,10 +342,10 @@
     /* Listen to socket */
     if (listen(fd_event_acceptor.fds, 5))
     {
-        F_("Error on listen (errno: %d str: '%s')\n", errno, strerror(errno));
-        close_initziator_socket();
-        unlink(serv_sockname.sun_path);
-        return (FALSE);
+	F_("Error on listen (errno: %d str: '%s')\n", errno, strerror(errno));
+	close_initziator_socket();
+	unlink(serv_sockname.sun_path);
+	return (FALSE);
     }
 
     /*
@@ -364,7 +364,7 @@
     struct stat st;
 
     if (signal != SIGHUP)
-        return;
+	return;
 
 #define PING "<event type=\"ping\"/>\n"
     send_to_all(PING, sizeof(char) * strlen(PING));
@@ -373,27 +373,27 @@
     /* Check if socket needs reopening */
     if (fd_event_acceptor.fds <= 0)
     {
-        D_("fd_event_acceptor.fds not set, opening new socket.\n");
-        open_initziator_socket();
-        return;
+	D_("fd_event_acceptor.fds not set, opening new socket.\n");
+	open_initziator_socket();
+	return;
     }
 
     /* stat the socket, reopen on failure */
     memset(&st, 0, sizeof(st));
     if (stat(socket_filename, &st) < 0)
     {
-        W_("Stat failed! Opening new socket.\n");
-        open_initziator_socket();
-        return;
+	W_("Stat failed! Opening new socket.\n");
+	open_initziator_socket();
+	return;
     }
 
     /* compare socket file, with the one that we know, reopen on failure */
     if (st.st_dev != sock_stat.st_dev || st.st_ino != sock_stat.st_ino
-        || st.st_mtime != sock_stat.st_mtime)
+	|| st.st_mtime != sock_stat.st_mtime)
     {
-        F_("Invalid socket found, reopening\n");
-        open_initziator_socket();
-        return;
+	F_("Invalid socket found, reopening\n");
+	open_initziator_socket();
+	return;
     }
 
     D_("Socket ok.\n");
@@ -406,20 +406,20 @@
     int len;
 
     buffert = calloc(120 + strlen(service->name) +
-                     strlen(service->current_state->state_name),
-                     sizeof(char));
+		     strlen(service->current_state->state_name),
+		     sizeof(char));
 
     len = sprintf(buffert,
-                  "<event type=\"service_state_change\" service=\"%s\" is=\"%i\" state=\"%s\" />\n",
-                  service->name, service->current_state->is,
-                  service->current_state->state_name);
+		  "<event type=\"service_state_change\" service=\"%s\" is=\"%i\" state=\"%s\" />\n",
+		  service->name, service->current_state->is,
+		  service->current_state->state_name);
 
     /*printf("astatus_change: %s %i %s\n",
        service->name, service->current_state->is,
        service->current_state->state_name); */
 
     if (len > 1)
-        send_to_all(buffert, sizeof(char) * len);
+	send_to_all(buffert, sizeof(char) * len);
 
     free(buffert);
     return (TRUE);
@@ -432,27 +432,27 @@
 
 
     len = sprintf(buffert,
-                  "<event type=\"system_state_change\" system_state=\"%i\" />\n",
-                  state);
+		  "<event type=\"system_state_change\" system_state=\"%i\" />\n",
+		  state);
 
     if (len > 1)
-        send_to_all(buffert, sizeof(char) * len);
+	send_to_all(buffert, sizeof(char) * len);
 }
 
 static int system_pipe_watchers(active_db_h * service, process_h * process,
-                                char *output)
+				char *output)
 {
     char *buffert = NULL;
     int len;
     buffert = calloc(100 + strlen(service->name) + strlen(process->pt->name) +
-                     strlen(output), sizeof(char));
+		     strlen(output), sizeof(char));
 
     len = sprintf(buffert,
-                  "<event type=\"service_output\" service=\"%s\" process=\"%s\">%s</event>\n",
-                  service->name, process->pt->name, output);
+		  "<event type=\"service_output\" service=\"%s\" process=\"%s\">%s</event>\n",
+		  service->name, process->pt->name, output);
 
     if (len > 0)
-        send_to_all(buffert, sizeof(char) * len);
+	send_to_all(buffert, sizeof(char) * len);
 
     /* free buffert */
     free(buffert);
@@ -462,7 +462,7 @@
 }
 
 static int print_error(e_mt mt, const char *file, const char *func,
-                       int line, const char *format, va_list arg)
+		       int line, const char *format, va_list arg)
 {
     char *buffert = NULL;
 
@@ -474,28 +474,28 @@
     len = vsnprintf(msg, size, format, arg);
     while (len < 0 || len >= size)
     {
-        /* Some glibc versions apparently return -1 if buffer too small.
-           Oh, and the argument counts the null char, but the return 
-           value doesn't, apparently. (See man page for gory details.) */
-        size = (len < 0 ? size * 2 : len + 1);
-        free(msg);
-        msg = i_calloc(1, size);
-        len = vsnprintf(msg, 256, format, arg);
+	/* Some glibc versions apparently return -1 if buffer too small.
+	   Oh, and the argument counts the null char, but the return 
+	   value doesn't, apparently. (See man page for gory details.) */
+	size = (len < 0 ? size * 2 : len + 1);
+	free(msg);
+	msg = i_calloc(1, size);
+	len = vsnprintf(msg, 256, format, arg);
     }
 
     buffert = calloc(100 + len + strlen(file) + strlen(func), sizeof(char));
 
     len = sprintf(buffert,
-                  "<event type=\"err_msg\" mt=\"%i\" file=\"%s\" func=\"%s\" line=\"%i\">%s</event>\n",
-                  mt, file, func, line, msg);
+		  "<event type=\"err_msg\" mt=\"%i\" file=\"%s\" func=\"%s\" line=\"%i\">%s</event>\n",
+		  mt, file, func, line, msg);
 
     len = vsnprintf(msg, 1000, format, arg);
 
     buffert = calloc(100 + len + strlen(file) + strlen(func), sizeof(char));
 
     len = sprintf(buffert,
-                  "<event type=\"err_msg\" mt=\"%i\" file=\"%s\" func=\"%s\" line=\"%i\">%s</event>\n",
-                  mt, file, func, line, msg);
+		  "<event type=\"err_msg\" mt=\"%i\" file=\"%s\" func=\"%s\" line=\"%i\">%s</event>\n",
+		  mt, file, func, line, msg);
 
     send_to_all(buffert, sizeof(char) * len);
 
@@ -513,13 +513,13 @@
 
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     /* clear lisseners struct */
     for (i = 0; i < MAX_LISSENERS; i++)
-        lisseners[i] = -1;
+	lisseners[i] = -1;
 
     /* zero globals */
     fd_event_acceptor.fds = -1;
@@ -530,12 +530,12 @@
      * set socket_filename to right path
      */
     {
-        /* decide which socket to use */
-        if (g.i_am_init)
-            socket_filename = NGE_REAL;
-        else
-            socket_filename = NGE_TEST;
-        D_("Socket is: %s\n", socket_filename);
+	/* decide which socket to use */
+	if (g.i_am_init)
+	    socket_filename = NGE_REAL;
+	else
+	    socket_filename = NGE_TEST;
+	D_("Socket is: %s\n", socket_filename);
     }
 
     /*

Modified: initng/trunk/plugins/nge/libngeclient.c
==============================================================================
--- initng/trunk/plugins/nge/libngeclient.c	(original)
+++ initng/trunk/plugins/nge/libngeclient.c	Wed Apr  5 22:57:12 2006
@@ -59,9 +59,9 @@
     /* check that socket is not open already */
     if (event->sock > 1)
     {
-        ngeclient_error = "Socket already open.";
-        /*fprintf(stderr, "Socket already open.\n"); */
-        return (-1);
+	ngeclient_error = "Socket already open.";
+	/*fprintf(stderr, "Socket already open.\n"); */
+	return (-1);
     }
 
     event->sock = -1;
@@ -72,9 +72,9 @@
     event->sock = socket(PF_UNIX, SOCK_STREAM, 0);
     if (event->sock < 0)
     {
-        ngeclient_error = "Failed to init socket.";
-        /*fprintf(stderr, "Failed to init socket."); */
-        return (-1);
+	ngeclient_error = "Failed to init socket.";
+	/*fprintf(stderr, "Failed to init socket."); */
+	return (-1);
     }
 
     /* Bind a name to the socket. */
@@ -84,18 +84,18 @@
 
     if (connect(event->sock, (struct sockaddr *) &sockname, len) < 0)
     {
-        close(event->sock);
-        ngeclient_error = "Error connecting to socket";
-        /*fprintf(stderr, "Error connecting to socket\n"); */
-        return (-1);
+	close(event->sock);
+	ngeclient_error = "Error connecting to socket";
+	/*fprintf(stderr, "Error connecting to socket\n"); */
+	return (-1);
     }
 
 
     /* Put it not to block, waiting for more data on rscv */
     {
-        int cur = fcntl(event->sock, F_GETFL, 0);
+	int cur = fcntl(event->sock, F_GETFL, 0);
 
-        fcntl(event->sock, F_SETFL, cur | O_NONBLOCK);
+	fcntl(event->sock, F_SETFL, cur | O_NONBLOCK);
     }
 
     /* return happily */
@@ -107,9 +107,9 @@
 {
     if (event->read_buffer)
     {
-        free(event->read_buffer);
-        event->read_buffer = NULL;
-        event->read_buffer_len = 0;
+	free(event->read_buffer);
+	event->read_buffer = NULL;
+	event->read_buffer_len = 0;
     }
 }
 
@@ -121,7 +121,7 @@
     /* if socket is open, close it */
     if (event->sock > 0)
     {
-        close(event->sock);
+	close(event->sock);
     }
 
     /* set socket marked closed */
@@ -130,8 +130,8 @@
     /* free read_buffer */
     if (event->read_buffer)
     {
-        free(event->read_buffer);
-        event->read_buffer = NULL;
+	free(event->read_buffer);
+	event->read_buffer = NULL;
     }
 }
 
@@ -146,7 +146,7 @@
 int ngeclient_read_and_fill_buffer(nge_event * event)
 {
     int totally_got = 0;
-    int chars_recv = 1;         /* must be one so the while loop will be run */
+    int chars_recv = 1;		/* must be one so the while loop will be run */
 
     assert(event);
     assert(event->sock > 0);
@@ -155,27 +155,27 @@
     while (chars_recv > 0)
     {
 
-        /*printf("reallocating to %i\n", event->read_buffer_len + 101 ); */
-        /* Allocate more room for input */
-        event->read_buffer = realloc(event->read_buffer,
-                                     (event->read_buffer_len +
-                                      101) * sizeof(char));
-
-        /* Make it null terminated, specially if event->read_buffer is created from NULL */
-        event->read_buffer[event->read_buffer_len] = '\0';
-
-        /* get 100 chars */
-        chars_recv = recv(event->sock,
-                          &event->read_buffer[event->read_buffer_len], 100,
-                          0);
-
-        /* null the end */
-        if (chars_recv > 0)
-        {
-            event->read_buffer_len += chars_recv;
-            event->read_buffer[event->read_buffer_len] = '\0';
-            totally_got += chars_recv;
-        }
+	/*printf("reallocating to %i\n", event->read_buffer_len + 101 ); */
+	/* Allocate more room for input */
+	event->read_buffer = realloc(event->read_buffer,
+				     (event->read_buffer_len +
+				      101) * sizeof(char));
+
+	/* Make it null terminated, specially if event->read_buffer is created from NULL */
+	event->read_buffer[event->read_buffer_len] = '\0';
+
+	/* get 100 chars */
+	chars_recv = recv(event->sock,
+			  &event->read_buffer[event->read_buffer_len], 100,
+			  0);
+
+	/* null the end */
+	if (chars_recv > 0)
+	{
+	    event->read_buffer_len += chars_recv;
+	    event->read_buffer[event->read_buffer_len] = '\0';
+	    totally_got += chars_recv;
+	}
     }
 
     /* return chars got */
@@ -203,8 +203,8 @@
 
     /* if it was any data */
     if (ret_poll > 0)
-        /* go fetch it */
-        return (ngeclient_read_and_fill_buffer(event));
+	/* go fetch it */
+	return (ngeclient_read_and_fill_buffer(event));
 
     /* return the 0 or -1 poll generates */
     return (ret_poll);
@@ -220,23 +220,23 @@
 
     /* dont cut any then */
     if (chars == 0 || !event->read_buffer || event->read_buffer_len < 1)
-        return;
+	return;
 
     /* make sure we are not trying to cut more then we have */
     if (chars > event->read_buffer_len)
-        chars = event->read_buffer_len;
+	chars = event->read_buffer_len;
 
     /* get length of buffer that is left, after chars is cut */
     event->read_buffer_len -= chars;
 
     /* move the content in front, to the beginning */
     memmove(event->read_buffer, &event->read_buffer[chars],
-            event->read_buffer_len * sizeof(char));
+	    event->read_buffer_len * sizeof(char));
 
     /* reallocate now, when theres not that mutch data anymore */
     /*printf("reallocating to %i\n", event->read_buffer_len); */
     event->read_buffer = realloc(event->read_buffer,
-                                 (event->read_buffer_len + 1) * sizeof(char));
+				 (event->read_buffer_len + 1) * sizeof(char));
 
     /* make sure its nulled at end */
     event->read_buffer[event->read_buffer_len] = '\0';
@@ -263,19 +263,19 @@
      */
     if (point[0] != '<')
     {
-        ngeclient_error = "ngeclient_get_content failed. Bad xml.";
-        return (NULL);
+	ngeclient_error = "ngeclient_get_content failed. Bad xml.";
+	return (NULL);
     }
 
     /* step to the end of tag */
     while (point[0] && point[0] != '>')
-        point++;
+	point++;
 
     /* make sure we got there */
     if (point[0] != '>')
     {
-        ngeclient_error = "ngeclient_get_content failed. Bad xml.";
-        return (NULL);
+	ngeclient_error = "ngeclient_get_content failed. Bad xml.";
+	return (NULL);
     }
     point++;
 
@@ -286,13 +286,13 @@
      */
 
     while (point[len] && point[len] != '<')
-        len++;
+	len++;
 
     /* make sure we are standing on start on next tag. */
     if (point[len] != '<')
     {
-        ngeclient_error = "ngeclient_get_content failed. Bad xml.";
-        return (NULL);
+	ngeclient_error = "ngeclient_get_content failed. Bad xml.";
+	return (NULL);
     }
 
     /*
@@ -301,7 +301,7 @@
      *              |                 ^
      */
     if (len > 0)
-        return (strndup(point, len));
+	return (strndup(point, len));
 
     /* else return ZERO */
     return (NULL);
@@ -323,57 +323,57 @@
     /* search for the name in tag */
     while ((point = strstr(point, name)))
     {
-        int len = 0;
+	int len = 0;
 
-        /* Standing here:
-         * "<connect initng_version="initng-123">"
-         *           |
-         */
-
-        point += name_len;
-        /* Standing here:
-         * "<connect initng_version="initng-123">"
-         *                         |
-         */
-
-        /* skip spaces */
-        while (point[0] && point[0] == ' ' && point[0] == '\t')
-            point++;
-
-        /* must be syntax */
-        if (point[0] != '=')
-            continue;
-        point++;
-
-        /* skip spaces */
-        while (point[0] && point[0] == ' ' && point[0] == '\t')
-            point++;
-
-        /* Standing here:
-         * "<connect initng_version="initng-123">"
-         *                          |
-         */
-
-        /* must be syntax */
-        if (point[0] != '"')
-            continue;
-        point++;
-
-        /* Standing here:
-         * "<connect initng_version="initng-123">"
-         *                           |
-         */
-
-        while (point[len] && point[len] != '"')
-            len++;
-
-        /* Standing here: | To here: ^
-         * "<connect initng_version="initng-123">"
-         *                           |         ^
-         */
+	/* Standing here:
+	 * "<connect initng_version="initng-123">"
+	 *           |
+	 */
+
+	point += name_len;
+	/* Standing here:
+	 * "<connect initng_version="initng-123">"
+	 *                         |
+	 */
+
+	/* skip spaces */
+	while (point[0] && point[0] == ' ' && point[0] == '\t')
+	    point++;
+
+	/* must be syntax */
+	if (point[0] != '=')
+	    continue;
+	point++;
+
+	/* skip spaces */
+	while (point[0] && point[0] == ' ' && point[0] == '\t')
+	    point++;
+
+	/* Standing here:
+	 * "<connect initng_version="initng-123">"
+	 *                          |
+	 */
+
+	/* must be syntax */
+	if (point[0] != '"')
+	    continue;
+	point++;
+
+	/* Standing here:
+	 * "<connect initng_version="initng-123">"
+	 *                           |
+	 */
+
+	while (point[len] && point[len] != '"')
+	    len++;
+
+	/* Standing here: | To here: ^
+	 * "<connect initng_version="initng-123">"
+	 *                           |         ^
+	 */
 
-        /* return that string */
-        return (strndup(point, len));
+	/* return that string */
+	return (strndup(point, len));
     }
 
     ngeclient_error = "Could not find option in tag.";
@@ -393,7 +393,7 @@
     assert(name);
     string = ngeclient_get_option(tag, name);
     if (!string)
-        return (-1);
+	return (-1);
     value = atoi(string);
     free(string);
     return (value);
@@ -402,14 +402,14 @@
 
 /* called on a <event type="service_state_change"  */
 static void ngeclient_handle_service_state_change(nge_event * event,
-                                                  char *tag, int chars)
+						  char *tag, int chars)
 {
     char *service = ngeclient_get_option(tag, "service");
     e_is is = (e_is) ngeclient_get_int(tag, "is");
     char *state = ngeclient_get_option(tag, "state");
 
     if (event->service_state_change)
-        (*event->service_state_change) (event, service, is, state);
+	(*event->service_state_change) (event, service, is, state);
 
     /*printf("service_state_change \"%s\", %i chars.\n %s, %i %s \n", tag, chars, service, is , state); */
 
@@ -419,13 +419,13 @@
 
 /* called on a <event type="system_state_change"  */
 static void ngeclient_handle_system_state_change(nge_event * event, char *tag,
-                                                 int chars)
+						 int chars)
 {
     h_sys_state system_state = (h_sys_state) ngeclient_get_int(tag,
-                                                               "system_state");
+							       "system_state");
 
     if (event->system_state_change)
-        (*event->system_state_change) (event, system_state);
+	(*event->system_state_change) (event, system_state);
 
     /*printf("event-tag \"%s\", %i chars.\n", tag, chars); */
 
@@ -433,14 +433,14 @@
 
 /* called on a <event type="initial_service_state"  */
 static void ngeclient_handle_initial_service_state(nge_event * event,
-                                                   char *tag, int chars)
+						   char *tag, int chars)
 {
     char *service = ngeclient_get_option(tag, "service");
     e_is is = (e_is) ngeclient_get_int(tag, "is");
     char *state = ngeclient_get_option(tag, "state");
 
     if (event->initial_service_state)
-        (*event->initial_service_state) (event, service, is, state);
+	(*event->initial_service_state) (event, service, is, state);
 
     /*printf("service_state_change \"%s\", %i chars.\n %s, %i %s \n", tag, chars, service, is , state); */
 
@@ -450,13 +450,13 @@
 
 /* called on a <event type="initial_system_state"  */
 static void ngeclient_handle_initial_system_state(nge_event * event,
-                                                  char *tag, int chars)
+						  char *tag, int chars)
 {
     h_sys_state system_state = (h_sys_state) ngeclient_get_int(tag,
-                                                               "system_state");
+							       "system_state");
 
     if (event->initial_system_state)
-        (*event->initial_system_state) (event, system_state);
+	(*event->initial_system_state) (event, system_state);
 
     /*printf("event-tag \"%s\", %i chars.\n", tag, chars); */
 
@@ -464,7 +464,7 @@
 
 /* called on a <event type="service_output"  */
 static void ngeclient_handle_service_output(nge_event * event, char *tag,
-                                            int chars)
+					    int chars)
 {
     char *service = ngeclient_get_option(tag, "service");
     char *process = ngeclient_get_option(tag, "process");
@@ -473,7 +473,7 @@
     /*printf("Service \"%s\" process \"%s\" outputed:\n%s\n", service, process, output); */
 
     if (event->service_output)
-        (*event->service_output) (event, service, process, output);
+	(*event->service_output) (event, service, process, output);
 
     free(service);
     free(process);
@@ -490,7 +490,7 @@
     char *message = ngeclient_get_content(tag);
 
     if (event->err_msg)
-        (*event->err_msg) (event, mt, file, func, line, message);
+	(*event->err_msg) (event, mt, file, func, line, message);
 
     /*printf("errmsg mt: %i, file: %s, func: %s line: %i.\n%s\n",
        mt, file, func, line, message); */
@@ -504,7 +504,7 @@
 static void ngeclient_handle_ping(nge_event * event, char *tag, int chars)
 {
     if (event->ping)
-        (*event->ping) (event);
+	(*event->ping) (event);
     /*printf("event-tag \"%s\", %i chars.\n", tag, chars); */
 }
 
@@ -515,36 +515,36 @@
 
     if (strcmp(type, "service_state_change") == 0)
     {
-        ngeclient_handle_service_state_change(event, tag, chars);
+	ngeclient_handle_service_state_change(event, tag, chars);
     }
     else if (strcmp(type, "system_state_change") == 0)
     {
-        ngeclient_handle_system_state_change(event, tag, chars);
+	ngeclient_handle_system_state_change(event, tag, chars);
     }
     else if (strcmp(type, "service_output") == 0)
     {
-        ngeclient_handle_service_output(event, tag, chars);
+	ngeclient_handle_service_output(event, tag, chars);
     }
     else if (strcmp(type, "err_msg") == 0)
     {
-        ngeclient_handle_err_msg(event, tag, chars);
+	ngeclient_handle_err_msg(event, tag, chars);
     }
     if (strcmp(type, "initial_service_state") == 0)
     {
-        ngeclient_handle_initial_service_state(event, tag, chars);
+	ngeclient_handle_initial_service_state(event, tag, chars);
     }
     else if (strcmp(type, "initial_system_state") == 0)
     {
-        ngeclient_handle_initial_system_state(event, tag, chars);
+	ngeclient_handle_initial_system_state(event, tag, chars);
     }
     else if (strcmp(type, "ping") == 0)
     {
-        ngeclient_handle_ping(event, tag, chars);
+	ngeclient_handle_ping(event, tag, chars);
     }
     else
     {
-        /*ngeclient_error="Unknown event-tag."; */
-        /*fprintf(stderr, "Unknown event-tag \"%s\"\n", type); */
+	/*ngeclient_error="Unknown event-tag."; */
+	/*fprintf(stderr, "Unknown event-tag \"%s\"\n", type); */
     }
 
     free(type);
@@ -558,23 +558,23 @@
 
     if (protocol_version != NGE_VERSION)
     {
-        ngeclient_error = "NGE protocol version missmatch!";
-        /*fprintf(stderr, "NGE protocol version missmatch!, (%i, %i) ABORT!\n", protocol_version, NGE_VERSION); */
-        free(initng_version);
-        return;
+	ngeclient_error = "NGE protocol version missmatch!";
+	/*fprintf(stderr, "NGE protocol version missmatch!, (%i, %i) ABORT!\n", protocol_version, NGE_VERSION); */
+	free(initng_version);
+	return;
     }
     if (event->connect)
-        (*event->connect) (event, protocol_version, initng_version);
+	(*event->connect) (event, protocol_version, initng_version);
     /*printf("Connected to initng version: \"%s\" \n", initng_version); */
     free(initng_version);
 }
 
 /* called when a <disconnect> hook apeares */
 static void ngeclient_handle_disconnect(nge_event * event, char *tag,
-                                        int chars)
+					int chars)
 {
     if (event->disconnect)
-        (*event->disconnect) (event);
+	(*event->disconnect) (event);
     /*printf("disconnect-tag \"%s\", %i chars.\n", tag, chars); */
 }
 
@@ -583,27 +583,27 @@
 {
     /* if this is a <? comment > tag */
     if (tag[1] == '?')
-        return;
+	return;
 
     /* if this is a "<event " tag */
     if (strncmp(&tag[1], "event ", 6) == 0)
     {
-        ngeclient_handle_event(event, tag, chars);
-        return;
+	ngeclient_handle_event(event, tag, chars);
+	return;
     }
 
     /* if this is a "<connect " tag */
     if (strncmp(&tag[1], "connect ", 8) == 0)
     {
-        ngeclient_handle_connect(event, tag, chars);
-        return;
+	ngeclient_handle_connect(event, tag, chars);
+	return;
     }
 
     /* if this is a "<disconnect>" tag */
     if (strncmp(&tag[1], "disconnect>", 12) == 0)
     {
-        ngeclient_handle_disconnect(event, tag, chars);
-        return;
+	ngeclient_handle_disconnect(event, tag, chars);
+	return;
     }
 
     ngeclient_error = "Unknown tag to handle.";
@@ -622,83 +622,83 @@
 
     /* make sure there is data */
     if (event->read_buffer == NULL || event->read_buffer_len < 1)
-        return;
+	return;
 
     /*printf("read_buffer:\"%s\"\n", event->read_buffer); */
 
     if (event->read_buffer[0] != '<')
     {
-        ngeclient_error = "Expected an < char, as the first char in an xml protocol.";
-        /*fprintf(stderr, "Bad xml! '%c' len: %i\n", event->read_buffer[0], strlen(event->read_buffer)); */
-        return;
+	ngeclient_error = "Expected an < char, as the first char in an xml protocol.";
+	/*fprintf(stderr, "Bad xml! '%c' len: %i\n", event->read_buffer[0], strlen(event->read_buffer)); */
+	return;
     }
 
     /* while there is data to read */
     while (event->read_buffer && event->read_buffer[0] != '\0'
-           && event->read_buffer_len > 0)
+	   && event->read_buffer_len > 0)
     {
-        /* skip newlines */
-        while (event->read_buffer[0] == '\n')
-        {
-            /* cut first char from event->read_buffer */
-            ngeclient_cut_buffert(event, 1);
-            continue;
-        }
-
-        /* count the lengt of this tag */
-        int chars = 0;
-        int tagend_found = 0;
-
-        while (event->read_buffer[chars])
-        {
-            /* if found "/>" This meens tag-out */
-            if (event->read_buffer[chars] == '/'
-                && event->read_buffer[chars + 1] == '>')
-            {
-                chars += 2;
-                tagend_found = 1;
-                break;
-            }
-
-            /* if found "</" This is also tag-out */
-            if (event->read_buffer[chars] == '<'
-                && event->read_buffer[chars + 1] == '/')
-            {
-                /*printf("tag_stop: %s\n", &event->read_buffer[chars]); */
-                chars += 2;
-
-                /* skip to the end char of tag */
-                while (event->read_buffer[chars]
-                       && event->read_buffer[chars] != '>')
-                    chars++;
-                if (event->read_buffer[chars] == '>')
-                    chars++;
-                /*printf("tag_stop_after: %s\n", &event->read_buffer[chars]); */
-
-                tagend_found = 1;
-                break;
-            }
-
-            /* increase chars of tags counter */
-            chars++;
-        }
-
-        /* if tagend not found, return to mainloop and fetch more data */
-        if (tagend_found == 0)
-        {
-            /*printf("No tagend [%i]: \"%s\"\n", chars, event->read_buffer); */
-            return;
-        }
-
-
-        if (chars > 0 && event->read_buffer[0] == '<')
-        {
-            char *tmp = strndup(event->read_buffer, chars);
-
-            ngeclient_handle_tag(event, tmp, chars);
-            free(tmp);
-        }
-        ngeclient_cut_buffert(event, chars);
+	/* skip newlines */
+	while (event->read_buffer[0] == '\n')
+	{
+	    /* cut first char from event->read_buffer */
+	    ngeclient_cut_buffert(event, 1);
+	    continue;
+	}
+
+	/* count the lengt of this tag */
+	int chars = 0;
+	int tagend_found = 0;
+
+	while (event->read_buffer[chars])
+	{
+	    /* if found "/>" This meens tag-out */
+	    if (event->read_buffer[chars] == '/'
+		&& event->read_buffer[chars + 1] == '>')
+	    {
+		chars += 2;
+		tagend_found = 1;
+		break;
+	    }
+
+	    /* if found "</" This is also tag-out */
+	    if (event->read_buffer[chars] == '<'
+		&& event->read_buffer[chars + 1] == '/')
+	    {
+		/*printf("tag_stop: %s\n", &event->read_buffer[chars]); */
+		chars += 2;
+
+		/* skip to the end char of tag */
+		while (event->read_buffer[chars]
+		       && event->read_buffer[chars] != '>')
+		    chars++;
+		if (event->read_buffer[chars] == '>')
+		    chars++;
+		/*printf("tag_stop_after: %s\n", &event->read_buffer[chars]); */
+
+		tagend_found = 1;
+		break;
+	    }
+
+	    /* increase chars of tags counter */
+	    chars++;
+	}
+
+	/* if tagend not found, return to mainloop and fetch more data */
+	if (tagend_found == 0)
+	{
+	    /*printf("No tagend [%i]: \"%s\"\n", chars, event->read_buffer); */
+	    return;
+	}
+
+
+	if (chars > 0 && event->read_buffer[0] == '<')
+	{
+	    char *tmp = strndup(event->read_buffer, chars);
+
+	    ngeclient_handle_tag(event, tmp, chars);
+	    free(tmp);
+	}
+	ngeclient_cut_buffert(event, chars);
     }
 }
 
@@ -715,31 +715,31 @@
 
     if (event->sock < 1)
     {
-        ngeclient_error = "Socket not open";
-        /*fprintf(stderr, "Must call open_socket before entering ngeclient loop.\n"); */
-        return;
+	ngeclient_error = "Socket not open";
+	/*fprintf(stderr, "Must call open_socket before entering ngeclient loop.\n"); */
+	return;
     }
 
     /* poll_for_input will return -1 if socket closes */
     while (event->sock > 0
-           && (got = ngeclient_poll_for_input(event, 10000)) >= 0
-           && event->sock > 0)
+	   && (got = ngeclient_poll_for_input(event, 10000)) >= 0
+	   && event->sock > 0)
     {
-        /* make sure we got anything */
-        if (got < 1)
-            continue;
+	/* make sure we got anything */
+	if (got < 1)
+	    continue;
 
-        /* make sure the buffer is pointed */
-        if (event->read_buffer == NULL)
-            continue;
+	/* make sure the buffer is pointed */
+	if (event->read_buffer == NULL)
+	    continue;
 
-        /* make sure its not a null chars */
-        if (!event->read_buffer[0])
-            continue;
+	/* make sure its not a null chars */
+	if (!event->read_buffer[0])
+	    continue;
 
-        /* ok, parse tags */
-        ngeclient_parse_tags(event);
+	/* ok, parse tags */
+	ngeclient_parse_tags(event);
 
-        usleep(100);
+	usleep(100);
     }
 }

Modified: initng/trunk/plugins/nge/libngeclient.h
==============================================================================
--- initng/trunk/plugins/nge/libngeclient.h	(original)
+++ initng/trunk/plugins/nge/libngeclient.h	Wed Apr  5 22:57:12 2006
@@ -28,17 +28,17 @@
 {
     /* functions that will be executed on data */
     void (*service_state_change) (nge_event * event, char *service, e_is is,
-                                  char *state_name);
+				  char *state_name);
     void (*system_state_change) (nge_event * event, h_sys_state state);
     void (*service_output) (nge_event * event, char *service, char *process,
-                            char *output);
+			    char *output);
     void (*err_msg) (nge_event * event, e_mt mt, char *file, char *func,
-                     int line, char *message);
+		     int line, char *message);
     void (*connect) (nge_event * event, int pver, char *initng_version);
     void (*disconnect) (nge_event * event);
     void (*ping) (nge_event * event);
     void (*initial_service_state) (nge_event * event, char *service, e_is is,
-                                   char *state_name);
+				   char *state_name);
     void (*initial_system_state) (nge_event * event, h_sys_state state);
 
     /* standard variables to have */

Modified: initng/trunk/plugins/nge/nge.c
==============================================================================
--- initng/trunk/plugins/nge/nge.c	(original)
+++ initng/trunk/plugins/nge/nge.c	Wed Apr  5 22:57:12 2006
@@ -60,16 +60,16 @@
 {
     switch (is)
     {
-        case IS_UP:
-        case IS_DOWN:
-        case IS_FAILED:
-        case IS_STARTING:
-        case IS_STOPPING:
-        case IS_WAITING:
-        default:
-            fprintf(stdout, "Service \"%s\" have state \"%s\" (%i)\n",
-                    service, state, is);
-            break;
+	case IS_UP:
+	case IS_DOWN:
+	case IS_FAILED:
+	case IS_STARTING:
+	case IS_STOPPING:
+	case IS_WAITING:
+	default:
+	    fprintf(stdout, "Service \"%s\" have state \"%s\" (%i)\n",
+		    service, state, is);
+	    break;
     }
 }
 
@@ -79,38 +79,38 @@
 }
 
 static void service_output(nge_event * e, char *service, char *process,
-                           char *output)
+			   char *output)
 {
     fprintf(stdout, "Service \"%s\" process \"%s\" outputed:\n%s\n", service,
-            process, output);
+	    process, output);
 }
 
 static void err_msg(nge_event * e, e_mt mt, char *file, char *func, int line,
-                    char *message)
+		    char *message)
 {
     fprintf(stdout, "Message mt: %i, file: %s, func: %s, line %i.\n%s\n",
-            mt, file, func, line, message);
+	    mt, file, func, line, message);
 }
 
 static void sys_state(nge_event * e, h_sys_state state)
 {
     switch (state)
     {
-        case STATE_STARTING:
-        case STATE_UP:
-        case STATE_STOPPING:
-        case STATE_ASE:                    /* All Services Exited */
-        case STATE_SERVICES_LOADED:        /* This should only be changed by sys_state_services_loaded, that resets sysstate to last service afterwards. */
-        case STATE_EXIT:
-        case STATE_RESTART:
-        case STATE_SULOGIN:
-        case STATE_HALT:
-        case STATE_POWEROFF:
-        case STATE_REBOOT:
-        case STATE_EXECVE:
-        default:
-            fprintf(stdout, "Initng got a new system state no: %i\n", state);
-            break;
+	case STATE_STARTING:
+	case STATE_UP:
+	case STATE_STOPPING:
+	case STATE_ASE:		    /* All Services Exited */
+	case STATE_SERVICES_LOADED:	    /* This should only be changed by sys_state_services_loaded, that resets sysstate to last service afterwards. */
+	case STATE_EXIT:
+	case STATE_RESTART:
+	case STATE_SULOGIN:
+	case STATE_HALT:
+	case STATE_POWEROFF:
+	case STATE_REBOOT:
+	case STATE_EXECVE:
+	default:
+	    fprintf(stdout, "Initng got a new system state no: %i\n", state);
+	    break;
     }
 }
 
@@ -135,15 +135,15 @@
 
     /* open correct socket */
     if (strcmp(argv[0], "ngde") == 0)
-        ngeclient_open_socket(&e, NGE_TEST);
+	ngeclient_open_socket(&e, NGE_TEST);
     else
-        ngeclient_open_socket(&e, NGE_REAL);
+	ngeclient_open_socket(&e, NGE_REAL);
 
     /* if open_socket fails, ngeclient_error is set */
     if (ngeclient_error)
     {
-        fprintf(stderr, "%s\n", ngeclient_error);
-        exit(1);
+	fprintf(stderr, "%s\n", ngeclient_error);
+	exit(1);
     }
 
     /* this is the MAIN LOOP for ngeclient */
@@ -152,7 +152,7 @@
     /* check for failures */
     if (ngeclient_error)
     {
-        fprintf(stderr, "%s\n", ngeclient_error);
+	fprintf(stderr, "%s\n", ngeclient_error);
     }
 
     /* clean up */

Modified: initng/trunk/plugins/nge/nge_raw.c
==============================================================================
--- initng/trunk/plugins/nge/nge_raw.c	(original)
+++ initng/trunk/plugins/nge/nge_raw.c	Wed Apr  5 22:57:12 2006
@@ -58,42 +58,42 @@
 
     /* open correct socket */
     if (strcmp(argv[0], "ngde_raw") == 0)
-        ngeclient_open_socket(&e, NGE_TEST);
+	ngeclient_open_socket(&e, NGE_TEST);
     else
-        ngeclient_open_socket(&e, NGE_REAL);
+	ngeclient_open_socket(&e, NGE_REAL);
 
     /* if open_socket errors, ngeclient_error is set */
     if (ngeclient_error)
     {
-        fprintf(stderr, "%s\n", ngeclient_error);
-        exit(1);
+	fprintf(stderr, "%s\n", ngeclient_error);
+	exit(1);
     }
 
 
     /* poll_for_input will return -1 if socket closes */
     while ((got = ngeclient_poll_for_input(&e, 10000) >= 0))
     {
-        if (ngeclient_error)
-        {
-            fprintf(stderr, "%s\n", ngeclient_error);
-            ngeclient_error = NULL;
-        }
-
-        /* if we got something */
-        if (got > 0 && e.read_buffer && e.read_buffer[0])
-        {
-            fprintf(stdout, "%s", e.read_buffer);
-        }
+	if (ngeclient_error)
+	{
+	    fprintf(stderr, "%s\n", ngeclient_error);
+	    ngeclient_error = NULL;
+	}
+
+	/* if we got something */
+	if (got > 0 && e.read_buffer && e.read_buffer[0])
+	{
+	    fprintf(stdout, "%s", e.read_buffer);
+	}
 
-        /* free and reset buffer, so we wont print full history every print. */
-        ngeclient_free_buffer(&e);
+	/* free and reset buffer, so we wont print full history every print. */
+	ngeclient_free_buffer(&e);
     }
 
     /* check for error messages from ngeclinet.so */
     if (ngeclient_error)
     {
-        fprintf(stderr, "%s\n", ngeclient_error);
-        ngeclient_error = NULL;
+	fprintf(stderr, "%s\n", ngeclient_error);
+	ngeclient_error = NULL;
     }
 
 

Modified: initng/trunk/plugins/pause/initng_pause.c
==============================================================================
--- initng/trunk/plugins/pause/initng_pause.c	(original)
+++ initng/trunk/plugins/pause/initng_pause.c	Wed Apr  5 22:57:12 2006
@@ -55,14 +55,14 @@
 
     if (s_delay)
     {
-        D_("Sleeping for %i seconds.\n", s_delay);
-        sleep(s_delay);
+	D_("Sleeping for %i seconds.\n", s_delay);
+	sleep(s_delay);
     }
 
     if (ms_delay)
     {
-        D_("Sleeping for %i milliseconds.\n", ms_delay);
-        usleep(ms_delay);
+	D_("Sleeping for %i milliseconds.\n", ms_delay);
+	usleep(ms_delay);
     }
 
     return (TRUE);
@@ -73,8 +73,8 @@
     D_("module_init();\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     initng_service_data_types_add(&S_DELAY);

Modified: initng/trunk/plugins/reload/initng_reload.c
==============================================================================
--- initng/trunk/plugins/reload/initng_reload.c	(original)
+++ initng/trunk/plugins/reload/initng_reload.c	Wed Apr  5 22:57:12 2006
@@ -22,7 +22,7 @@
 
 
 #include <stdio.h>
-#include <stdlib.h>                         /* free() exit() */
+#include <stdlib.h>			    /* free() exit() */
 #include <string.h>
 #include <unistd.h>
 #include <assert.h>
@@ -67,17 +67,17 @@
 
     while_active_db(service)
     {
-        process_h *process = NULL;
+	process_h *process = NULL;
 
-        while_processes(process, service)
-        {
-            if (process->out_pipe[0] == fd)
-            {
-                W_("Wont close fd %i, used by service \"%s\"\n", fd,
-                   service->name);
-                return (TRUE);
-            }
-        }
+	while_processes(process, service)
+	{
+	    if (process->out_pipe[0] == fd)
+	    {
+		W_("Wont close fd %i, used by service \"%s\"\n", fd,
+		   service->name);
+		return (TRUE);
+	    }
+	}
     }
     return (FALSE);
 }
@@ -94,26 +94,26 @@
     /* close all fd, exept stdin, stdout, stderr, and that ones that point to our services */
     for (i = 3; i < 1024; i++)
     {
-        if (fd_used_by_service(i) == FALSE)
-            close(i);
+	if (fd_used_by_service(i) == FALSE)
+	    close(i);
     }
 
     if (retval == TRUE)
     {
-        D_("exec()int initng\n");
-        new_argv[0] = i_strdup("/sbin/initng");
-        new_argv[1] = i_strdup("--hot_reload");
-        new_argv[2] = NULL;
+	D_("exec()int initng\n");
+	new_argv[0] = i_strdup("/sbin/initng");
+	new_argv[1] = i_strdup("--hot_reload");
+	new_argv[2] = NULL;
 
-        execve("/sbin/initng", new_argv, environ);
-        F_("Failed to reload initng!\n");
+	execve("/sbin/initng", new_argv, environ);
+	F_("Failed to reload initng!\n");
     }
     else
     {
-        if (retval == FALSE)
-            F_("No plugin was willing to dump state\n");
-        else
-            F_("dump_state failed!\n");
+	if (retval == FALSE)
+	    F_("No plugin was willing to dump state\n");
+	else
+	    F_("dump_state failed!\n");
     }
 }
 
@@ -128,150 +128,150 @@
     fil = fopen(filename, "r");
 
     if (!fil)
-        return FALSE;
+	return FALSE;
 
     while (!feof(fil))
     {
-        active_db_h *new_entry = NULL;
-        s_data *d = NULL;
-        data_save_struct entry;
-
-        if (!fread(&entry, sizeof(entry), 1, fil))
-            continue;
-
-        if (initng_active_db_find_by_name(entry.name))
-        {
-            W_("Entry exists, won't create it!\n");
-            continue;
-        }
-
-        /* create a new service entry */
-        if (!(new_entry = initng_active_db_new(entry.name)))
-        {
-            F_("Can't create new active!\n");
-            success = FALSE;
-            continue;
-        }
-
-        /* set current_state */
-        new_entry->current_state = initng_active_state_find(entry.state);
-        if (!new_entry->current_state)
-        {
-            F_("Could not find a proper state to set: %s.\n", entry.state);
-            success = FALSE;
-            continue;
-        }
-
-        /* set service stype */
-        if (!(new_entry->type = initng_service_types_get(entry.type)))
-        {
-            F_("Unknown service type %s.\n", entry.type);
-            success = FALSE;
-            continue;
-        }
-
-        /* set time_current_state */
-        memcpy(&new_entry->time_current_state, &entry.time_current_state,
-               sizeof(struct timeval));
-
-        /* walk through all processes */
-        {
-            int pnr = 0;
-
-            while (entry.process[pnr].ptype[0] && pnr < MAX_PROCESSES)
-            {
-                process_h *process = NULL;
-                ptype_h *pt = NULL;
-
-                while_ptypes(pt)
-                {
-                    if (strcmp(entry.process[pnr].ptype, pt->name) == 0)
-                        break;
-                }
-
-                /* check so it was found */
-                if (strcmp(entry.process[pnr].ptype, pt->name) != 0)
-                    continue;
-
-                /* allocate the process */
-                process = initng_process_db_new(pt);
-                if (!process)
-                    continue;
-
-                /* fill the data */
-                process->pid = entry.process[pnr].pid;
-                process->out_pipe[0] = entry.process[pnr].stdout1;
-                process->out_pipe[1] = entry.process[pnr].stdout2;
-                process->r_code = entry.process[pnr].rcode;
-
-                /* allocate a new output buffer for this process */
-                process->buffer = NULL;
-
-                /* add this process to the list */
-                list_add(&process->list, &new_entry->processes.list);
-
-                D_("Added process type %i to %s\n", process->pt,
-                   new_entry->name);
-
-                pnr++;
-            }
-        }
-
-        {
-            int i = 0;
-
-            while (entry.data[i].opt_type)
-            {
-                d = (s_data *) i_calloc(1, sizeof(s_data));
-                d->type = initng_service_data_types_find(entry.data[i].type);
-                if (!d->type)
-                {
-                    F_("Did not found %s!\n", entry.data[i].type);
-                    free(d);
-                    i++;
-                    continue;
-                }
-                switch (d->type->opt_type)
-                {
-                    case STRING:
-                    case STRINGS:
-                    case VARIABLE_STRING:
-                    case VARIABLE_STRINGS:
-                        d->t.s = i_strdup(entry.data[i].t.s);
-                        break;
-                    case INT:
-                    case VARIABLE_INT:
-                        d->t.i = entry.data[i].t.i;
-                        break;
-                    default:
-                        break;
-                }
-                list_add(&d->list, &new_entry->data.head.list);
-                i++;
-            }
-        }
-
-        /* add the new service to the active_db */
-        if (initng_active_db_add(new_entry) != TRUE)
-        {
-            F_("Could not add entry!\n");
-            initng_active_db_free(new_entry);
-            success = FALSE;
-            continue;
-        }
-
-        /* Don't need to reload data from disk, loaded when needed
-           if (get_service(new_entry) == TRUE)
-           new_entry->from_service =
-           service_db_find_by_name(new_entry->name);
-         */
+	active_db_h *new_entry = NULL;
+	s_data *d = NULL;
+	data_save_struct entry;
+
+	if (!fread(&entry, sizeof(entry), 1, fil))
+	    continue;
+
+	if (initng_active_db_find_by_name(entry.name))
+	{
+	    W_("Entry exists, won't create it!\n");
+	    continue;
+	}
+
+	/* create a new service entry */
+	if (!(new_entry = initng_active_db_new(entry.name)))
+	{
+	    F_("Can't create new active!\n");
+	    success = FALSE;
+	    continue;
+	}
+
+	/* set current_state */
+	new_entry->current_state = initng_active_state_find(entry.state);
+	if (!new_entry->current_state)
+	{
+	    F_("Could not find a proper state to set: %s.\n", entry.state);
+	    success = FALSE;
+	    continue;
+	}
+
+	/* set service stype */
+	if (!(new_entry->type = initng_service_types_get(entry.type)))
+	{
+	    F_("Unknown service type %s.\n", entry.type);
+	    success = FALSE;
+	    continue;
+	}
+
+	/* set time_current_state */
+	memcpy(&new_entry->time_current_state, &entry.time_current_state,
+	       sizeof(struct timeval));
+
+	/* walk through all processes */
+	{
+	    int pnr = 0;
+
+	    while (entry.process[pnr].ptype[0] && pnr < MAX_PROCESSES)
+	    {
+		process_h *process = NULL;
+		ptype_h *pt = NULL;
+
+		while_ptypes(pt)
+		{
+		    if (strcmp(entry.process[pnr].ptype, pt->name) == 0)
+			break;
+		}
+
+		/* check so it was found */
+		if (strcmp(entry.process[pnr].ptype, pt->name) != 0)
+		    continue;
+
+		/* allocate the process */
+		process = initng_process_db_new(pt);
+		if (!process)
+		    continue;
+
+		/* fill the data */
+		process->pid = entry.process[pnr].pid;
+		process->out_pipe[0] = entry.process[pnr].stdout1;
+		process->out_pipe[1] = entry.process[pnr].stdout2;
+		process->r_code = entry.process[pnr].rcode;
+
+		/* allocate a new output buffer for this process */
+		process->buffer = NULL;
+
+		/* add this process to the list */
+		list_add(&process->list, &new_entry->processes.list);
+
+		D_("Added process type %i to %s\n", process->pt,
+		   new_entry->name);
+
+		pnr++;
+	    }
+	}
+
+	{
+	    int i = 0;
+
+	    while (entry.data[i].opt_type)
+	    {
+		d = (s_data *) i_calloc(1, sizeof(s_data));
+		d->type = initng_service_data_types_find(entry.data[i].type);
+		if (!d->type)
+		{
+		    F_("Did not found %s!\n", entry.data[i].type);
+		    free(d);
+		    i++;
+		    continue;
+		}
+		switch (d->type->opt_type)
+		{
+		    case STRING:
+		    case STRINGS:
+		    case VARIABLE_STRING:
+		    case VARIABLE_STRINGS:
+			d->t.s = i_strdup(entry.data[i].t.s);
+			break;
+		    case INT:
+		    case VARIABLE_INT:
+			d->t.i = entry.data[i].t.i;
+			break;
+		    default:
+			break;
+		}
+		list_add(&d->list, &new_entry->data.head.list);
+		i++;
+	    }
+	}
+
+	/* add the new service to the active_db */
+	if (initng_active_db_add(new_entry) != TRUE)
+	{
+	    F_("Could not add entry!\n");
+	    initng_active_db_free(new_entry);
+	    success = FALSE;
+	    continue;
+	}
+
+	/* Don't need to reload data from disk, loaded when needed
+	   if (get_service(new_entry) == TRUE)
+	   new_entry->from_service =
+	   service_db_find_by_name(new_entry->name);
+	 */
     }
 
     fclose(fil);
     if (unlink(filename) != 0)
     {
-        W_("Failed removing file %s !!!\n", filename);
-        return success;                     /* not important */
+	W_("Failed removing file %s !!!\n", filename);
+	return success;			    /* not important */
     }
 
     return success;
@@ -290,107 +290,107 @@
     fil = fopen(filename, "w+");
     if (!fil)
     {
-        F_("Could not open '%s' for writing\n", filename);
-        return FALSE;
+	F_("Could not open '%s' for writing\n", filename);
+	return FALSE;
     }
 
     /* walk the active_db */
     while_active_db_safe(current, q)
     {
-        if (!current->current_state)
-        {
-            F_("State is not set, wont save this one!\n");
-            continue;
-        }
-
-        if (strlen(current->name) >= MAX_SERVICE_NAME_STRING_LEN)
-        {
-            F_("Service name is to long, it won't fit the fileformat spec! max is %i, won't save this service!\n", MAX_SERVICE_NAME_STRING_LEN);
-            success = FALSE;
-            continue;
-        }
-
-        memset(&entry, 0, sizeof entry);
-        strncpy(entry.name, current->name, MAX_SERVICE_NAME_STRING_LEN);
-        strncpy(entry.state, current->current_state->state_name, 100);
-        strncpy(entry.type, current->type->name, 100);
-        memcpy(&entry.time_current_state, &current->time_current_state,
-               sizeof(struct timeval));
-
-        /* collect some processes */
-        process = NULL;
-        pnr = 0;
-        while_processes(process, current)
-        {
-            strncpy(entry.process[pnr].ptype, process->pt->name,
-                    MAX_PTYPE_STRING_LEN);
-            entry.process[pnr].pid = process->pid;
-            entry.process[pnr].stdout1 = process->out_pipe[0];
-            entry.process[pnr].stdout2 = process->out_pipe[1];
-            entry.process[pnr].rcode = process->r_code;
-            pnr++;
-            if (pnr >= MAX_PROCESSES)
-                break;
-        }
-        entry.process[pnr].ptype[0] = '\0';
-
-        /* reset data */
-        for (i = 0; i < MAX_ENTRYS_FOR_SERVICE; i++)
-        {
-            entry.data[i].opt_type = 0;
-            entry.data[i].type[0] = '\0';
-            entry.data[i].t.i = 0;
-        }
-
-        i = 0;
-        list_for_each_entry(c_d, &current->data.head.list, list)
-        {
-            if (!c_d->type)
-                continue;
-            if (!c_d->type->opt_name)
-                continue;
-
-            entry.data[i].opt_type = c_d->type->opt_type;
-            strncpy(entry.data[i].type, c_d->type->opt_name,
-                    MAX_TYPE_STRING_LEN);
-
-            /* copy the data */
-            switch (c_d->type->opt_type)
-            {
-                case STRING:
-                case STRINGS:
-                case VARIABLE_STRING:
-                case VARIABLE_STRINGS:
-                    strncpy(entry.data[i].t.s, c_d->t.s, MAX_DATA_STRING_LEN);
-                    break;
-                case INT:
-                case VARIABLE_INT:
-                    entry.data[i].t.i = c_d->t.i;
-                    break;
-                default:
-                    break;
-            }
-
-            /* save in next data entry row */
-            i++;
-
-            /* maximum data entries that can be saved */
-            if (i == MAX_ENTRYS_FOR_SERVICE)
-            {
-                F_("Maximum 20 data entries / service can't be saved!\n");
-                success = FALSE;
-                break;
-            }
-        }
-
-        D_("Saving : %s\n", entry.name);
-        if (fwrite(&entry, sizeof(entry), 1, fil) != 1)
-        {
-            F_("failed to write entry '%s': %m\n", entry.name);
-            /* TODO: database recovery?? */
-            success = FALSE;
-            break;
-        }
+	if (!current->current_state)
+	{
+	    F_("State is not set, wont save this one!\n");
+	    continue;
+	}
+
+	if (strlen(current->name) >= MAX_SERVICE_NAME_STRING_LEN)
+	{
+	    F_("Service name is to long, it won't fit the fileformat spec! max is %i, won't save this service!\n", MAX_SERVICE_NAME_STRING_LEN);
+	    success = FALSE;
+	    continue;
+	}
+
+	memset(&entry, 0, sizeof entry);
+	strncpy(entry.name, current->name, MAX_SERVICE_NAME_STRING_LEN);
+	strncpy(entry.state, current->current_state->state_name, 100);
+	strncpy(entry.type, current->type->name, 100);
+	memcpy(&entry.time_current_state, &current->time_current_state,
+	       sizeof(struct timeval));
+
+	/* collect some processes */
+	process = NULL;
+	pnr = 0;
+	while_processes(process, current)
+	{
+	    strncpy(entry.process[pnr].ptype, process->pt->name,
+		    MAX_PTYPE_STRING_LEN);
+	    entry.process[pnr].pid = process->pid;
+	    entry.process[pnr].stdout1 = process->out_pipe[0];
+	    entry.process[pnr].stdout2 = process->out_pipe[1];
+	    entry.process[pnr].rcode = process->r_code;
+	    pnr++;
+	    if (pnr >= MAX_PROCESSES)
+		break;
+	}
+	entry.process[pnr].ptype[0] = '\0';
+
+	/* reset data */
+	for (i = 0; i < MAX_ENTRYS_FOR_SERVICE; i++)
+	{
+	    entry.data[i].opt_type = 0;
+	    entry.data[i].type[0] = '\0';
+	    entry.data[i].t.i = 0;
+	}
+
+	i = 0;
+	list_for_each_entry(c_d, &current->data.head.list, list)
+	{
+	    if (!c_d->type)
+		continue;
+	    if (!c_d->type->opt_name)
+		continue;
+
+	    entry.data[i].opt_type = c_d->type->opt_type;
+	    strncpy(entry.data[i].type, c_d->type->opt_name,
+		    MAX_TYPE_STRING_LEN);
+
+	    /* copy the data */
+	    switch (c_d->type->opt_type)
+	    {
+		case STRING:
+		case STRINGS:
+		case VARIABLE_STRING:
+		case VARIABLE_STRINGS:
+		    strncpy(entry.data[i].t.s, c_d->t.s, MAX_DATA_STRING_LEN);
+		    break;
+		case INT:
+		case VARIABLE_INT:
+		    entry.data[i].t.i = c_d->t.i;
+		    break;
+		default:
+		    break;
+	    }
+
+	    /* save in next data entry row */
+	    i++;
+
+	    /* maximum data entries that can be saved */
+	    if (i == MAX_ENTRYS_FOR_SERVICE)
+	    {
+		F_("Maximum 20 data entries / service can't be saved!\n");
+		success = FALSE;
+		break;
+	    }
+	}
+
+	D_("Saving : %s\n", entry.name);
+	if (fwrite(&entry, sizeof(entry), 1, fil) != 1)
+	{
+	    F_("failed to write entry '%s': %m\n", entry.name);
+	    /* TODO: database recovery?? */
+	    success = FALSE;
+	    break;
+	}
     }
 
     fclose(fil);
@@ -403,11 +403,11 @@
 
     if (g.i_am_init)
     {
-        retval = write_file(SAVE_FILE);
+	retval = write_file(SAVE_FILE);
     }
     else
     {
-        retval = write_file(SAVE_FILE_FAKE);
+	retval = write_file(SAVE_FILE_FAKE);
     }
     return retval ? TRUE : FAIL;
 }
@@ -419,16 +419,16 @@
 
     if (stat(g.i_am_init ? SAVE_FILE : SAVE_FILE_FAKE, &st))
     {
-        D_("No state file found, passing on reload_state request\n");
-        return FALSE;
+	D_("No state file found, passing on reload_state request\n");
+	return FALSE;
     }
     if (g.i_am_init)
     {
-        retval = read_file(SAVE_FILE);
+	retval = read_file(SAVE_FILE);
     }
     else
     {
-        retval = read_file(SAVE_FILE_FAKE);
+	retval = read_file(SAVE_FILE_FAKE);
     }
     return retval ? TRUE : FAIL;
 }
@@ -439,30 +439,30 @@
     /* only save when system is getting up */
     if (state == STATE_UP)
     {
-        /* save file */
-        if (g.i_am_init)
-        {
-            write_file(SAVE_FILE);
-        }
-        else
-        {
-            write_file(SAVE_FILE_FAKE);
-        }
-        return;
+	/* save file */
+	if (g.i_am_init)
+	{
+	    write_file(SAVE_FILE);
+	}
+	else
+	{
+	    write_file(SAVE_FILE_FAKE);
+	}
+	return;
     }
 
     /* if system is stopping, remove the SAVE_FILE */
     if (state == STATE_STOPPING)
     {
-        if (g.i_am_init)
-        {
-            unlink(SAVE_FILE);
-        }
-        else
-        {
-            unlink(SAVE_FILE_FAKE);
-        }
-        return;
+	if (g.i_am_init)
+	{
+	    unlink(SAVE_FILE);
+	}
+	else
+	{
+	    unlink(SAVE_FILE_FAKE);
+	}
+	return;
     }
 }
 
@@ -471,8 +471,8 @@
     D_("module_init(reload);\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     /*    if (g.hot_reload)

Modified: initng/trunk/plugins/reload/initng_reload.h
==============================================================================
--- initng/trunk/plugins/reload/initng_reload.h	(original)
+++ initng/trunk/plugins/reload/initng_reload.h	Wed Apr  5 22:57:12 2006
@@ -37,8 +37,8 @@
     e_dt opt_type;
     union
     {
-        char s[MAX_DATA_STRING_LEN + 1];
-        int i;
+	char s[MAX_DATA_STRING_LEN + 1];
+	int i;
     } t;
 } r_d_e;
 

Modified: initng/trunk/plugins/renice/initng_renice.c
==============================================================================
--- initng/trunk/plugins/renice/initng_renice.c	(original)
+++ initng/trunk/plugins/renice/initng_renice.c	Wed Apr  5 22:57:12 2006
@@ -41,13 +41,13 @@
 
     if (is(&NICE, s))
     {
-        D_("Will renice %s to %i !\n", s->name, get_int(&NICE, s));
-        errno = 0;
-        if (nice(get_int(&NICE, s)) == -1 && errno != 0)
-        {
-            F_("Failed to set the nice value: %s\n", strerror(errno));
-            return FALSE;
-        }
+	D_("Will renice %s to %i !\n", s->name, get_int(&NICE, s));
+	errno = 0;
+	if (nice(get_int(&NICE, s)) == -1 && errno != 0)
+	{
+	    F_("Failed to set the nice value: %s\n", strerror(errno));
+	    return FALSE;
+	}
     }
     return (TRUE);
 }
@@ -57,8 +57,8 @@
     D_("module_init();\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     initng_service_data_types_add(&NICE);

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	Wed Apr  5 22:57:12 2006
@@ -46,9 +46,9 @@
 stype_h *TYPE_VIRTUAL;
 
 static service_cache_h *parse_file(char *filetoparse,
-                                   const char *runlevel_name, stype_h * type)
+				   const char *runlevel_name, stype_h * type)
 {
-    service_cache_h *n_service; /* service struct pointer too   */
+    service_cache_h *n_service;	/* service struct pointer too   */
     char *w = NULL;
     char *a = NULL;
     char *w_depends = NULL;
@@ -56,49 +56,49 @@
     /* allocate a new service */
     if (!(n_service = initng_service_cache_new(runlevel_name, type)))
     {
-        free(filetoparse);
-        return (NULL);
+	free(filetoparse);
+	return (NULL);
     }
 
     /* copy file filename into allocated file_buf */
     if (!open_read_close(filetoparse, &w_depends))
     {
-        D_("parse_file(%s): Can't open config file!\n", filetoparse);
-        if (n_service->name)
-            free(n_service->name);
-
-        /* free all data entries */
-        dfree_all(n_service);
-
-        if (n_service)
-            free(n_service);
-        free(filetoparse);
-        return (NULL);
+	D_("parse_file(%s): Can't open config file!\n", filetoparse);
+	if (n_service->name)
+	    free(n_service->name);
+
+	/* free all data entries */
+	dfree_all(n_service);
+
+	if (n_service)
+	    free(n_service);
+	free(filetoparse);
+	return (NULL);
     }
     w = w_depends;
 
     while (w[0] != '\0')
     {
-        /* skip leading spaces */
-        JUMP_SPACES(w);
-        if (w[0] == '\0')
-            break;
-
-        /* skip lines, starting with '#' */
-        if (w[0] == '#')
-        {
-            JUMP_TO_NEXT_ROW(w);
-            continue;
-        }
-
-        a = st_dup_line(&w);
-        if (a)
-        {
-            D_("adding dep: \"%s\"\n", a);
-            set_another_string(&NEED, n_service, a);
-        }
+	/* skip leading spaces */
+	JUMP_SPACES(w);
+	if (w[0] == '\0')
+	    break;
+
+	/* skip lines, starting with '#' */
+	if (w[0] == '#')
+	{
+	    JUMP_TO_NEXT_ROW(w);
+	    continue;
+	}
+
+	a = st_dup_line(&w);
+	if (a)
+	{
+	    D_("adding dep: \"%s\"\n", a);
+	    set_another_string(&NEED, n_service, a);
+	}
 
-        JUMP_TO_NEXT_ROW(w);
+	JUMP_TO_NEXT_ROW(w);
     }
 
     free(w_depends);
@@ -108,7 +108,7 @@
     free(filetoparse);
 
     if (initng_service_cache_add(n_service))
-        return (n_service);
+	return (n_service);
     return (NULL);
 
 
@@ -128,26 +128,26 @@
     /* make sure service type RUNLEVEL is set */
     if (!TYPE_RUNLEVEL)
     {
-        TYPE_RUNLEVEL = initng_service_types_get("runlevel");
-        if (!TYPE_RUNLEVEL)
-        {
-            F_("ERROR, runlevel servicetype is not found, make sure runlevel plugin is loaded.\n");
-            return (NULL);
-        }
+	TYPE_RUNLEVEL = initng_service_types_get("runlevel");
+	if (!TYPE_RUNLEVEL)
+	{
+	    F_("ERROR, runlevel servicetype is not found, make sure runlevel plugin is loaded.\n");
+	    return (NULL);
+	}
     }
 
     if (!TYPE_VIRTUAL)
     {
-        TYPE_VIRTUAL = initng_service_types_get("virtual");
-        if (!TYPE_VIRTUAL)
-        {
-            F_("ERROR, virtual servicetype is not found, make sure runlevel plugin is loaded.\n");
-            return (NULL);
-        }
+	TYPE_VIRTUAL = initng_service_types_get("virtual");
+	if (!TYPE_VIRTUAL)
+	{
+	    F_("ERROR, virtual servicetype is not found, make sure runlevel plugin is loaded.\n");
+	    return (NULL);
+	}
     }
 
     filetoparse = (char *) i_calloc(strlen(INITNG_ROOT) + 1 +
-                                    strlen(runlevel_name) + 10, sizeof(char));
+				    strlen(runlevel_name) + 10, sizeof(char));
 
     /* check /etc/initng/name.virtual */
     strcpy(filetoparse, INITNG_ROOT "/");
@@ -156,7 +156,7 @@
 
     if (stat(filetoparse, &file_stat) == 0 && S_ISREG(file_stat.st_mode))
     {
-        return (parse_file(filetoparse, runlevel_name, TYPE_VIRTUAL));
+	return (parse_file(filetoparse, runlevel_name, TYPE_VIRTUAL));
     }
 
     /* check /etc/initng/name.runlevel */
@@ -166,7 +166,7 @@
 
     if (stat(filetoparse, &file_stat) == 0 && S_ISREG(file_stat.st_mode))
     {
-        return (parse_file(filetoparse, runlevel_name, TYPE_RUNLEVEL));
+	return (parse_file(filetoparse, runlevel_name, TYPE_RUNLEVEL));
     }
 
     return (NULL);
@@ -180,8 +180,8 @@
     D_("initng_rl_parser: module_init();\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     return (initng_plugin_hook_add(&g.PARSERS, 60, &initng_rl_parser));

Modified: initng/trunk/plugins/runlevel/initng_runlevel.c
==============================================================================
--- initng/trunk/plugins/runlevel/initng_runlevel.c	(original)
+++ initng/trunk/plugins/runlevel/initng_runlevel.c	Wed Apr  5 22:57:12 2006
@@ -21,7 +21,7 @@
 
 
 #include <stdio.h>
-#include <stdlib.h>                         /* free() exit() */
+#include <stdlib.h>			    /* free() exit() */
 #include <string.h>
 #include <assert.h>
 /*#include <time.h> */
@@ -128,16 +128,16 @@
     /* if not yet stopped */
     if (IS_MARK(service, &RUNLEVEL_WAITING_FOR_STOP_DEP))
     {
-        initng_common_mark_service(service, &RUNLEVEL_UP);
-        return (TRUE);
+	initng_common_mark_service(service, &RUNLEVEL_UP);
+	return (TRUE);
     }
 
     /* mark it WAITING_FOR_START_DEP and wait */
     if (!initng_common_mark_service(service, &RUNLEVEL_START_MARKED))
     {
-        W_("mark_service RUNLEVEL_START_MARKED failed for service %s\n",
-           service->name);
-        return (FALSE);
+	W_("mark_service RUNLEVEL_START_MARKED failed for service %s\n",
+	   service->name);
+	return (FALSE);
     }
 
     /* return happily */
@@ -152,16 +152,16 @@
     /* if not yet stopped */
     if (IS_MARK(service, &RUNLEVEL_WAITING_FOR_START_DEP))
     {
-        initng_common_mark_service(service, &RUNLEVEL_DOWN);
-        return (TRUE);
+	initng_common_mark_service(service, &RUNLEVEL_DOWN);
+	return (TRUE);
     }
 
     /* set stopping */
     if (!initng_common_mark_service(service, &RUNLEVEL_STOP_MARKED))
     {
-        W_("mark_service RUNLEVEL_STOP_MARKED failed for service %s.\n",
-           service->name);
-        return (FALSE);
+	W_("mark_service RUNLEVEL_STOP_MARKED failed for service %s.\n",
+	   service->name);
+	return (FALSE);
     }
 
     /* return happily */
@@ -179,8 +179,8 @@
     D_("module_init();\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     initng_service_types_add(&TYPE_RUNLEVEL);
@@ -240,72 +240,72 @@
     /* Make sure there will only exist 1 runlevel on the system */
     if (new_runlevel->type == &TYPE_RUNLEVEL)
     {
-        active_db_h *current = NULL;
-        active_db_h *old_runlevel = NULL;
+	active_db_h *current = NULL;
+	active_db_h *old_runlevel = NULL;
 
-        /* STEP 1, Go find old runlevel, shud be only one */
-        while_active_db(current)
-        {
-            /* dont look for myself */
-            if (current == new_runlevel)
-                continue;
-
-            if (current->type == &TYPE_RUNLEVEL)
-            {
-                old_runlevel = current;
-                break;
-            }
-        }
-
-        /* if an old runlevel was found */
-        if (old_runlevel)
-        {
-            const char *dep_old = NULL;
-            s_data *itt_old = NULL;
-
-            /* STEP 2, Stop all old runlevel deps, that are not deps of new runlevel */
-
-            /* for every dep the old runlevel have */
-            while ((dep_old = get_next_string(&NEED, old_runlevel, &itt_old)))
-            {
-                const char *dep_new = NULL;
-                s_data *itt_new = NULL;
-                int found = 0;
-
-                while ((dep_new =
-                        get_next_string(&NEED, new_runlevel, &itt_new)))
-                {
-                    /* if it matches */
-                    if (strcmp(dep_new, dep_old) == 0)
-                    {
-                        found = 1;
-                        break;
-                    }
-                }
-
-
-                /* If the service found in old runlevel, does not exsist i new one, stop it */
-                if (found == 0)
-                {
-                    active_db_h *service_to_stop = initng_active_db_find_by_name(dep_old);
-
-                    if (service_to_stop)
-                    {
-                        W_("Stopping service %s, not in new service %s\n",
-                           service_to_stop->name, new_runlevel->name);
-                        initng_handler_stop_service(service_to_stop);
-                    }
-                }
-            }
-            /* check that it also exists in new runlevel */
-
-
-            /* STEP 3, Stop old runlevel */
-            initng_handler_stop_service(old_runlevel);
-        }
-        free(g.runlevel);
-        g.runlevel = NULL;
-        g.runlevel = i_strdup(new_runlevel->name);
+	/* STEP 1, Go find old runlevel, shud be only one */
+	while_active_db(current)
+	{
+	    /* dont look for myself */
+	    if (current == new_runlevel)
+		continue;
+
+	    if (current->type == &TYPE_RUNLEVEL)
+	    {
+		old_runlevel = current;
+		break;
+	    }
+	}
+
+	/* if an old runlevel was found */
+	if (old_runlevel)
+	{
+	    const char *dep_old = NULL;
+	    s_data *itt_old = NULL;
+
+	    /* STEP 2, Stop all old runlevel deps, that are not deps of new runlevel */
+
+	    /* for every dep the old runlevel have */
+	    while ((dep_old = get_next_string(&NEED, old_runlevel, &itt_old)))
+	    {
+		const char *dep_new = NULL;
+		s_data *itt_new = NULL;
+		int found = 0;
+
+		while ((dep_new =
+			get_next_string(&NEED, new_runlevel, &itt_new)))
+		{
+		    /* if it matches */
+		    if (strcmp(dep_new, dep_old) == 0)
+		    {
+			found = 1;
+			break;
+		    }
+		}
+
+
+		/* If the service found in old runlevel, does not exsist i new one, stop it */
+		if (found == 0)
+		{
+		    active_db_h *service_to_stop = initng_active_db_find_by_name(dep_old);
+
+		    if (service_to_stop)
+		    {
+			W_("Stopping service %s, not in new service %s\n",
+			   service_to_stop->name, new_runlevel->name);
+			initng_handler_stop_service(service_to_stop);
+		    }
+		}
+	    }
+	    /* check that it also exists in new runlevel */
+
+
+	    /* STEP 3, Stop old runlevel */
+	    initng_handler_stop_service(old_runlevel);
+	}
+	free(g.runlevel);
+	g.runlevel = NULL;
+	g.runlevel = i_strdup(new_runlevel->name);
     }
 
     initng_common_mark_service(new_runlevel, &RUNLEVEL_WAITING_FOR_START_DEP);
@@ -330,20 +330,20 @@
 
     switch (initng_depend_start_dep_met(service, FALSE))
     {
-            /* if not met, youst return */
-        case FALSE:
-            return;
+	    /* if not met, youst return */
+	case FALSE:
+	    return;
 
 
-            /* set FAILURE */
-        case FAIL:
-            initng_common_mark_service(service, &RUNLEVEL_START_DEPS_FAILED);
-            return;
-
-            /* if met, continue */
-        case TRUE:
-        default:
-            break;
+	    /* set FAILURE */
+	case FAIL:
+	    initng_common_mark_service(service, &RUNLEVEL_START_DEPS_FAILED);
+	    return;
+
+	    /* if met, continue */
+	case TRUE:
+	default:
+	    break;
     }
 
     /* set status to START_DEP_MET */
@@ -358,14 +358,14 @@
     /* check with other plug-ins, if it is ok to stop this service now */
     switch (initng_depend_stop_dep_met(service, FALSE))
     {
-            /* deps not met, youst return */
-        case FALSE:
-            return;
-
-            /* if met, youst continue */
-        case TRUE:
-        default:
-            break;
+	    /* deps not met, youst return */
+	case FALSE:
+	    return;
+
+	    /* if met, youst continue */
+	case TRUE:
+	default:
+	    break;
 
     }
 

Modified: initng/trunk/plugins/service/initng_service.c
==============================================================================
--- initng/trunk/plugins/service/initng_service.c	(original)
+++ initng/trunk/plugins/service/initng_service.c	Wed Apr  5 22:57:12 2006
@@ -21,7 +21,7 @@
 
 
 #include <stdio.h>
-#include <stdlib.h>                         /* free() exit() */
+#include <stdlib.h>			    /* free() exit() */
 #include <string.h>
 #include <assert.h>
 #include <sys/types.h>
@@ -74,9 +74,9 @@
  * ############################################################################
  */
 static void handle_killed_start(active_db_h * killed_service,
-                                process_h * process);
+				process_h * process);
 static void handle_killed_stop(active_db_h * killed_service,
-                               process_h * process);
+			       process_h * process);
 
 
 /*
@@ -216,16 +216,16 @@
     /* if not stopped yet, reset DONE */
     if (IS_MARK(service, &SERVICE_WAITING_FOR_STOP_DEP))
     {
-        initng_common_mark_service(service, &SERVICE_DONE);
-        return (TRUE);
+	initng_common_mark_service(service, &SERVICE_DONE);
+	return (TRUE);
     }
 
     /* mark it WAITING_FOR_START_DEP and wait */
     if (!initng_common_mark_service(service, &SERVICE_START_MARKED))
     {
-        W_("mark_service SERVICE_START_MARKED failed for service %s\n",
-           service->name);
-        return (FALSE);
+	W_("mark_service SERVICE_START_MARKED failed for service %s\n",
+	   service->name);
+	return (FALSE);
     }
 
     /* return happily */
@@ -239,17 +239,17 @@
     /* if not started yet, reset STOPPED */
     if (IS_MARK(service, &SERVICE_WAITING_FOR_START_DEP))
     {
-        initng_common_mark_service(service, &SERVICE_STOPPED);
-        return (TRUE);
+	initng_common_mark_service(service, &SERVICE_STOPPED);
+	return (TRUE);
     }
 
 
     /* set stopping */
     if (!initng_common_mark_service(service, &SERVICE_STOP_MARKED))
     {
-        W_("mark_service SERVICE_STOP_MARKED failed for service %s.\n",
-           service->name);
-        return (FALSE);
+	W_("mark_service SERVICE_STOP_MARKED failed for service %s.\n",
+	   service->name);
+	return (FALSE);
     }
 
     /* return happily */
@@ -268,8 +268,8 @@
     D_("module_init();\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     initng_service_types_add(&TYPE_SERVICE);
@@ -355,8 +355,8 @@
     /* Start our dependencies */
     if (initng_depend_start_deps(service) != TRUE)
     {
-        initng_common_mark_service(service, &SERVICE_FAIL_STARTING);
-        return;
+	initng_common_mark_service(service, &SERVICE_FAIL_STARTING);
+	return;
     }
 
     /* set WAITING_FOR_START_DEP */
@@ -371,8 +371,8 @@
     /* Stopp all services dependeing on this service */
     if (initng_depend_stop_deps(service) != TRUE)
     {
-        initng_common_mark_service(service, &SERVICE_FAIL_STOPPING);
-        return;
+	initng_common_mark_service(service, &SERVICE_FAIL_STOPPING);
+	return;
     }
 
     initng_common_mark_service(service, &SERVICE_WAITING_FOR_STOP_DEP);
@@ -391,22 +391,22 @@
      */
     switch (initng_depend_start_dep_met(service, FALSE))
     {
-        case TRUE:
-            break;
-        case FAIL:
-            initng_common_mark_service(service, &SERVICE_START_DEPS_FAILED);
-            return;
-        default:
-            /* return and hope that this handler will be called again. */
-            return;
+	case TRUE:
+	    break;
+	case FAIL:
+	    initng_common_mark_service(service, &SERVICE_START_DEPS_FAILED);
+	    return;
+	default:
+	    /* return and hope that this handler will be called again. */
+	    return;
     }
 
     /* if system is shutting down, don't start anything */
     if (g.sys_state != STATE_STARTING && g.sys_state != STATE_UP)
     {
-        D_("Can't start service, when system status is: %i !\n", g.sys_state);
-        initng_common_mark_service(service, &SERVICE_STOPPED);
-        return;
+	D_("Can't start service, when system status is: %i !\n", g.sys_state);
+	initng_common_mark_service(service, &SERVICE_STOPPED);
+	return;
     }
 
     /* set status to START_DEP_MET */
@@ -420,7 +420,7 @@
 
     /* check with other plug-ins, if it is ok to stop this service now */
     if (initng_depend_stop_dep_met(service, FALSE) != TRUE)
-        return;
+	return;
 
     /* ok, stopping deps are met */
     initng_common_mark_service(service, &SERVICE_STOP_DEPS_MET);
@@ -429,21 +429,21 @@
 static void init_SERVICE_START_DEPS_MET(active_db_h * service)
 {
     if (!initng_common_mark_service(service, &SERVICE_START_RUN))
-        return;
+	return;
 
     /* F I N A L L Y   S T A R T */
     switch (initng_execute_launch(service, &T_START))
     {
-        case FALSE:
-            F_("Did not find a start entry to run!\n", service->name);
-            initng_common_mark_service(service, &SERVICE_FAIL_STARTING);
-            return;
-        case FAIL:
-            F_("Service %s, could not launch start, did not find any to launch!\n", service->name);
-            initng_common_mark_service(service, &SERVICE_FAIL_STARTING);
-            return;
-        default:
-            return;
+	case FALSE:
+	    F_("Did not find a start entry to run!\n", service->name);
+	    initng_common_mark_service(service, &SERVICE_FAIL_STARTING);
+	    return;
+	case FAIL:
+	    F_("Service %s, could not launch start, did not find any to launch!\n", service->name);
+	    initng_common_mark_service(service, &SERVICE_FAIL_STARTING);
+	    return;
+	default:
+	    return;
     }
 
 }
@@ -452,21 +452,21 @@
 {
     /* mark this service as STOPPING */
     if (!initng_common_mark_service(service, &SERVICE_STOP_RUN))
-        return;
+	return;
 
     /* launch stop service */
     switch (initng_execute_launch(service, &T_STOP))
     {
-        case FAIL:
-            F_("  --  (%s): fail launch stop!\n", service->name);
-            initng_common_mark_service(service, &SERVICE_FAIL_STOPPING);
-            return;
-        case FALSE:
-            /* there exists no stop process */
-            initng_common_mark_service(service, &SERVICE_STOPPED);
-            return;
-        default:
-            return;
+	case FAIL:
+	    F_("  --  (%s): fail launch stop!\n", service->name);
+	    initng_common_mark_service(service, &SERVICE_FAIL_STOPPING);
+	    return;
+	case FALSE:
+	    /* there exists no stop process */
+	    initng_common_mark_service(service, &SERVICE_STOPPED);
+	    return;
+	default:
+	    return;
     }
 
 }
@@ -484,14 +484,14 @@
 
     /* if NEVER_KILL is set, dont bother */
     if (is(&NEVER_KILL, service))
-        return;
+	return;
 
     /* get the timeout */
     timeout = get_int(&START_TIMEOUT, service);
 
     /* if not set, use the default one */
     if (!timeout)
-        timeout = DEFAULT_START_TIMEOUT;
+	timeout = DEFAULT_START_TIMEOUT;
 
     /* set state alarm */
     initng_handler_set_alarm(service, timeout);
@@ -510,14 +510,14 @@
 
     /* if NEVER_KILL is set, dont bother */
     if (is(&NEVER_KILL, service))
-        return;
+	return;
 
     /* get the timeout */
     timeout = get_int(&STOP_TIMEOUT, service);
 
     /* if not set, use the default timeout */
     if (!timeout)
-        timeout = DEFAULT_STOP_TIMEOUT;
+	timeout = DEFAULT_STOP_TIMEOUT;
 
     /* set state alarm */
     initng_handler_set_alarm(service, timeout);
@@ -534,16 +534,16 @@
     /* get the process */
     if (!(process = initng_process_db_get(&T_START, service)))
     {
-        F_("Did not find the T_START process!\n");
-        return;
+	F_("Did not find the T_START process!\n");
+	return;
     }
 
     /* if the process does not exist on the system anymore, run the killd handler. */
     if (process->pid <= 0 || (kill(process->pid, 0) && errno == ESRCH))
     {
-        W_("The start process have dissapeared from the system without notice, running start kill handler.\n");
-        handle_killed_start(service, process);
-        return;
+	W_("The start process have dissapeared from the system without notice, running start kill handler.\n");
+	handle_killed_start(service, process);
+	return;
     }
 
     /* send the process the SIGKILL signal */
@@ -563,16 +563,16 @@
     /* get the process */
     if (!(process = initng_process_db_get(&T_STOP, service)))
     {
-        F_("Did not find the T_STOP process!\n");
-        return;
+	F_("Did not find the T_STOP process!\n");
+	return;
     }
 
     /* if the process does not exist on the system anymore, run the killd handler. */
     if (process->pid <= 0 || (kill(process->pid, 0) && errno == ESRCH))
     {
-        W_("The stop process have dissapeared from the system without notice, running stop kill handler.\n");
-        handle_killed_stop(service, process);
-        return;
+	W_("The stop process have dissapeared from the system without notice, running stop kill handler.\n");
+	handle_killed_stop(service, process);
+	return;
     }
 
     /* send the process the SIGKILL signal */
@@ -616,17 +616,17 @@
      * that something got wrong, print this as an error msg on screen
      */
     if (process->r_code > 0)
-        F_(" start %s, Returned with exit %i.\n", service->name,
-           process->r_code);
+	F_(" start %s, Returned with exit %i.\n", service->name,
+	   process->r_code);
 
     /*
      * If this exited after a timeout, stay failed
      */
     if (IS_MARK(service, &SERVICE_START_FAILED_TIMEOUT))
     {
-        list_del(&process->list);
-        initng_process_db_free(process);
-        return;
+	list_del(&process->list);
+	initng_process_db_free(process);
+	return;
     }
 
     /*
@@ -634,8 +634,8 @@
      */
     if (!IS_MARK(service, &SERVICE_START_RUN))
     {
-        F_("Start exited!, and service is not marked starting!\n");
-        return;
+	F_("Start exited!, and service is not marked starting!\n");
+	return;
     }
 
 
@@ -647,19 +647,19 @@
     if (process->r_code && !is(&START_FAIL_OK, service))
     {
 
-        initng_common_mark_service(service, &SERVICE_FAIL_STARTING);
-        list_del(&process->list);
-        initng_process_db_free(process);
-        return;
+	initng_common_mark_service(service, &SERVICE_FAIL_STARTING);
+	list_del(&process->list);
+	initng_process_db_free(process);
+	return;
     }
 
     /* make the final up check */
     if (initng_depend_up_check(service) != TRUE)
     {
-        initng_common_mark_service(service, &SERVICE_UP_CHECK_FAILED);
-        list_del(&process->list);
-        initng_process_db_free(process);
-        return;
+	initng_common_mark_service(service, &SERVICE_UP_CHECK_FAILED);
+	list_del(&process->list);
+	initng_process_db_free(process);
+	return;
     }
 
     /* OK! now service is DONE! */
@@ -687,16 +687,16 @@
      */
     if (IS_MARK(service, &SERVICE_STOP_FAILED_TIMEOUT))
     {
-        list_del(&process->list);
-        initng_process_db_free(process);
-        return;
+	list_del(&process->list);
+	initng_process_db_free(process);
+	return;
     }
 
     /* make sure its a STOP_RUN state */
     if (!IS_MARK(service, &SERVICE_STOP_RUN))
     {
-        F_("stop service died, but service is not status STOPPING!\n");
-        return;
+	F_("stop service died, but service is not status STOPPING!\n");
+	return;
     }
 
     /*
@@ -706,17 +706,17 @@
      */
     if (process->r_code > 0 && !is(&STOP_FAIL_OK, service))
     {
-        F_(" stop %s, Returned with exit %i.\n", service->name,
-           process->r_code);
+	F_(" stop %s, Returned with exit %i.\n", service->name,
+	   process->r_code);
 
-        /* free stopped process data */
-        list_del(&process->list);
-        initng_process_db_free(process);
+	/* free stopped process data */
+	list_del(&process->list);
+	initng_process_db_free(process);
 
-        /* mark service stopped */
-        initng_common_mark_service(service, &SERVICE_FAIL_STOPPING);
+	/* mark service stopped */
+	initng_common_mark_service(service, &SERVICE_FAIL_STOPPING);
 
-        return;
+	return;
     }
 
     /* free stopped process data */

Modified: initng/trunk/plugins/simple_launcher/initng_simple_launcher.c
==============================================================================
--- initng/trunk/plugins/simple_launcher/initng_simple_launcher.c	(original)
+++ initng/trunk/plugins/simple_launcher/initng_simple_launcher.c	Wed Apr  5 22:57:12 2006
@@ -20,12 +20,12 @@
 
 #include <initng.h>
 
-#include <time.h>                           /* time() */
-#include <fcntl.h>                          /* fcntl() */
-#include <unistd.h>                         /* execv() pipe() usleep() pause() chown() */
-#include <sys/wait.h>                       /* waitpid() sa */
-#include <sys/ioctl.h>                      /* ioctl() */
-#include <stdlib.h>                         /* free() exit() */
+#include <time.h>			    /* time() */
+#include <fcntl.h>			    /* fcntl() */
+#include <unistd.h>			    /* execv() pipe() usleep() pause() chown() */
+#include <sys/wait.h>			    /* waitpid() sa */
+#include <sys/ioctl.h>			    /* ioctl() */
+#include <stdlib.h>			    /* free() exit() */
 #include <stdio.h>
 #include <string.h>
 #include <assert.h>
@@ -92,7 +92,7 @@
 
 
     if (!exec)
-        return NULL;
+	return NULL;
 
     /* 11/20/2005 SaTaN0rX: preliminary support for searching the PATH
      * only search the PATH if this is NOT already an absolute path
@@ -100,7 +100,7 @@
 
     /* if path provided, just return */
     if (exec[0] == '/')
-        return (NULL);
+	return (NULL);
 
     /* get exec string length to later use */
     exec_len = strlen(exec);
@@ -114,13 +114,13 @@
     /* Make sure we got a path */
     if (!PATH)
     {
-        D_("No $PATH found, using default path\n");
-        PATH = i_strdup("/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin");
+	D_("No $PATH found, using default path\n");
+	PATH = i_strdup("/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin");
     }
     else
     {
-        /* PATH will later be changed, so we have to use a duplicate */
-        PATH = i_strdup(PATH);
+	/* PATH will later be changed, so we have to use a duplicate */
+	PATH = i_strdup(PATH);
     }
 
     D_("PATH determined to be %s\n", PATH);
@@ -131,26 +131,26 @@
     /* walk the list of entries */
     for (i = 0; path_argv[i]; i++)
     {
-        /* get entry length */
-        len = strlen(path_argv[i]);
+	/* get entry length */
+	len = strlen(path_argv[i]);
 
-        /* what does this do? */
-        filename = (char *) i_calloc(exec_len + len + 2, sizeof(char));
-        strcpy(filename, path_argv[i]);
-        if (filename[len - 1] != '/')
-            strcat(filename, "/");
-        strcat(filename, exec);
-
-        /* check so that file exits, if exists leave this loop */
-        if ((stat(filename, &test) != -1)
-            && (test.
-                st_mode & (S_IXOTH | S_IXGRP | S_IXUSR | S_ISVTX | S_ISGID |
-                           S_ISUID | S_IFREG)))
-            break;
-
-        /* cleanup */
-        free(filename);
-        filename = NULL;
+	/* what does this do? */
+	filename = (char *) i_calloc(exec_len + len + 2, sizeof(char));
+	strcpy(filename, path_argv[i]);
+	if (filename[len - 1] != '/')
+	    strcat(filename, "/");
+	strcat(filename, exec);
+
+	/* check so that file exits, if exists leave this loop */
+	if ((stat(filename, &test) != -1)
+	    && (test.
+		st_mode & (S_IXOTH | S_IXGRP | S_IXUSR | S_ISVTX | S_ISGID |
+			   S_ISUID | S_IFREG)))
+	    break;
+
+	/* cleanup */
+	free(filename);
+	filename = NULL;
     }
 
     /* free */
@@ -161,50 +161,50 @@
 
     /* make sure we got a filename to use */
     if (!filename)
-        F_("No executable found\n");
+	F_("No executable found\n");
 
     /* return the filename */
     return filename;
 }
 
 static int simple_exec_fork(process_h * process_to_exec, active_db_h * s,
-                            size_t argc, char **argv)
+			    size_t argc, char **argv)
 {
     /* This is the real service kicker */
-    pid_t pid_fork;             /* pid got from fork() */
+    pid_t pid_fork;		/* pid got from fork() */
 
     if ((pid_fork = initng_fork(s, process_to_exec)) == 0)
     {
 
 #ifdef DEBUG
-        D_("FROM_FORK simple_exec(%i,%s, ...);\n", argc, argv[0]);
-        /*D_argv("simple_exec: ", argv); */
+	D_("FROM_FORK simple_exec(%i,%s, ...);\n", argc, argv[0]);
+	/*D_argv("simple_exec: ", argv); */
 #endif
 
-        /* FINALLY EXECUTE *//* execve replaces the running process */
-        execve(argv[0], argv, new_environ(s));
+	/* FINALLY EXECUTE *//* execve replaces the running process */
+	execve(argv[0], argv, new_environ(s));
 
-        /* Will never get here if execve succeeded */
-        F_("ERROR!\n");
-        F_("Can't execute source %s!\n", argv[0]);
+	/* Will never get here if execve succeeded */
+	F_("ERROR!\n");
+	F_("Can't execute source %s!\n", argv[0]);
 
-        _exit(1);
+	_exit(1);
     }
 
     /* save pid of fork */
     D_("FROM_FORK Forkstarted pid %i.\n", pid_fork);
 
     if (pid_fork > 0)
-        return (TRUE);
+	return (TRUE);
 
     process_to_exec->pid = 0;
     return FALSE;
     /* if to test want to lock this up until fork is done ...   waitpid(pid_fork,0,0); */
-}                                           /* end fork_and_exec() */
+}					    /* end fork_and_exec() */
 
 
 static int simple_exec_try(char *exec, active_db_h * service,
-                           process_h * process)
+			   process_h * process)
 {
     const char *exec_args_unfixed = NULL;
     char **argv = NULL;
@@ -215,40 +215,40 @@
 
     /* exec_args should be parsed at the moment, too */
     exec_args_unfixed = get_string_var(&EXEC_ARGS,
-                                       process->pt->name, service);
+				       process->pt->name, service);
     if (exec_args_unfixed)
     {
-        char *exec_args = NULL;
+	char *exec_args = NULL;
 
 
-        /* get some fixed variables, with ${VARIABLES} fixed, be aware that this is a new malloc and needs to be free() */
-        exec_args = fix_variables(exec_args_unfixed, service);
-        if (!exec_args)
-        {
-            F_("Failed to fix_variables: \"%s\"\n", exec_args);
-            return (FALSE);
-        }
-
-        /* split the string, with entries to an array of strings */
-        argv = split_delim(exec_args, WHITESPACE, &argc, 1);
-
-        /* make sure it succeeded */
-        if (!argv || !argv[0])
-        {
-            F_("split_delim exec_args returns NULL.\n");
-            free(exec_args);
-            exec_args = NULL;
-            return (FALSE);
-        }
+	/* get some fixed variables, with ${VARIABLES} fixed, be aware that this is a new malloc and needs to be free() */
+	exec_args = fix_variables(exec_args_unfixed, service);
+	if (!exec_args)
+	{
+	    F_("Failed to fix_variables: \"%s\"\n", exec_args);
+	    return (FALSE);
+	}
+
+	/* split the string, with entries to an array of strings */
+	argv = split_delim(exec_args, WHITESPACE, &argc, 1);
+
+	/* make sure it succeeded */
+	if (!argv || !argv[0])
+	{
+	    F_("split_delim exec_args returns NULL.\n");
+	    free(exec_args);
+	    exec_args = NULL;
+	    return (FALSE);
+	}
 
 
     }
     else
     {
-        /* we need a empty argv anyway */
-        argv = (char **) i_calloc(2, sizeof(char *));
-        argv[1] = NULL;
-        argc = 0;
+	/* we need a empty argv anyway */
+	argv = (char **) i_calloc(2, sizeof(char *));
+	argv[1] = NULL;
+	argc = 0;
     }
 
     argv[0] = exec;
@@ -266,37 +266,37 @@
     D_("service: %s, process: %s\n", service->name, process->pt->name);
 
     while ((exec =
-            get_next_string_var(&EXECS, process->pt->name, service, &itt)))
+	    get_next_string_var(&EXECS, process->pt->name, service, &itt)))
     {
-        int res = FALSE;
-        char *exec_fixed = NULL;
+	int res = FALSE;
+	char *exec_fixed = NULL;
 
-        /* be aware that fix_variables() return is a malloc, and needs to be free */
-        exec_fixed = fix_variables(exec, service);
+	/* be aware that fix_variables() return is a malloc, and needs to be free */
+	exec_fixed = fix_variables(exec, service);
 
-        if (!exec_fixed)
-        {
-            F_("Unable to fix_variables!\n");
-            return (FALSE);
-        }
-
-        /* check if the file exist */
-        if (stat(exec_fixed, &stat_struct) != 0)
-        {
-            D_(" note, %s exec_fixed does not exist. \n", exec_fixed);
-            continue;
-        }
-
-        /* Try to execute that one */
-        res = simple_exec_try(exec_fixed, service, process);
-
-        /* cleanup */
-        free(exec_fixed);
-        exec_fixed = NULL;
-
-        /* Return true if successfully */
-        if (res == TRUE)
-            return (TRUE);
+	if (!exec_fixed)
+	{
+	    F_("Unable to fix_variables!\n");
+	    return (FALSE);
+	}
+
+	/* check if the file exist */
+	if (stat(exec_fixed, &stat_struct) != 0)
+	{
+	    D_(" note, %s exec_fixed does not exist. \n", exec_fixed);
+	    continue;
+	}
+
+	/* Try to execute that one */
+	res = simple_exec_try(exec_fixed, service, process);
+
+	/* cleanup */
+	free(exec_fixed);
+	exec_fixed = NULL;
+
+	/* Return true if successfully */
+	if (res == TRUE)
+	    return (TRUE);
 
     }
 
@@ -316,15 +316,15 @@
 
     exec = get_string_var(&EXEC, process->pt->name, service);
     if (!exec)
-        return (FALSE);
+	return (FALSE);
 
 
     /* be aware that fix_variables() return is a malloc, and needs to be free */
     exec_fixed = fix_variables(exec, service);
     if (!exec_fixed)
     {
-        F_("Unable to fix_variables!\n");
-        return (FALSE);
+	F_("Unable to fix_variables!\n");
+	return (FALSE);
     }
 
     /* argv-entries are pointer to exec_t[x] */
@@ -333,26 +333,26 @@
     /* make sure we got something from the split */
     if (!argv || !argv[0])
     {
-        D_("split_delim on exec returns NULL.\n");
-        free(exec_fixed);
-        exec_fixed = NULL;
-        return (FALSE);
+	D_("split_delim on exec returns NULL.\n");
+	free(exec_fixed);
+	exec_fixed = NULL;
+	return (FALSE);
     }
 
     /* if it not contains a full path */
     if (argv[0][0] != '/')
     {
-        argv0 = expand_exec(argv[0]);
-        if (!argv0)
-        {
-            D_("%s was not found in search path.\n", argv[0]);
-            free(argv);
-            argv = NULL;
-            free(exec_fixed);
-            exec_fixed = NULL;
-            return (FALSE);
-        }
-        argv[0] = argv0;
+	argv0 = expand_exec(argv[0]);
+	if (!argv0)
+	{
+	    D_("%s was not found in search path.\n", argv[0]);
+	    free(argv);
+	    argv = NULL;
+	    free(exec_fixed);
+	    exec_fixed = NULL;
+	    return (FALSE);
+	}
+	argv[0] = argv0;
     }
 
 
@@ -366,13 +366,13 @@
     exec_fixed = NULL;
     if (argv0)
     {
-        free(argv0);
-        argv0 = NULL;
+	free(argv0);
+	argv0 = NULL;
     }
 
     /* return result */
     if (result == FAIL)
-        return (FALSE);
+	return (FALSE);
     return (result);
 }
 
@@ -386,10 +386,10 @@
     D_("service: %s, process: %s\n", service->name, process->pt->name);
 
     if (is_var(&EXECS, process->pt->name, service))
-        return (simple_exec(service, process));
+	return (simple_exec(service, process));
 
     if (is_var(&EXEC, process->pt->name, service))
-        return (simple_run(service, process));
+	return (simple_run(service, process));
 
     return (FALSE);
 }
@@ -400,8 +400,8 @@
     D_("initng_simple_plugin: module_init();\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     initng_plugin_hook_add(&g.LAUNCH, 40, &initng_s_launch);

Modified: initng/trunk/plugins/stcmd/initng_stcmd.c
==============================================================================
--- initng/trunk/plugins/stcmd/initng_stcmd.c	(original)
+++ initng/trunk/plugins/stcmd/initng_stcmd.c	Wed Apr  5 22:57:12 2006
@@ -175,17 +175,17 @@
     process_h *process = NULL;
 
     if (!arg)
-        return (-2);
+	return (-2);
 
 
     if (!(apt = initng_active_db_find_in_name(arg)))
-        return (-1);
+	return (-1);
 
     /* browse all processes */
     while_processes(process, apt)
     {
-        /* return the first process found */
-        return (process->pid);
+	/* return the first process found */
+	return (process->pid);
     }
 
     return (-3);
@@ -195,7 +195,7 @@
 static int cmd_start_on_new(char *arg)
 {
     if (!arg)
-        return (FALSE);
+	return (FALSE);
 
     g.when_out = THEN_RESTART;
     initng_main_set_runlevel(arg);
@@ -208,10 +208,10 @@
     active_db_h *apt = NULL;
 
     if (!arg)
-        return (FALSE);
+	return (FALSE);
 
     if (!(apt = initng_active_db_find_in_name(arg)))
-        return (FALSE);
+	return (FALSE);
 
     initng_active_db_del(apt);
     initng_active_db_free(apt);
@@ -230,23 +230,23 @@
 
     if (!arg)
     {
-        F_("Must tell the service name to restart.\n");
-        return (FALSE);
+	F_("Must tell the service name to restart.\n");
+	return (FALSE);
     }
 
     apt = initng_active_db_find_in_name(arg);
     if (!apt)
     {
-        return (FALSE);
-        F_("Service \"%s\" not found.\n", arg);
+	return (FALSE);
+	F_("Service \"%s\" not found.\n", arg);
     }
 
     D_("removing service data for %s, to make sure .ii file is reloaded!\n",
        arg);
     if (apt->from_service)
     {
-        list_del(&apt->from_service->list);
-        initng_service_cache_free(apt->from_service);
+	list_del(&apt->from_service->list);
+	initng_service_cache_free(apt->from_service);
     }
 
     D_("Restarting service %s\n", apt->name);
@@ -265,23 +265,23 @@
 
     if (!arg)
     {
-        return (i_strdup("Please tell me what service to get up-time from."));
+	return (i_strdup("Please tell me what service to get up-time from."));
     }
 
     apt = initng_active_db_find_in_name(arg);
     if (!apt)
     {
-        string = i_calloc(35 + strlen(arg), sizeof(char));
-        sprintf(string, "Service \"%s\" is not found!", arg);
-        return (string);
+	string = i_calloc(35 + strlen(arg), sizeof(char));
+	sprintf(string, "Service \"%s\" is not found!", arg);
+	return (string);
     }
 
     gettimeofday(&now, NULL);
     {
-        string = i_calloc(50, sizeof(char));
-        sprintf(string, "Up-time is %ims.\n",
-                MS_DIFF(now, apt->time_current_state));
-        return (string);
+	string = i_calloc(50, sizeof(char));
+	sprintf(string, "Up-time is %ims.\n",
+		MS_DIFF(now, apt->time_current_state));
+	return (string);
     }
 }
 
@@ -293,16 +293,16 @@
     /* if no arg, or empty arg set, remove all content */
     if (!arg || strlen(arg) < 2)
     {
-        D_("Clearing complete db.\n");
-        initng_service_cache_free_all();
-        return (TRUE);
+	D_("Clearing complete db.\n");
+	initng_service_cache_free_all();
+	return (TRUE);
     }
 
     s = initng_service_cache_find_in_name(arg);
     if (!s)
     {
-        D_("Did not find service %s to release cache for!\n", arg);
-        return (FALSE);
+	D_("Did not find service %s to release cache for!\n", arg);
+	return (FALSE);
     }
 
     D_("removing service data for %s!\n", arg);
@@ -348,12 +348,12 @@
 
     while_module_db(mod)
     {
-        /* Increase buffer for adding */
-        string_len += strlen(mod->module_name) + 8;
-        string = i_realloc(string, string_len * sizeof(char));
-        strcat(string, "  * ");
-        strcat(string, mod->module_name);
-        strcat(string, "\n");
+	/* Increase buffer for adding */
+	string_len += strlen(mod->module_name) + 8;
+	string = i_realloc(string, string_len * sizeof(char));
+	strcat(string, "  * ");
+	strcat(string, mod->module_name);
+	strcat(string, "\n");
     }
 
     return (string);
@@ -362,11 +362,11 @@
 static int cmd_load_module(char *arg)
 {
     if (!arg)
-        return (FALSE);
+	return (FALSE);
 
     /* load the module */
     if (initng_load_module(arg) == NULL)
-        return (FALSE);
+	return (FALSE);
 
     /* clear the service cache, so new variables will be read next time */
     initng_service_cache_free_all();
@@ -377,7 +377,7 @@
 static int cmd_unload_module(char *arg)
 {
     if (!arg)
-        return (FALSE);
+	return (FALSE);
 
     /* Just to make sure. */
     initng_service_cache_free_all();
@@ -402,14 +402,14 @@
     s = initng_service_cache_find_in_name(arg);
     if (!s)
     {
-        return (i_strdup("Can't find service."));
+	return (i_strdup("Can't find service."));
     }
 
     if (s->father_name)
-        mprintf(&string, "Father to service %s is %s\n", s->name,
-                s->father_name);
+	mprintf(&string, "Father to service %s is %s\n", s->name,
+		s->father_name);
     else
-        mprintf(&string, "Service %s has no father\n", s->name);
+	mprintf(&string, "Service %s has no father\n", s->name);
 
     return (string);
 }
@@ -424,21 +424,21 @@
     on = initng_active_db_find_in_name(arg);
 
     if (!on)
-        return (i_strdup("Did not find service."));
+	return (i_strdup("Did not find service."));
 
     mprintf(&string, "The \"%s\" depends on:\n", on->name);
 
     while_active_db(current)
     {
-        /* if that we are watching needs current */
-        if (initng_depend(on, current) == TRUE)
-        {
-            if (current->current_state && current->current_state->state_name)
-            {
-                mprintf(&string, "  %s\t\t[%s]\n", current->name,
-                        current->current_state->state_name);
-            }
-        }
+	/* if that we are watching needs current */
+	if (initng_depend(on, current) == TRUE)
+	{
+	    if (current->current_state && current->current_state->state_name)
+	    {
+		mprintf(&string, "  %s\t\t[%s]\n", current->name,
+			current->current_state->state_name);
+	    }
+	}
     }
     return (string);
 }
@@ -452,21 +452,21 @@
     on = initng_active_db_find_in_name(arg);
 
     if (!on)
-        return (i_strdup("Did not find service."));
+	return (i_strdup("Did not find service."));
 
     mprintf(&string, "The \"%s\" depends on:\n", on->name);
 
     while_active_db(current)
     {
-        /* if that we are watching needs current */
-        if (initng_depend_deep(on, current) == TRUE)
-        {
-            if (current->current_state && current->current_state->state_name)
-            {
-                mprintf(&string, "  %s\t\t[%s]\n", current->name,
-                        current->current_state->state_name);
-            }
-        }
+	/* if that we are watching needs current */
+	if (initng_depend_deep(on, current) == TRUE)
+	{
+	    if (current->current_state && current->current_state->state_name)
+	    {
+		mprintf(&string, "  %s\t\t[%s]\n", current->name,
+			current->current_state->state_name);
+	    }
+	}
     }
     return (string);
 }
@@ -479,21 +479,21 @@
 
     on = initng_active_db_find_in_name(arg);
     if (!on)
-        return (i_strdup("Did not find service."));
+	return (i_strdup("Did not find service."));
 
     mprintf(&string, "The services that depends on \"%s\":\n", on->name);
 
     while_active_db(current)
     {
-        /* if current need the one we are watching */
-        if (initng_depend(current, on) == TRUE)
-        {
-            if (current->current_state && current->current_state->state_name)
-            {
-                mprintf(&string, "  %s\t\t[%s]\n", current->name,
-                        current->current_state->state_name);
-            }
-        }
+	/* if current need the one we are watching */
+	if (initng_depend(current, on) == TRUE)
+	{
+	    if (current->current_state && current->current_state->state_name)
+	    {
+		mprintf(&string, "  %s\t\t[%s]\n", current->name,
+			current->current_state->state_name);
+	    }
+	}
     }
     return (string);
 }
@@ -507,21 +507,21 @@
     on = initng_active_db_find_in_name(arg);
 
     if (!on)
-        return (i_strdup("Did not find service."));
+	return (i_strdup("Did not find service."));
 
     mprintf(&string, "The the services that depends on \"%s\":\n", on->name);
 
     while_active_db(current)
     {
-        /* if current need the one we are watching */
-        if (initng_depend_deep(current, on) == TRUE)
-        {
-            if (current->current_state && current->current_state->state_name)
-            {
-                mprintf(&string, "  %s\t\t[%s]\n", current->name,
-                        current->current_state->state_name);
-            }
-        }
+	/* if current need the one we are watching */
+	if (initng_depend_deep(current, on) == TRUE)
+	{
+	    if (current->current_state && current->current_state->state_name)
+	    {
+		mprintf(&string, "  %s\t\t[%s]\n", current->name,
+			current->current_state->state_name);
+	    }
+	}
     }
     return (string);
 }
@@ -533,7 +533,7 @@
     int i = 0;
 
     if (!arg)
-        return (FALSE);
+	return (FALSE);
 
     new_i = strdup(arg);
     g.new_init = split_n(new_i, &i, 0, 0);
@@ -550,8 +550,8 @@
     D_("module_init(stcmd);\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     initng_command_add(&GET_PID_OF);
@@ -562,9 +562,9 @@
     initng_command_add(&SERVICE_RELOAD);
     if (g.i_am_init)
     {
-        initng_command_add(&REBOOT_INITNG);
-        initng_command_add(&POWEROFF_INITNG);
-        initng_command_add(&HALT_INITNG);
+	initng_command_add(&REBOOT_INITNG);
+	initng_command_add(&POWEROFF_INITNG);
+	initng_command_add(&HALT_INITNG);
     }
     initng_command_add(&PRINT_MODULES);
     initng_command_add(&LOAD_MODULE);
@@ -594,9 +594,9 @@
     initng_command_del(&SERVICE_RELOAD);
     if (g.i_am_init)
     {
-        initng_command_del(&REBOOT_INITNG);
-        initng_command_del(&POWEROFF_INITNG);
-        initng_command_del(&HALT_INITNG);
+	initng_command_del(&REBOOT_INITNG);
+	initng_command_del(&POWEROFF_INITNG);
+	initng_command_del(&HALT_INITNG);
     }
     initng_command_del(&PRINT_MODULES);
     initng_command_del(&LOAD_MODULE);

Modified: initng/trunk/plugins/stdout/initng_stdout.c
==============================================================================
--- initng/trunk/plugins/stdout/initng_stdout.c	(original)
+++ initng/trunk/plugins/stdout/initng_stdout.c	Wed Apr  5 22:57:12 2006
@@ -22,7 +22,7 @@
 
 
 #include <stdio.h>
-#include <stdlib.h>                         /* free() exit() */
+#include <stdlib.h>			    /* free() exit() */
 #include <fcntl.h>
 #include <string.h>
 #include <errno.h>
@@ -51,7 +51,7 @@
 
 
 static int setup_output(active_db_h * s, process_h * p
-                        __attribute__ ((unused)))
+			__attribute__ ((unused)))
 {
 
     /* string containing the filename of output */
@@ -87,98 +87,98 @@
 
     if (!(s_stdout || s_stderr || s_stdall || s_stdin))
     {
-        D_("This plugin won't do anything, because no opt set!\n");
-        return (TRUE);
+	D_("This plugin won't do anything, because no opt set!\n");
+	return (TRUE);
     }
 
     /* if stdout points to same as stderr, set s_stdall */
     if (s_stdout && s_stderr && strcmp(s_stdout, s_stderr) == 0)
     {
-        s_stdall = s_stdout;
-        s_stdout = NULL;
-        s_stderr = NULL;
+	s_stdall = s_stdout;
+	s_stdout = NULL;
+	s_stderr = NULL;
     }
 
 
     /* fix variables */
     if (s_stdout)
-        f_stdout = fix_variables(s_stdout, s);
+	f_stdout = fix_variables(s_stdout, s);
     if (s_stderr)
-        f_stderr = fix_variables(s_stderr, s);
+	f_stderr = fix_variables(s_stderr, s);
     if (s_stdall)
-        f_stdall = fix_variables(s_stdall, s);
+	f_stdall = fix_variables(s_stdall, s);
     if (s_stdin)
-        f_stdin = fix_variables(s_stdin, s);
+	f_stdin = fix_variables(s_stdin, s);
 
 
     /* if stdall string is set */
     if (f_stdall)
     {
-        /* output all to this */
-        fd_stdall = open(f_stdall, O_WRONLY | O_NOCTTY | O_CREAT | O_APPEND,
-                         0644);
+	/* output all to this */
+	fd_stdall = open(f_stdall, O_WRONLY | O_NOCTTY | O_CREAT | O_APPEND,
+			 0644);
     }
     else
     {
-        /* else set them to different files */
-        if (f_stdout)
-            fd_stdout = open(f_stdout,
-                             O_WRONLY | O_NOCTTY | O_CREAT | O_APPEND, 0644);
-        if (f_stderr)
-            fd_stderr = open(f_stderr,
-                             O_WRONLY | O_NOCTTY | O_CREAT | O_APPEND, 0644);
+	/* else set them to different files */
+	if (f_stdout)
+	    fd_stdout = open(f_stdout,
+			     O_WRONLY | O_NOCTTY | O_CREAT | O_APPEND, 0644);
+	if (f_stderr)
+	    fd_stderr = open(f_stderr,
+			     O_WRONLY | O_NOCTTY | O_CREAT | O_APPEND, 0644);
     }
     if (f_stdin)
-        fd_stdin = open(f_stdin, O_RDONLY | O_NOCTTY, 0644);
+	fd_stdin = open(f_stdin, O_RDONLY | O_NOCTTY, 0644);
 
     /* print fail messages, if the files did not open */
     if (f_stdall && fd_stdall < 2)
-        F_("StdALL: %s, fd %i\n", f_stdall, fd_stdall);
+	F_("StdALL: %s, fd %i\n", f_stdall, fd_stdall);
     if (f_stdout && fd_stdout < 2)
-        F_("StdOUT: %s, fd %i\n", f_stdout, fd_stdout);
+	F_("StdOUT: %s, fd %i\n", f_stdout, fd_stdout);
     if (f_stderr && fd_stderr < 2)
-        F_("StdERR: %s, fd %i\n", f_stderr, fd_stderr);
+	F_("StdERR: %s, fd %i\n", f_stderr, fd_stderr);
     if (f_stdin && fd_stdin < 2)
-        F_("StdIN: %s, fd %i\n", f_stdin, fd_stdin);
+	F_("StdIN: %s, fd %i\n", f_stdin, fd_stdin);
 
 #ifdef DEBUG
     if (f_stdall)
-        D_("StdALL: %s, fd %i\n", f_stdall, fd_stdall);
+	D_("StdALL: %s, fd %i\n", f_stdall, fd_stdall);
     if (f_stdout)
-        D_("StdOUT: %s, fd %i\n", f_stdout, fd_stdout);
+	D_("StdOUT: %s, fd %i\n", f_stdout, fd_stdout);
     if (f_stderr)
-        D_("StdERR: %s, fd %i\n", f_stderr, fd_stderr);
+	D_("StdERR: %s, fd %i\n", f_stderr, fd_stderr);
     if (f_stdin)
-        D_("StdIN:  %s, fd %i\n", f_stdin, fd_stdin);
+	D_("StdIN:  %s, fd %i\n", f_stdin, fd_stdin);
 #endif
 
     /* if fd succeeded to open */
     if (fd_stdall > 2)
     {
-        /* dup both to stdall */
-        dup2(fd_stdall, 1);
-        dup2(fd_stdall, 2);
+	/* dup both to stdall */
+	dup2(fd_stdall, 1);
+	dup2(fd_stdall, 2);
     }
     else
     {
-        /* else dup them to diffrent fds */
-        if (fd_stdout > 2)
-            dup2(fd_stdout, 1);
-        if (fd_stderr > 2)
-            dup2(fd_stderr, 2);
+	/* else dup them to diffrent fds */
+	if (fd_stdout > 2)
+	    dup2(fd_stdout, 1);
+	if (fd_stderr > 2)
+	    dup2(fd_stderr, 2);
     }
     if (fd_stdin > 2)
-        dup2(fd_stdin, 0);
+	dup2(fd_stdin, 0);
 
     /* free the (by fix_variables) duped variables */
     if (f_stdout)
-        free(f_stdout);
+	free(f_stdout);
     if (f_stderr)
-        free(f_stderr);
+	free(f_stderr);
     if (f_stdall)
-        free(f_stdall);
+	free(f_stdall);
     if (f_stdin)
-        free(f_stdin);
+	free(f_stdin);
 
     return (TRUE);
 }
@@ -191,8 +191,8 @@
     D_("module_init();\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     initng_service_data_types_add(&STDOUT);

Modified: initng/trunk/plugins/suid/initng_suid.c
==============================================================================
--- initng/trunk/plugins/suid/initng_suid.c	(original)
+++ initng/trunk/plugins/suid/initng_suid.c	Wed Apr  5 22:57:12 2006
@@ -44,17 +44,17 @@
     /* add to service cache */
     if (is_var(&ENV, vn, service->from_service))
     {
-        return;                             /* Assume they were set by .i file, don't override */
+	return;				    /* Assume they were set by .i file, don't override */
     }
     else
     {
-        set_string_var(&ENV, i_strdup(vn), service->from_service,
-                       i_strdup(vv));
+	set_string_var(&ENV, i_strdup(vn), service->from_service,
+		       i_strdup(vv));
     }
 }
 
 static int do_suid(active_db_h * service, process_h * process
-                   __attribute__ ((unused)))
+		   __attribute__ ((unused)))
 {
     struct passwd *passwd = NULL;
     struct group *group = NULL;
@@ -72,72 +72,72 @@
 
     if ((tmp = get_string(&SGID, service)))
     {
-        groupname = fix_variables(tmp, service);
+	groupname = fix_variables(tmp, service);
     }
 
     tmp = get_string(&SUID, service);
     if (tmp)
-        username = fix_variables(tmp, service);
+	username = fix_variables(tmp, service);
 
     if (username && !groupname)
     {
-        i = strcspn(username, ":");
-        if (username[i] == ':')
-        {
-            groupname = strdup(username + i + 1);
-            username[i] = 0;
-        }
+	i = strcspn(username, ":");
+	if (username[i] == ':')
+	{
+	    groupname = strdup(username + i + 1);
+	    username[i] = 0;
+	}
     }
 
 
     if (groupname)
-        group = getgrnam(groupname);
+	group = getgrnam(groupname);
     if (username)
-        passwd = getpwnam(username);
+	passwd = getpwnam(username);
 
     if (passwd)
     {
-        uid = passwd->pw_uid;
-        gid = passwd->pw_gid;
+	uid = passwd->pw_uid;
+	gid = passwd->pw_gid;
     }
     else if (username)
     {
-        F_("USER \"%s\" not found!\n", username);
-        ret += 2;
+	F_("USER \"%s\" not found!\n", username);
+	ret += 2;
     }
 
     if (group)
-        gid = group->gr_gid;
+	gid = group->gr_gid;
     else if (groupname)
     {
-        F_("GROUP \"%s\" not found!\n", groupname);
-        ret += 1;
+	F_("GROUP \"%s\" not found!\n", groupname);
+	ret += 1;
     }
 
     if (gid)
     {
-        D_("Change to gid %i", gid);
-        setgid(gid);
+	D_("Change to gid %i", gid);
+	setgid(gid);
     }
 
     if (passwd)
-        initgroups(passwd->pw_name, passwd->pw_gid);
+	initgroups(passwd->pw_name, passwd->pw_gid);
 
     if (uid)
     {
-        D_("Change to uid %i", uid);
-        setuid(uid);
+	D_("Change to uid %i", uid);
+	setuid(uid);
 
-        /* Set UID-related env variables */
-        adjust_env(service, "USER", passwd->pw_name);
-        adjust_env(service, "HOME", passwd->pw_dir);
-        adjust_env(service, "PATH", "/bin:/usr/bin");
+	/* Set UID-related env variables */
+	adjust_env(service, "USER", passwd->pw_name);
+	adjust_env(service, "HOME", passwd->pw_dir);
+	adjust_env(service, "PATH", "/bin:/usr/bin");
     }
 
     if (groupname)
-        free(groupname);
+	free(groupname);
     if (username)
-        free(username);
+	free(username);
     /* group and passwd are static data structures - don't free */
     return ret;
 }
@@ -147,8 +147,8 @@
     D_("module_init();\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     initng_service_data_types_add(&SUID);

Modified: initng/trunk/plugins/syncron/initng_syncron.c
==============================================================================
--- initng/trunk/plugins/syncron/initng_syncron.c	(original)
+++ initng/trunk/plugins/syncron/initng_syncron.c	Wed Apr  5 22:57:12 2006
@@ -22,8 +22,8 @@
 
 
 #include <stdio.h>
-#include <string.h>                         /* strstr() */
-#include <stdlib.h>                         /* free() exit() */
+#include <string.h>			    /* strstr() */
+#include <stdlib.h>			    /* free() exit() */
 #include <assert.h>
 #include <initng_handler.h>
 #include <initng_global.h>
@@ -43,8 +43,8 @@
     SERVICE_START_RUN = initng_active_state_find("SERVICE_START_RUN");
     if (!SERVICE_START_RUN)
     {
-        F_("Could not resolve SERVICE_START_RUN, is service type loaded?");
-        return (FALSE);
+	F_("Could not resolve SERVICE_START_RUN, is service type loaded?");
+	return (FALSE);
 
     }
     return (TRUE);
@@ -63,33 +63,33 @@
 
     /* we must have this state resolve, to compare it */
     if (!resolv_SSR())
-        return (TRUE);
+	return (TRUE);
 
     if ((service_syncron = get_string(&SYNCRON, service)) == NULL)
-        return (TRUE);
+	return (TRUE);
 
     while_active_db_safe(current, q)
     {
-        /* don't check ourself */
-        if (current == service)
-        {
-            continue;
-        }
-
-        /* If this service has the start process running */
-        if (IS_MARK(current, SERVICE_START_RUN))
-        {
-            if ((current_syncron = get_string(&SYNCRON, current)) != NULL)
-            {
-                if (strcmp(service_syncron, current_syncron) == 0)
-                {
-                    D_("Service %s has to wait for %s\n", service->name,
-                       current->name);
-                    /* refuse to change status */
-                    return (FALSE);
-                }
-            }
-        }
+	/* don't check ourself */
+	if (current == service)
+	{
+	    continue;
+	}
+
+	/* If this service has the start process running */
+	if (IS_MARK(current, SERVICE_START_RUN))
+	{
+	    if ((current_syncron = get_string(&SYNCRON, current)) != NULL)
+	    {
+		if (strcmp(service_syncron, current_syncron) == 0)
+		{
+		    D_("Service %s has to wait for %s\n", service->name,
+		       current->name);
+		    /* refuse to change status */
+		    return (FALSE);
+		}
+	    }
+	}
     }
     return (TRUE);
 }
@@ -101,19 +101,19 @@
 
     /* we must have this state resolve, to compare it */
     if (!resolv_SSR())
-        return (TRUE);
+	return (TRUE);
 
     while_active_db_safe(current, q)
     {
-        /* don't check ourself */
-        if (current == service)
-            continue;
-
-        if (IS_MARK(service, SERVICE_START_RUN))
-        {
-            /* no i cant set this status yet */
-            return (FALSE);
-        }
+	/* don't check ourself */
+	if (current == service)
+	    continue;
+
+	if (IS_MARK(service, SERVICE_START_RUN))
+	{
+	    /* no i cant set this status yet */
+	    return (FALSE);
+	}
     }
     return (TRUE);
 }
@@ -127,19 +127,19 @@
     D_("module_init();\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     initng_service_data_types_add(&SYNCRON);
     for (i = 0; g.Argv[i]; i++)
-        if (strstr(g.Argv[i], "synchronously"))
-        {
-            check = TRUE;
-            initng_plugin_hook_add(&g.START_DEP_MET, 10, &check_syncronicly);
+	if (strstr(g.Argv[i], "synchronously"))
+	{
+	    check = TRUE;
+	    initng_plugin_hook_add(&g.START_DEP_MET, 10, &check_syncronicly);
 
-            return (TRUE);
-        }
+	    return (TRUE);
+	}
     check = FALSE;
     /* Notice this is only added if we don't have --synchronously */
     D_("Adding synchron\n");
@@ -153,7 +153,7 @@
 {
 
     if (check == TRUE)
-        initng_plugin_hook_del(&g.START_DEP_MET, &check_syncronicly);
+	initng_plugin_hook_del(&g.START_DEP_MET, &check_syncronicly);
     initng_plugin_hook_del(&g.START_DEP_MET, &check_syncronicly_service);
     initng_service_data_types_del(&SYNCRON);
 }

Modified: initng/trunk/plugins/syslog/initng_syslog.c
==============================================================================
--- initng/trunk/plugins/syslog/initng_syslog.c	(original)
+++ initng/trunk/plugins/syslog/initng_syslog.c	Wed Apr  5 22:57:12 2006
@@ -20,13 +20,13 @@
 
 #include <initng.h>
 
-#include <sys/types.h>                      /* time_t */
+#include <sys/types.h>			    /* time_t */
 #include <sys/stat.h>
 #include <unistd.h>
 #include <stdlib.h>
 #include <string.h>
 #include <time.h>
-#include <stdio.h>                          /* printf() */
+#include <stdio.h>			    /* printf() */
 #include <assert.h>
 #include <stdarg.h>
 #include <syslog.h>
@@ -53,28 +53,28 @@
 
     if (stat("/dev/log", &st) == 0 && S_ISSOCK(st.st_mode))
     {
-        syslog_running = 1;
+	syslog_running = 1;
 
-        /* print out the buffers if any now */
-        if (!list_empty(&log_list.list))
-        {
-            log_ent *current, *safe = NULL;
-
-            while_log_list_safe(current, safe)
-            {
-                initng_log(current->prio, current->owner, "%s",
-                           current->buffert);
-                free(current->buffert);
-                if (current->owner)
-                    free(current->owner);
-                list_del(&current->list);
-            }
-            INIT_LIST_HEAD(&log_list.list);
-        }
+	/* print out the buffers if any now */
+	if (!list_empty(&log_list.list))
+	{
+	    log_ent *current, *safe = NULL;
+
+	    while_log_list_safe(current, safe)
+	    {
+		initng_log(current->prio, current->owner, "%s",
+			   current->buffert);
+		free(current->buffert);
+		if (current->owner)
+		    free(current->owner);
+		list_del(&current->list);
+	    }
+	    INIT_LIST_HEAD(&log_list.list);
+	}
     }
     else
     {
-        syslog_running = 0;
+	syslog_running = 0;
     }
 }
 
@@ -86,10 +86,10 @@
     check_syslog();
     while_log_list_safe(current, safe)
     {
-        free(current->buffert);
-        if (current->owner)
-            free(current->owner);
-        list_del(&current->list);
+	free(current->buffert);
+	if (current->owner)
+	    free(current->owner);
+	list_del(&current->list);
     }
     INIT_LIST_HEAD(&log_list.list);
 
@@ -107,39 +107,39 @@
     /* if syslog is running, send it directly */
     if (syslog_running == 1)
     {
-        /* if owner is set, we have openlog with right owner */
-        if (owner)
-        {
-            closelog();
-            openlog(owner, 0, LOG_LOCAL1);
-
-            vsyslog(prio, format, ap);
-
-            closelog();
-            openlog("InitNG", 0, LOG_LOCAL1);
-        }
-        else
-            vsyslog(prio, format, ap);
+	/* if owner is set, we have openlog with right owner */
+	if (owner)
+	{
+	    closelog();
+	    openlog(owner, 0, LOG_LOCAL1);
+
+	    vsyslog(prio, format, ap);
+
+	    closelog();
+	    openlog("InitNG", 0, LOG_LOCAL1);
+	}
+	else
+	    vsyslog(prio, format, ap);
 
     }
     else
     {
-        char b[201];
-        log_ent *tmp = (log_ent *) i_calloc(1, sizeof(log_ent));
+	char b[201];
+	log_ent *tmp = (log_ent *) i_calloc(1, sizeof(log_ent));
 
-        if (!tmp)
-            return;
+	if (!tmp)
+	    return;
 
-        tmp->prio = prio;
-        vsnprintf(b, 200, format, ap);
-        tmp->buffert = i_strdup(b);
-
-        if (owner)
-            tmp->owner = i_strdup(owner);
-        else
-            tmp->owner = NULL;
+	tmp->prio = prio;
+	vsnprintf(b, 200, format, ap);
+	tmp->buffert = i_strdup(b);
+
+	if (owner)
+	    tmp->owner = i_strdup(owner);
+	else
+	    tmp->owner = NULL;
 
-        list_add(&tmp->list, &log_list.list);
+	list_add(&tmp->list, &log_list.list);
 
     }
 
@@ -154,35 +154,35 @@
 
     if (IS_UP(service))
     {
-        check_syslog();
-        initng_log(LOG_NOTICE, NULL, "Service %s is up.\n", service->name);
-        return (TRUE);
+	check_syslog();
+	initng_log(LOG_NOTICE, NULL, "Service %s is up.\n", service->name);
+	return (TRUE);
     }
 
     if (IS_DOWN(service))
     {
-        initng_log(LOG_NOTICE, NULL, "Service %s has been stopped.\n",
-                   service->name);
-        return (TRUE);
+	initng_log(LOG_NOTICE, NULL, "Service %s has been stopped.\n",
+		   service->name);
+	return (TRUE);
     }
     if (IS_FAILED(service))
     {
-        initng_log(LOG_NOTICE, NULL, "Service %s FAILED.\n", service->name);
-        return (TRUE);
+	initng_log(LOG_NOTICE, NULL, "Service %s FAILED.\n", service->name);
+	return (TRUE);
     }
 
     if (IS_STOPPING(service))
     {
-        initng_log(LOG_NOTICE, NULL, "Service %s is stopping.\n",
-                   service->name);
-        return (TRUE);
+	initng_log(LOG_NOTICE, NULL, "Service %s is stopping.\n",
+		   service->name);
+	return (TRUE);
     }
 
     if (IS_STARTING(service))
     {
-        initng_log(LOG_NOTICE, NULL, "Service %s is starting.\n",
-                   service->name);
-        return (TRUE);
+	initng_log(LOG_NOTICE, NULL, "Service %s is starting.\n",
+		   service->name);
+	return (TRUE);
     }
 
     /* leave */
@@ -193,46 +193,46 @@
 {
     switch (state)
     {
-        case STATE_UP:
-            initng_log(LOG_NOTICE, NULL, "System is up and running!\n");
-            /*
-             * if syslogd have not been started yet, its no ida,
-             * to spend memory for the buffert anyway.
-             */
-            free_buffert();
-            return;
-        case STATE_STARTING:
-            initng_log(LOG_NOTICE, NULL, "System is starting up.\n");
-            return;
-        case STATE_STOPPING:
-            initng_log(LOG_NOTICE, NULL, "System is going down.\n");
-            return;
-        case STATE_ASE:
-            initng_log(LOG_NOTICE, NULL, "Last service exited.\n");
-            return;
-        case STATE_EXIT:
-            initng_log(LOG_NOTICE, NULL, "Initng is exiting.\n");
-            return;
-        case STATE_RESTART:
-            initng_log(LOG_NOTICE, NULL, "Initng is restarting.\n");
-            return;
-        case STATE_HALT:
-            initng_log(LOG_NOTICE, NULL, "System is halting.\n");
-            return;
-        case STATE_POWEROFF:
-            initng_log(LOG_NOTICE, NULL, "System is power-off.\n");
-            return;
-        case STATE_REBOOT:
-            initng_log(LOG_NOTICE, NULL, "System is rebooting.\n");
-            return;
-        default:
-            return;
+	case STATE_UP:
+	    initng_log(LOG_NOTICE, NULL, "System is up and running!\n");
+	    /*
+	     * if syslogd have not been started yet, its no ida,
+	     * to spend memory for the buffert anyway.
+	     */
+	    free_buffert();
+	    return;
+	case STATE_STARTING:
+	    initng_log(LOG_NOTICE, NULL, "System is starting up.\n");
+	    return;
+	case STATE_STOPPING:
+	    initng_log(LOG_NOTICE, NULL, "System is going down.\n");
+	    return;
+	case STATE_ASE:
+	    initng_log(LOG_NOTICE, NULL, "Last service exited.\n");
+	    return;
+	case STATE_EXIT:
+	    initng_log(LOG_NOTICE, NULL, "Initng is exiting.\n");
+	    return;
+	case STATE_RESTART:
+	    initng_log(LOG_NOTICE, NULL, "Initng is restarting.\n");
+	    return;
+	case STATE_HALT:
+	    initng_log(LOG_NOTICE, NULL, "System is halting.\n");
+	    return;
+	case STATE_POWEROFF:
+	    initng_log(LOG_NOTICE, NULL, "System is power-off.\n");
+	    return;
+	case STATE_REBOOT:
+	    initng_log(LOG_NOTICE, NULL, "System is rebooting.\n");
+	    return;
+	default:
+	    return;
     }
     return;
 }
 
 static int syslog_fetch_output(active_db_h * service, process_h * process,
-                               char *buffer_pos)
+			       char *buffer_pos)
 {
     char log[201];
     int pos = 0;
@@ -244,24 +244,24 @@
     /* print every line, ending with a '\n' as an own syslog */
     while (buffer_pos[pos])
     {
-        i = 0;
-        /* count the number of char before '\n' */
-        while (buffer_pos[pos + i] && buffer_pos[pos + i] != '\n' && i < 200)
-            i++;
-
-        /* copy that many chars to our temporary log array */
-        strncpy(log, &buffer_pos[pos], i);
-        log[i] = '\0';
-
-        /* send it to syslog */
-        initng_log(LOG_NOTICE, service->name, "%s", log);
-
-        /* step forward */
-        pos += i;
-
-        /* and skip the newline if any */
-        if (buffer_pos[pos])
-            pos++;
+	i = 0;
+	/* count the number of char before '\n' */
+	while (buffer_pos[pos + i] && buffer_pos[pos + i] != '\n' && i < 200)
+	    i++;
+
+	/* copy that many chars to our temporary log array */
+	strncpy(log, &buffer_pos[pos], i);
+	log[i] = '\0';
+
+	/* send it to syslog */
+	initng_log(LOG_NOTICE, service->name, "%s", log);
+
+	/* step forward */
+	pos += i;
+
+	/* and skip the newline if any */
+	if (buffer_pos[pos])
+	    pos++;
 
     }
     return (TRUE);
@@ -269,7 +269,7 @@
 
 
 static int syslog_print_error(e_mt mt, const char *file, const char *func,
-                              int line, const char *format, va_list arg)
+			      int line, const char *format, va_list arg)
 {
     assert(file);
     assert(func);
@@ -280,25 +280,25 @@
 
     switch (mt)
     {
-        case MSG_FAIL:
+	case MSG_FAIL:
 #ifdef DEBUG
-            syslog(LOG_EMERG, "\"%s\", %s() #%i FAIL: %s", file, func, line,
-                   tempspace);
+	    syslog(LOG_EMERG, "\"%s\", %s() #%i FAIL: %s", file, func, line,
+		   tempspace);
 #else
-            syslog(LOG_EMERG, "FAIL: %s", tempspace);
+	    syslog(LOG_EMERG, "FAIL: %s", tempspace);
 #endif
-            return (TRUE);
-        case MSG_WARN:
+	    return (TRUE);
+	case MSG_WARN:
 #ifdef DEBUG
-            syslog(LOG_WARNING, "\"%s\", %s() #%i WARN: %s", file, func, line,
-                   tempspace);
+	    syslog(LOG_WARNING, "\"%s\", %s() #%i WARN: %s", file, func, line,
+		   tempspace);
 #else
-            syslog(LOG_EMERG, "WARN: %s", tempspace);
+	    syslog(LOG_EMERG, "WARN: %s", tempspace);
 #endif
-            return (TRUE);
-        default:
-            syslog(LOG_NOTICE, "%s", tempspace);
-            return (TRUE);
+	    return (TRUE);
+	default:
+	    syslog(LOG_NOTICE, "%s", tempspace);
+	    return (TRUE);
     }
 
     /* newer get here */
@@ -311,15 +311,15 @@
 {
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     /* Don't clutter syslog in fake mode */
     if (getpid() != 1 || !g.i_am_init)
     {
-        W_("Pid is not 1, (%i), or g.i_am_init not set and the syslog plugin won't load when running in fake mode, to prevent cluttering up the log-files.\n", getpid());
-        return (TRUE);
+	W_("Pid is not 1, (%i), or g.i_am_init not set and the syslog plugin won't load when running in fake mode, to prevent cluttering up the log-files.\n", getpid());
+	return (TRUE);
     }
     D_("Initializing syslog plugin\n");
 
@@ -343,8 +343,8 @@
     /* Don't clutter syslog in fake mode */
     if (!g.i_am_init)
     {
-        D_("The syslog plugin won't load when running in fake mode, to prevent cluttering up the log-files.\n");
-        return;
+	D_("The syslog plugin won't load when running in fake mode, to prevent cluttering up the log-files.\n");
+	return;
     }
 
     initng_plugin_hook_del(&g.IS_CHANGE, &syslog_print_status_change);

Modified: initng/trunk/plugins/unneeded/initng_unneeded.c
==============================================================================
--- initng/trunk/plugins/unneeded/initng_unneeded.c	(original)
+++ initng/trunk/plugins/unneeded/initng_unneeded.c	Wed Apr  5 22:57:12 2006
@@ -71,30 +71,30 @@
     /* walk through all and check */
     while_active_db_safe(A, As)
     {
-        if (A->type == TYPE_RUNLEVEL)
-            continue;
+	if (A->type == TYPE_RUNLEVEL)
+	    continue;
 
-        /* reset variables */
-        needed = FALSE;
-        B = NULL;
-
-        while_active_db(B)
-        {
-            /* don't check ourself */
-            if (A == B)
-                continue;
-
-            /* if B needs A */
-            if (initng_depend(B, A) == TRUE)
-            {
-                needed = TRUE;
-                break;
-            }
-        }
-
-        /* if there was no needed this service, stop it */
-        if (needed == FALSE)
-            initng_handler_stop_service(A);
+	/* reset variables */
+	needed = FALSE;
+	B = NULL;
+
+	while_active_db(B)
+	{
+	    /* don't check ourself */
+	    if (A == B)
+		continue;
+
+	    /* if B needs A */
+	    if (initng_depend(B, A) == TRUE)
+	    {
+		needed = TRUE;
+		break;
+	    }
+	}
+
+	/* if there was no needed this service, stop it */
+	if (needed == FALSE)
+	    initng_handler_stop_service(A);
     }
 
     return (TRUE);
@@ -107,8 +107,8 @@
     D_("module_init(unneeded);\n");
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
 
     initng_command_add(&STOP_UNNEEDED);

Modified: initng/trunk/plugins/usplash/initng_usplash.c
==============================================================================
--- initng/trunk/plugins/usplash/initng_usplash.c	(original)
+++ initng/trunk/plugins/usplash/initng_usplash.c	Wed Apr  5 22:57:12 2006
@@ -66,17 +66,17 @@
 
 static void usplash_write(char *output)
 {
-    int len = strlen(output) + 1;       // catch \0 as well
+    int len = strlen(output) + 1;	// catch \0 as well
     int fd = open(USPLASH_FIFO, O_WRONLY | O_NONBLOCK);
 
     if (fd > 0)
     {
-        D_("USPLASH : Writing data \"%s\" to pipe\n", output);
-        if (write(fd, output, len) != len)
-            W_("USPLASH : Open ok, but write failed (%s)\n", strerror(errno));
+	D_("USPLASH : Writing data \"%s\" to pipe\n", output);
+	if (write(fd, output, len) != len)
+	    W_("USPLASH : Open ok, but write failed (%s)\n", strerror(errno));
     }
     else
-        D_("USPLASH : Can't write data %s to pipe, not open yet.\n", output);
+	D_("USPLASH : Can't write data %s to pipe, not open yet.\n", output);
     close(fd);
 
 }
@@ -90,8 +90,8 @@
 
     if (percent != last_percent)
     {
-        USPLASH_WRITE("PROGRESS %d", percent);
-        last_percent = percent;
+	USPLASH_WRITE("PROGRESS %d", percent);
+	last_percent = percent;
     }
     // These seem to take quite a bit of resources for me, and actually slow down boot.
     // 18 seconds boot without these, 26 with.
@@ -110,8 +110,8 @@
     last_percent = 0;
     if (api_version != API_VERSION)
     {
-        F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
-        return (FALSE);
+	F_("This module is compiled for api_version %i version and initng is compiled on %i version, won't load this module!\n", API_VERSION, api_version);
+	return (FALSE);
     }
     initng_plugin_hook_add(&g.ASTATUS_CHANGE, 80, &print_output);
 

Modified: initng/trunk/src/initng.h
==============================================================================
--- initng/trunk/src/initng.h	(original)
+++ initng/trunk/src/initng.h	Wed Apr  5 22:57:12 2006
@@ -26,7 +26,7 @@
 #endif
 
 #define _GNU_SOURCE
-#include <stdio.h>                          /* printf */
+#include <stdio.h>			    /* printf */
 #include "initng_error.h"
 
 /* Undef TRUE FALSE FAIL, so not compiled complains about redefining */

Modified: initng/trunk/src/initng_active_db.c
==============================================================================
--- initng/trunk/src/initng_active_db.c	(original)
+++ initng/trunk/src/initng_active_db.c	Wed Apr  5 22:57:12 2006
@@ -58,10 +58,10 @@
     /* first, search for an exact match */
     while_active_db(current)
     {
-        assert(current->name);
-        /* check if this service name is like service */
-        if (strcmp(current->name, service) == 0)
-            return (current);               /* return it */
+	assert(current->name);
+	/* check if this service name is like service */
+	if (strcmp(current->name, service) == 0)
+	    return (current);		    /* return it */
     }
 
     /* did not find any */
@@ -81,7 +81,7 @@
 
     /* first give the exact find a shot */
     if ((current = initng_active_db_find_by_exact_name(service)))
-        return (current);
+	return (current);
 
 
     /* did not find any */
@@ -93,10 +93,10 @@
     current = NULL;
     while_active_db(current)
     {
-        assert(current->name);
-        /* then try to find alike name */
-        if (service_match(current->name, service))
-            return (current);
+	assert(current->name);
+	/* then try to find alike name */
+	if (service_match(current->name, service))
+	    return (current);
 
     }
 }
@@ -111,22 +111,22 @@
 
     /*printf("reload_service_cache();\n"); */
     if (head->res)
-        return (TRUE);
+	return (TRUE);
 
     /* Get the service pointer */
     service = list_entry(head, active_db_h, data);
 
     /* Check if from_service is set */
     if (service->from_service)
-        /* point the resursive data pointer, to the service_cache data head */
-        head->res = &service->from_service->data;
+	/* point the resursive data pointer, to the service_cache data head */
+	head->res = &service->from_service->data;
 
     /* OK, try reload data from disk then */
     if (initng_common_get_service(service) && service->from_service)
     {
-        /* point the resursive data pointer, to the service_cache data head */
-        head->res = &service->from_service->data;
-        return (TRUE);
+	/* point the resursive data pointer, to the service_cache data head */
+	head->res = &service->from_service->data;
+	return (TRUE);
     }
 
     printf("Failed to reload service_cache for %s\n", service->name);
@@ -149,16 +149,16 @@
 
     /* first search by name */
     if ((current = initng_active_db_find_by_name(service)))
-        return (current);
+	return (current);
 
     /* if the string contains a '/' it is looking for an exact match, so no searching here */
     for (i = 0; service[i]; i++)
-        if (service[i] == '/')
-            return (NULL);
+	if (service[i] == '/')
+	    return (NULL);
 
     /* remove starting wildcards */
     while (service[0] == '*' || service[0] == '?')
-        service++;
+	service++;
 
     copy = i_strdup(service);
     assert(copy);
@@ -166,22 +166,22 @@
     /* remove last wildcards */
     for (i = 0; copy[i]; i++)
     {
-        if (copy[i] == '*' || copy[i] == '?')
-            copy[i] = '\0';
+	if (copy[i] == '*' || copy[i] == '?')
+	    copy[i] = '\0';
     }
 
     /* then search for a word match */
     current = NULL;
     while_active_db(current)
     {
-        assert(current->name);
-        /* check if this service name is like service */
-        if (strstr(current->name, copy))
-        {
-            D_("Warning, the return is not an exact match!\n");
-            free(copy);
-            return (current);               /* return it */
-        }
+	assert(current->name);
+	/* check if this service name is like service */
+	if (strstr(current->name, copy))
+	{
+	    D_("Warning, the return is not an exact match!\n");
+	    free(copy);
+	    return (current);		    /* return it */
+	}
     }
     free(copy);
 
@@ -200,10 +200,10 @@
     /* walk the active_db */
     while_active_db(current)
     {
-        assert(current->name);
-        /* check if this service->from_service is like service */
-        if (current->from_service && current->from_service == service)
-            return (current);               /* return it */
+	assert(current->name);
+	/* check if this service->from_service is like service */
+	if (current->from_service && current->from_service == service)
+	    return (current);		    /* return it */
 
     }
 
@@ -219,13 +219,13 @@
     /* walk the active_db */
     while_active_db(currentA)
     {
-        assert(currentA->name);
-        currentP = NULL;
-        while_processes(currentP, currentA)
-        {
-            if (currentP->pid == pid)
-                return (currentA);
-        }
+	assert(currentA->name);
+	currentP = NULL;
+	while_processes(currentP, currentA)
+	{
+	    if (currentP->pid == pid)
+		return (currentA);
+	}
     }
 
     /* bad luck */
@@ -247,9 +247,9 @@
     /* Look for duplicate */
     if ((current = initng_active_db_find_by_name(add_this->name)))
     {
-        /* TODO, should add_this bee freed? */
-        W_("active_db_add(%s): duplicate here\n", add_this->name);
-        return (FALSE);
+	/* TODO, should add_this bee freed? */
+	W_("active_db_add(%s): duplicate here\n", add_this->name);
+	return (FALSE);
     }
 
     list_add(&add_this->list, &g.active_database.list);
@@ -267,19 +267,19 @@
     assert(name);
 
     /* allocate a new active entry */
-    new_active = (active_db_h *) i_calloc(1, sizeof(active_db_h));      /* Allocate memory for a new active */
-    if (!new_active)                        /* out of memory? */
+    new_active = (active_db_h *) i_calloc(1, sizeof(active_db_h));	/* Allocate memory for a new active */
+    if (!new_active)			    /* out of memory? */
     {
-        F_("Unable to allocate active, out of memory?\n");
-        return (NULL);
+	F_("Unable to allocate active, out of memory?\n");
+	return (NULL);
     }
 
     /* set the name */
     new_active->name = i_strdup(name);
     if (!new_active->name)
     {
-        F_("Unable to set name, out of memory?\n");
-        return (NULL);
+	F_("Unable to set name, out of memory?\n");
+	return (NULL);
     }
 
     DATA_HEAD_INIT_REQUEST(&new_active->data, NULL, &reload_service_cache);
@@ -290,9 +290,9 @@
     /* get the time, and copy that time to all time entries */
     gettimeofday(&new_active->time_current_state, NULL);
     memcpy(&new_active->time_last_state, &new_active->time_current_state,
-           sizeof(struct timeval));
+	   sizeof(struct timeval));
     memcpy(&new_active->last_rought_time, &new_active->time_current_state,
-           sizeof(struct timeval));
+	   sizeof(struct timeval));
 
     /* mark this service as stopped, because it is not yet starting, or running */
     new_active->current_state = &NEW;
@@ -321,8 +321,8 @@
 
     while_processes_safe(current, safe, pf)
     {
-        list_del(&current->list);
-        initng_process_db_free(current);
+	list_del(&current->list);
+	initng_process_db_free(current);
     }
 
     /* remove every data entry */
@@ -331,15 +331,15 @@
     /* remove file cache of entry if present, so we got a fresh read from file when this service is restarted */
     if (pf->from_service)
     {
-        /* remove from cache list */
-        list_del(&pf->from_service->list);
-        /* free entry */
-        initng_service_cache_free(pf->from_service);
+	/* remove from cache list */
+	list_del(&pf->from_service->list);
+	/* free entry */
+	initng_service_cache_free(pf->from_service);
     }
 
     /* free service name */
     if (pf->name)
-        free(pf->name);
+	free(pf->name);
 
     /* free service struct */
     free(pf);
@@ -353,9 +353,9 @@
 
     while_active_db_safe(current, safe)
     {
-        assert(current->name);
-        list_del(&current->list);
-        initng_active_db_free(current);
+	assert(current->name);
+	list_del(&current->list);
+	initng_active_db_free(current);
     }
 }
 
@@ -370,19 +370,19 @@
     /* walk the active_db */
     while_active_db(current)
     {
-        assert(current->name);
-        /* change this time */
-        current->time_current_state.tv_sec += skew;
-        current->time_last_state.tv_sec += skew;
-        current->last_rought_time.tv_sec += skew;
-        current->alarm += skew;
+	assert(current->name);
+	/* change this time */
+	current->time_current_state.tv_sec += skew;
+	current->time_last_state.tv_sec += skew;
+	current->last_rought_time.tv_sec += skew;
+	current->alarm += skew;
     }
 }
 
 
 /* update all service_h pointers in whole active_db */
 void initng_active_db_change_service_h(service_cache_h * from,
-                                       service_cache_h * to)
+				       service_cache_h * to)
 {
     active_db_h *current = NULL;
 
@@ -392,57 +392,57 @@
     /* walk the active_db */
     while_active_db(current)
     {
-        assert(current->name);
-        /* change this time */
-        if (current->from_service == from)
-        {
-            current->from_service = to;
-
-            /* Reset data resursive pointer, will be set by reload_service_cache */
-            if (current->from_service)
-                current->data.res = &current->from_service->data;
-            else
-                current->data.res = NULL;
-        }
+	assert(current->name);
+	/* change this time */
+	if (current->from_service == from)
+	{
+	    current->from_service = to;
+
+	    /* Reset data resursive pointer, will be set by reload_service_cache */
+	    if (current->from_service)
+		current->data.res = &current->from_service->data;
+	    else
+		current->data.res = NULL;
+	}
     }
 }
 
 /* active_db_count counts a type, if null, count all */
 int initng_active_db_count(a_state_h * current_state_to_count)
 {
-    int counter = 0;            /* actives counter */
+    int counter = 0;		/* actives counter */
     active_db_h *current = NULL;
 
     /* ok, go COUNT ALL */
     if (!current_state_to_count)
     {
-        /* ok, go through all */
-        while_active_db(current)
-        {
-            assert(current->name);
-
-            /* count almost all */
-
-            /* but not failed services */
-            if (IS_FAILED(current))
-                continue;
-            /* and not stopped */
-            if (IS_DOWN(current))
-                continue;
+	/* ok, go through all */
+	while_active_db(current)
+	{
+	    assert(current->name);
+
+	    /* count almost all */
+
+	    /* but not failed services */
+	    if (IS_FAILED(current))
+		continue;
+	    /* and not stopped */
+	    if (IS_DOWN(current))
+		continue;
 
-            counter++;
-        }
+	    counter++;
+	}
 
-        return (counter);
+	return (counter);
     }
 
     /* ok, go COUNT A SPECIAL */
     while_active_db(current)
     {
-        assert(current->name);
-        /* check if this is the status to count */
-        if (current->current_state == current_state_to_count)
-            counter++;
+	assert(current->name);
+	/* check if this is the status to count */
+	if (current->current_state == current_state_to_count)
+	    counter++;
     }
     /* return counter */
     return (counter);
@@ -462,39 +462,39 @@
     /* walk the active_db */
     while_active_db(current)
     {
-        assert(current->name);
-        assert(current->current_state);
+	assert(current->name);
+	assert(current->current_state);
 
-        /* count starting */
-        if (IS_STARTING(current))
-        {
-            starting++;
-            continue;
-        }
-
-        /* count up */
-        if (IS_UP(current))
-        {
-            up++;
-            continue;
-        }
+	/* count starting */
+	if (IS_STARTING(current))
+	{
+	    starting++;
+	    continue;
+	}
+
+	/* count up */
+	if (IS_UP(current))
+	{
+	    up++;
+	    continue;
+	}
 
-        /* count others */
-        other++;
+	/* count others */
+	other++;
     }
     D_("active_db_percent_started(): up: %i   starting: %i  other: %i\n", up,
        starting, other);
 
     /* if no one starting */
     if (starting <= 0)
-        return (100);
+	return (100);
 
     if (up > 0)
     {
-        tmp = 100 * (float) up / (float) (starting + up);
-        D_("active_db_percent_started(): up/starting: %f percent: %i\n\n",
-           (float) up / (float) starting, (int) tmp);
-        return ((int) tmp);
+	tmp = 100 * (float) up / (float) (starting + up);
+	D_("active_db_percent_started(): up/starting: %f percent: %i\n\n",
+	   (float) up / (float) starting, (int) tmp);
+	return ((int) tmp);
     }
     return 0;
 }
@@ -510,25 +510,25 @@
 
     while_active_db(current)
     {
-        assert(current->name);
-        assert(current->current_state);
+	assert(current->name);
+	assert(current->current_state);
 
-        /* count stopped services */
-        if (IS_DOWN(current))
-        {
-            down++;
-            continue;
-        }
-
-        /* count stopping */
-        if (IS_STOPPING(current))
-        {
-            stopping++;
-            continue;
-        }
+	/* count stopped services */
+	if (IS_DOWN(current))
+	{
+	    down++;
+	    continue;
+	}
+
+	/* count stopping */
+	if (IS_STOPPING(current))
+	{
+	    stopping++;
+	    continue;
+	}
 
-        /* count others */
-        other++;
+	/* count others */
+	other++;
     }
 
     D_("active_db_percent_stopped(): down: %i   stopping: %i  other: %i\n",
@@ -536,14 +536,14 @@
 
     /* if no one stopping */
     if (stopping <= 0)
-        return (100);
+	return (100);
 
     if (down > 0)
     {
-        tmp = 100 * (float) down / (float) (stopping + down);
-        D_("active_db_percent_stopped(): down/stopping: %f percent: %i\n\n",
-           (float) down / (float) stopping, (int) tmp);
-        return ((int) tmp);
+	tmp = 100 * (float) down / (float) (stopping + down);
+	D_("active_db_percent_stopped(): down/stopping: %f percent: %i\n\n",
+	   (float) down / (float) stopping, (int) tmp);
+	return ((int) tmp);
     }
     return 0;
 }
@@ -562,17 +562,17 @@
 
     while_active_db_safe(current, safe)
     {
-        assert(current->name);
-        assert(current->current_state);
+	assert(current->name);
+	assert(current->current_state);
 
-        /* count stopped services */
-        if (!IS_DOWN(current))
-            continue;
-
-        if (g.now.tv_sec > current->time_current_state.tv_sec + CLEAN_DELAY)
-        {
-            list_del(&current->list);
-            initng_active_db_free(current);
-        }
+	/* count stopped services */
+	if (!IS_DOWN(current))
+	    continue;
+
+	if (g.now.tv_sec > current->time_current_state.tv_sec + CLEAN_DELAY)
+	{
+	    list_del(&current->list);
+	    initng_active_db_free(current);
+	}
     }
 }

Modified: initng/trunk/src/initng_active_db.h
==============================================================================
--- initng/trunk/src/initng_active_db.h	(original)
+++ initng/trunk/src/initng_active_db.h	Wed Apr  5 22:57:12 2006
@@ -49,11 +49,11 @@
 
     /* current state */
     a_state_h *current_state;
-    struct timeval time_current_state;  /* the time got current state */
+    struct timeval time_current_state;	/* the time got current state */
 
     /* last    state */
     a_state_h *last_state;
-    struct timeval time_last_state;     /* the time got last state */
+    struct timeval time_last_state;	/* the time got last state */
 
     /* Rough  state */
     e_is last_rought_state;
@@ -87,7 +87,7 @@
 
 /* mangling */
 void initng_active_db_change_service_h(service_cache_h * from,
-                                       service_cache_h * to);
+				       service_cache_h * to);
 void initng_active_db_compensate_time(time_t skew);
 
 /* reload service cache if not set */

Modified: initng/trunk/src/initng_active_state.c
==============================================================================
--- initng/trunk/src/initng_active_state.c	(original)
+++ initng/trunk/src/initng_active_state.c	Wed Apr  5 22:57:12 2006
@@ -34,8 +34,8 @@
     /* look for duplicates */
     if (initng_active_state_find(state->state_name) != NULL)
     {
-        F_("There exists a state with this state_name (%s) already, please check this!\n", state->state_name);
-        return (FALSE);
+	F_("There exists a state with this state_name (%s) already, please check this!\n", state->state_name);
+	return (FALSE);
     }
 
     D_("adding %s.\n", state->state_name);
@@ -55,8 +55,8 @@
     /* walk the state db */
     while_active_states(current)
     {
-        if (strcmp(state_name, current->state_name) == 0)
-            return (current);
+	if (strcmp(state_name, current->state_name) == 0)
+	    return (current);
     }
     return (NULL);
 }

Modified: initng/trunk/src/initng_common.c
==============================================================================
--- initng/trunk/src/initng_common.c	(original)
+++ initng/trunk/src/initng_common.c	Wed Apr  5 22:57:12 2006
@@ -23,15 +23,15 @@
 
 /* system headers */
 #include <sys/time.h>
-#include <time.h>                           /* time() */
-#include <fcntl.h>                          /* fcntl() */
-#include <sys/un.h>                         /* memmove() strcmp() */
-#include <sys/wait.h>                       /* waitpid() sa */
-#include <linux/kd.h>                       /* KDSIGACCEPT */
-#include <sys/ioctl.h>                      /* ioctl() */
-#include <stdio.h>                          /* printf() */
-#include <stdlib.h>                         /* free() exit() */
-#include <sys/reboot.h>                     /* reboot() RB_DISABLE_CAD */
+#include <time.h>			    /* time() */
+#include <fcntl.h>			    /* fcntl() */
+#include <sys/un.h>			    /* memmove() strcmp() */
+#include <sys/wait.h>			    /* waitpid() sa */
+#include <linux/kd.h>			    /* KDSIGACCEPT */
+#include <sys/ioctl.h>			    /* ioctl() */
+#include <stdio.h>			    /* printf() */
+#include <stdlib.h>			    /* free() exit() */
+#include <sys/reboot.h>			    /* reboot() RB_DISABLE_CAD */
 #include <assert.h>
 
 #include "initng_common.h"
@@ -64,13 +64,13 @@
     /* walk through arguments looking for this dep to be blacklisted */
     for (i = 1; (g.Argv)[i]; i++)
     {
-        /* if we got a match */
-        if ((g.Argv)[i][0] == '-')
-        {
-            if (strcmp(name, (g.Argv)[i] + 1) == 0
-                || service_match(name, (g.Argv)[i] + 1))
-                return (TRUE);
-        }
+	/* if we got a match */
+	if ((g.Argv)[i][0] == '-')
+	{
+	    if (strcmp(name, (g.Argv)[i] + 1) == 0
+		|| service_match(name, (g.Argv)[i] + 1))
+		return (TRUE);
+	}
     }
     return (FALSE);
 }
@@ -87,42 +87,42 @@
     /* check the blacklist db */
     if (initng_common_service_blacklisted(service_name))
     {
-        F_("load_to_active(%s): Service BLACKLISTED.\n", service_name);
-        return (NULL);
+	F_("load_to_active(%s): Service BLACKLISTED.\n", service_name);
+	return (NULL);
     }
 
     /* Make sure there isn't any process with this name running */
     if ((a_new = initng_active_db_find_by_name(service_name)))
     {
-        F_("load_to_active(%s): Service with same name %s exists! \n",
-           service_name);
-        return (NULL);
+	F_("load_to_active(%s): Service with same name %s exists! \n",
+	   service_name);
+	return (NULL);
     }
 
     /* if not create a new active entry, out of memory? */
     if (!(a_new = initng_active_db_new(service_name)))
     {
-        D_("load_to_active(%s): Unable to allocate process, out of memory?\n",
-           service_name);
-        return (NULL);
+	D_("load_to_active(%s): Unable to allocate process, out of memory?\n",
+	   service_name);
+	return (NULL);
     }
 
     /* this actually loads service from disk */
     if (!initng_common_get_service(a_new) || !(a_new->from_service))
     {
-        D_("load_to_active(%s): Can't get service!\n", service_name);
-        if (a_new)
-            initng_active_db_free(a_new);
-        return (NULL);
+	D_("load_to_active(%s): Can't get service!\n", service_name);
+	if (a_new)
+	    initng_active_db_free(a_new);
+	return (NULL);
     }
 
     /* Mark this service as state LOADING, plug-ins may hook here */
     if (!initng_common_mark_service(a_new, &LOADING))
     {
-        W_("Failed to mark service LOADING.\n");
-        if (a_new)
-            initng_active_db_free(a_new);
-        return (NULL);
+	W_("Failed to mark service LOADING.\n");
+	if (a_new)
+	    initng_active_db_free(a_new);
+	return (NULL);
     }
 
     /*
@@ -150,26 +150,26 @@
      * any of the services being added to the active_db */
     if (g.no_circular == 0)
     {
-        while_active_db(current)
-        {
-            if (initng_depend_deep(a_new, current)
-                && initng_depend_deep(current, a_new))
-            {
-                F_("load_to_active(%s): not loading service %s, because it has a circular dependency on %s\n", service_name, a_new->name, current->name);
-                initng_active_db_free(a_new);
-                return NULL;
-            }
-        }
+	while_active_db(current)
+	{
+	    if (initng_depend_deep(a_new, current)
+		&& initng_depend_deep(current, a_new))
+	    {
+		F_("load_to_active(%s): not loading service %s, because it has a circular dependency on %s\n", service_name, a_new->name, current->name);
+		initng_active_db_free(a_new);
+		return NULL;
+	    }
+	}
     }
 
     /* return with pointer to service */
     if (initng_active_db_add(a_new) == TRUE)
-        return (a_new);
+	return (a_new);
 
     /* fail by default */
     F_("active_db_add() FAILED!\n");
     if (a_new)
-        initng_active_db_free(a_new);
+	initng_active_db_free(a_new);
     return (NULL);
 }
 
@@ -188,32 +188,32 @@
     /* check if service is set already */
     if (service->from_service)
     {
-        D_("get_service(%s): already have a service!\n", service->name);
-        return (TRUE);
+	D_("get_service(%s): already have a service!\n", service->name);
+	return (TRUE);
     }
 
     /* of course, we cant get service data from a virtual */
     if (strncmp(service->name, "virtual/", 8) == 0)
-        return (FALSE);
+	return (FALSE);
 
 
     /* check the cache database for an exact match */
     if ((service->from_service =
-         initng_service_cache_find_by_exact_name(service->name)))
+	 initng_service_cache_find_by_exact_name(service->name)))
     {
-        service->type = service->from_service->type;
-        service->data.res = &service->from_service->data;
-        D_("get_service(%s): found service in service database!\n",
-           service->name);
-        return (TRUE);
+	service->type = service->from_service->type;
+	service->data.res = &service->from_service->data;
+	D_("get_service(%s): found service in service database!\n",
+	   service->name);
+	return (TRUE);
     }
 
     /* try parse with dynamic loaded parsers */
     if (!(service->from_service = initng_common_parse_service(service->name)))
     {
-        /* or fail */
-        D_("get_service(%s): Can't get source.. \n", service->name);
-        return (FALSE);
+	/* or fail */
+	D_("get_service(%s): Can't get source.. \n", service->name);
+	return (FALSE);
     }
     service->type = service->from_service->type;
     service->data.res = &service->from_service->data;
@@ -232,25 +232,25 @@
 
     /* cont the tokens to the first '/' */
     while (service->from_service->name[i]
-           && service->from_service->name[i] != '/')
-        i++;
+	   && service->from_service->name[i] != '/')
+	i++;
 
     /* if there was no '/' don't complain */
     if (service->from_service->name[i] != '/')
-        return (TRUE);
+	return (TRUE);
 
     /* compare the first i chars */
     if (strncmp(service->from_service->name, service->name, i) != 0)
     {
-        D_("Name %s ..\n", service->name);
-        char *new_name = (char *) i_calloc(strlen(service->name) + i + 3,
-                                           sizeof(char));
-
-        strncpy(new_name, service->from_service->name, i + 1);
-        strcat(new_name, service->name);
-        free(service->name);
-        service->name = new_name;
-        D_(" Is now: %s \n", service->name);
+	D_("Name %s ..\n", service->name);
+	char *new_name = (char *) i_calloc(strlen(service->name) + i + 3,
+					   sizeof(char));
+
+	strncpy(new_name, service->from_service->name, i + 1);
+	strcat(new_name, service->name);
+	free(service->name);
+	service->name = new_name;
+	D_(" Is now: %s \n", service->name);
     }
 
     /* return happily */
@@ -272,12 +272,12 @@
     /* walk over all services */
     while_active_db(current)
     {
-        if (current == service)
-            continue;
+	if (current == service)
+	    continue;
 
-        /* if current depends on service failed to start */
-        if (initng_depend(current, service) == TRUE)
-            initng_common_mark_service(current, &START_DEP_FAILED);
+	/* if current depends on service failed to start */
+	if (initng_depend(current, service) == TRUE)
+	    initng_common_mark_service(current, &START_DEP_FAILED);
     }
 #endif
 }
@@ -294,12 +294,12 @@
     /* walk over all services */
     while_active_db(current)
     {
-        if (current == service)
-            continue;
+	if (current == service)
+	    continue;
 
-        /* if current depends on service failed to stop */
-        if (initng_active_db_dep_on(current, service) == TRUE)
-            initng_common_mark_service(current, STOP_DEP_FAILED);
+	/* if current depends on service failed to stop */
+	if (initng_active_db_dep_on(current, service) == TRUE)
+	    initng_common_mark_service(current, STOP_DEP_FAILED);
     }
 }
 #endif
@@ -310,13 +310,13 @@
 
     /* If system is not starting, we have nothing to set. */
     if (g.sys_state != STATE_STARTING)
-        return;
+	return;
 
     /* check actives, if any has one of these status, system cant be set to STATE_UP */
     while_active_db(current)
     {
-        if (IS_STARTING(current))
-            return;
+	if (IS_STARTING(current))
+	    return;
     }
 
     /* OK, system is up */
@@ -332,33 +332,33 @@
     /* first check service cache */
     service = initng_service_cache_find_by_name(name);
     if (service)
-        return (service);
+	return (service);
 
     /* try parse with dynamic loaded parsers */
     while_list_safe(current, &g.PARSERS, safe)
     {
-        service = ((*current->c.parser) (name));
+	service = ((*current->c.parser) (name));
 
-        /* break if we found the service */
-        if (service)
-            break;
+	/* break if we found the service */
+	if (service)
+	    break;
 
     }
 
     /* look so we actually got one */
     if (!service)
-        return (NULL);
+	return (NULL);
 
     /* May be there is plug-ins that will parse extra data */
     current = NULL;
     safe = NULL;
     while_list_safe(current, &g.ADDITIONAL_PARSE, safe)
     {
-        if (((*current->c.additional_parse) (service)) != TRUE)
-        {
-            initng_service_cache_free(service);
-            return (NULL);
-        }
+	if (((*current->c.additional_parse) (service)) != TRUE)
+	{
+	    initng_service_cache_free(service);
+	    return (NULL);
+	}
     }
 
     /* return the service */
@@ -386,10 +386,10 @@
     /* 1: Test if already set */
     if (service->current_state == state)
     {
-        D_("warning, this state %s is already set on %s!\n",
-           state->state_name, service->name);
-        /* it is actually already set to requested state */
-        return (TRUE);
+	D_("warning, this state %s is already set on %s!\n",
+	   state->state_name, service->name);
+	/* it is actually already set to requested state */
+	return (TRUE);
     }
 
 
@@ -401,14 +401,14 @@
     /* Fill last entries */
     service->last_state = service->current_state;
     memcpy(&service->time_last_state, &service->time_current_state,
-           sizeof(struct timeval));
+	   sizeof(struct timeval));
 
     /* update rough last to */
     if (service->last_rought_state != service->current_state->is)
     {
-        service->last_rought_state = service->current_state->is;
-        memcpy(&service->last_rought_time, &service->time_current_state,
-               sizeof(memcpy));
+	service->last_rought_state = service->current_state->is;
+	memcpy(&service->last_rought_time, &service->time_current_state,
+	       sizeof(memcpy));
     }
 
     /* reset alarm, set state and time */
@@ -421,73 +421,73 @@
     current = q = NULL;
     while_list_safe(current, &g.ASTATUS_CHANGE, q)
     {
-        if ((*current->c.status_change) (service) <= FALSE)
-        {
-            D_("Some plugin return FALSE when service %s Astate_CHANGE to %s hook called, aborting here.\n", service->name, service->current_state->state_name);
-            return (FALSE);
-        }
-
-        /* make sure that state was not changed again, because then, dont call more hooks */
-        if (service->current_state != state)
-            return (TRUE);
+	if ((*current->c.status_change) (service) <= FALSE)
+	{
+	    D_("Some plugin return FALSE when service %s Astate_CHANGE to %s hook called, aborting here.\n", service->name, service->current_state->state_name);
+	    return (FALSE);
+	}
+
+	/* make sure that state was not changed again, because then, dont call more hooks */
+	if (service->current_state != state)
+	    return (TRUE);
     }
 
 
     /* If the rough state has changed */
     if (service->last_rought_state != state->is)
     {
-        D_("An is change from %i to %i for %s.\n", service->last_rought_state,
-           state->is, service->name);
-        current = q = NULL;
-        while_list_safe(current, &g.IS_CHANGE, q)
-        {
-            if ((*current->c.status_change) (service) <= FALSE)
-            {
-                D_("Some plugin return FALSE when service %s IS_CHANGE to %s hook called, aborting here.\n", service->name, service->current_state->state_name);
-                return (FALSE);
-            }
-
-            /* make sure that state was not changed again, because then, dont call more hooks */
-            if (service->current_state != state)
-                return (TRUE);
-        }
-
-        /* This checks if all services on a runlevel is up, then set STATE_UP */
-        if (IS_UP(service))
-            check_sys_state_up();
-
-        /* this will make all services, that depend of this, DEP_FAILED_TO_START */
-        if (IS_FAILED(service))
-        {
-            dep_failed_to_start(service);
-            check_sys_state_up();
-        }
-
-        /* if this service is marked restarting, please restart it if its set to STOPPED */
-        if (IS_DOWN(service))
-        {
-            if (is(&RESTARTING, service))
-            {
-                initng_handler_restart_restarting();
-            }
-        }
-        /* this will make all services, that depend of this to stop, DEP_FAILED_TO_STOP */
-        /* TODO
-           if (IS_MARK(service, &FAIL_STOPPING))
-           {
-           #ifdef DEP_FAIL_TO_STOP
-           dep_failed_to_stop(service);
-           #endif
-           check_sys_state_up();
-           }
-         */
+	D_("An is change from %i to %i for %s.\n", service->last_rought_state,
+	   state->is, service->name);
+	current = q = NULL;
+	while_list_safe(current, &g.IS_CHANGE, q)
+	{
+	    if ((*current->c.status_change) (service) <= FALSE)
+	    {
+		D_("Some plugin return FALSE when service %s IS_CHANGE to %s hook called, aborting here.\n", service->name, service->current_state->state_name);
+		return (FALSE);
+	    }
+
+	    /* make sure that state was not changed again, because then, dont call more hooks */
+	    if (service->current_state != state)
+		return (TRUE);
+	}
+
+	/* This checks if all services on a runlevel is up, then set STATE_UP */
+	if (IS_UP(service))
+	    check_sys_state_up();
+
+	/* this will make all services, that depend of this, DEP_FAILED_TO_START */
+	if (IS_FAILED(service))
+	{
+	    dep_failed_to_start(service);
+	    check_sys_state_up();
+	}
+
+	/* if this service is marked restarting, please restart it if its set to STOPPED */
+	if (IS_DOWN(service))
+	{
+	    if (is(&RESTARTING, service))
+	    {
+		initng_handler_restart_restarting();
+	    }
+	}
+	/* this will make all services, that depend of this to stop, DEP_FAILED_TO_STOP */
+	/* TODO
+	   if (IS_MARK(service, &FAIL_STOPPING))
+	   {
+	   #ifdef DEP_FAIL_TO_STOP
+	   dep_failed_to_stop(service);
+	   #endif
+	   check_sys_state_up();
+	   }
+	 */
 
     }
 
 
     /* Run state init hook if present */
     if (service->current_state->state_init)
-        (*service->current_state->state_init) (service);
+	(*service->current_state->state_init) (service);
 
     D_("service %s is now %s.\n", service->name,
        service->current_state->state_name);

Modified: initng/trunk/src/initng_control_command.c
==============================================================================
--- initng/trunk/src/initng_control_command.c	(original)
+++ initng/trunk/src/initng_control_command.c	Wed Apr  5 22:57:12 2006
@@ -38,12 +38,12 @@
     /* look for duplicates */
     while_command_db(current)
     {
-        if (current == cmd || current->command_id == cmd->command_id)
-        {
-            F_("Can't add command: %c, %s, it exists already!\n",
-               current->command_id, current->description);
-            return (FALSE);
-        }
+	if (current == cmd || current->command_id == cmd->command_id)
+	{
+	    F_("Can't add command: %c, %s, it exists already!\n",
+	       current->command_id, current->description);
+	    return (FALSE);
+	}
     }
 
     /* add this command to list */
@@ -57,7 +57,7 @@
 
     while_command_db_safe(current, safe)
     {
-        initng_command_del(current);
+	initng_command_del(current);
     }
 }
 
@@ -68,8 +68,8 @@
 
     while_command_db(current)
     {
-        if (current->command_id == cid)
-            return (current);
+	if (current->command_id == cid)
+	    return (current);
     }
     return (NULL);
 }
@@ -81,8 +81,8 @@
 
     while_command_db(current)
     {
-        if (current->long_id && strcmp(current->long_id, name) == 0)
-            return (current);
+	if (current->long_id && strcmp(current->long_id, name) == 0)
+	    return (current);
     }
     return (NULL);
 }
@@ -95,55 +95,55 @@
     /* make sure it found it. */
     if (!cmd)
     {
-        D_("Did not find command %c.\n", cid);
-        return (FALSE);
+	D_("Did not find command %c.\n", cid);
+	return (FALSE);
     }
 
     /* check so its a INT_COMMAND */
     if (cmd->com_type != INT_COMMAND && cmd->com_type != VOID_COMMAND
-        && cmd->com_type != TRUE_OR_FALSE_COMMAND)
+	&& cmd->com_type != TRUE_OR_FALSE_COMMAND)
     {
-        W_("Command %c is not an INT_COMMAND, VOID_COMMAND or TRUE_OR_FALSE_COMMAND.\n", cid);
-        return (FALSE);
+	W_("Command %c is not an INT_COMMAND, VOID_COMMAND or TRUE_OR_FALSE_COMMAND.\n", cid);
+	return (FALSE);
     }
 
     /* Check so the call is actually there */
 
     if (!cmd->u.int_command_void_call)
     {
-        W_("Command %c missing u.int_command_call or u.int_command_void_call.\n", cid);
-        return (FALSE);
+	W_("Command %c missing u.int_command_call or u.int_command_void_call.\n", cid);
+	return (FALSE);
     }
 
 
     /* check with arguments */
     if (!arg && cmd->opt_type == REQUIRES_OPT)
     {
-        F_("Command %c needs an opt!\n", cid);
-        return (FALSE);
+	F_("Command %c needs an opt!\n", cid);
+	return (FALSE);
     }
     if (arg && cmd->opt_type == NO_OPT)
     {
-        F_("Command %c don't uses any options!\n", cid);
-        return (FALSE);
+	F_("Command %c don't uses any options!\n", cid);
+	return (FALSE);
     }
 
     /* now start executing */
     if (cmd->com_type == INT_COMMAND
-        || cmd->com_type == TRUE_OR_FALSE_COMMAND)
+	|| cmd->com_type == TRUE_OR_FALSE_COMMAND)
     {
-        /* execute the command */
-        if (arg)
-            return ((*cmd->u.int_command_call) (arg));
-        /* else */
-        return ((*cmd->u.int_command_void_call) ());
+	/* execute the command */
+	if (arg)
+	    return ((*cmd->u.int_command_call) (arg));
+	/* else */
+	return ((*cmd->u.int_command_void_call) ());
     }
 
     /* else its a VOID command, that wont give us any to return. */
     /* execute the command */
     if (arg)
-        (*cmd->u.void_command_call) (arg);
+	(*cmd->u.void_command_call) (arg);
     else
-        (*cmd->u.void_command_void_call) ();
+	(*cmd->u.void_command_void_call) ();
     return (TRUE);
 }

Modified: initng/trunk/src/initng_control_command.h
==============================================================================
--- initng/trunk/src/initng_control_command.h	(original)
+++ initng/trunk/src/initng_control_command.h	Wed Apr  5 22:57:12 2006
@@ -37,9 +37,9 @@
     STRING_COMMAND = 5,
 
     /* data commands, contains a lot of entrys in binary structs below */
-    DATA_COMMANDS_ROW = 6,                  /* help_row, lists a command */
-    DATA_ACTIVE_ROW = 7,                    /* active_row, list a service */
-    DATA_OPTION_ROW = 8,                    /* list variables that may be set */
+    DATA_COMMANDS_ROW = 6,		    /* help_row, lists a command */
+    DATA_ACTIVE_ROW = 7,		    /* active_row, list a service */
+    DATA_OPTION_ROW = 8,		    /* list variables that may be set */
 } e_com_type;
 
 /*
@@ -48,10 +48,10 @@
  */
 typedef enum
 {
-    STANDARD_COMMAND = 0,       /* shown by ngc -h */
-    ADVANCHED_COMMAND = 1,                  /* shown by ngc -H */
-    HIDDEN_COMMAND = 2,                     /* not shown by ngc -h/-H but still usable */
-    INTERNAL_COMMAND = 3                    /* not shown or usable externaly */
+    STANDARD_COMMAND = 0,	/* shown by ngc -h */
+    ADVANCHED_COMMAND = 1,		    /* shown by ngc -H */
+    HIDDEN_COMMAND = 2,			    /* not shown by ngc -h/-H but still usable */
+    INTERNAL_COMMAND = 3		    /* not shown or usable externaly */
 } e_opt_vissible;
 
 /*
@@ -59,9 +59,9 @@
  */
 typedef enum
 {
-    NO_OPT = 0,                 /* Command uses no option ever */
-    USES_OPT = 1,                           /* Command uses an option if sent */
-    REQUIRES_OPT = 2                        /* Command requires an option set */
+    NO_OPT = 0,			/* Command uses no option ever */
+    USES_OPT = 1,			    /* Command uses an option if sent */
+    REQUIRES_OPT = 2			    /* Command requires an option set */
 } e_opt_type;
 
 
@@ -82,11 +82,11 @@
  */
 typedef struct
 {
-    char command_id;            /* An short char describes a command, like ngc -h */
-    const char *long_id;        /* An long string, describes a command, like ngc --help */
-    e_com_type com_type;        /* Specify how data command returns looks like */
-    e_opt_vissible opt_vissible;        /* Specifys how accesible the command is for the end user */
-    e_opt_type opt_type;        /* Is an option required to the command */
+    char command_id;		/* An short char describes a command, like ngc -h */
+    const char *long_id;	/* An long string, describes a command, like ngc --help */
+    e_com_type com_type;	/* Specify how data command returns looks like */
+    e_opt_vissible opt_vissible;	/* Specifys how accesible the command is for the end user */
+    e_opt_type opt_type;	/* Is an option required to the command */
 
     /*
      * Here we put a pointer to a function,
@@ -94,13 +94,13 @@
      */
     union
     {
-        void (*void_command_call) (void *data);
-        void (*void_command_void_call) (void);
-        int (*int_command_call) (void *data);
-        int (*int_command_void_call) (void);
-        char *(*string_command_call) (void *data);
-        char *(*string_command_void_call) (void);
-        void (*data_command_call) (char *data, s_payload * payload);
+	void (*void_command_call) (void *data);
+	void (*void_command_void_call) (void);
+	int (*int_command_call) (void *data);
+	int (*int_command_void_call) (void);
+	char *(*string_command_call) (void *data);
+	char *(*string_command_void_call) (void);
+	void (*data_command_call) (char *data, s_payload * payload);
     } u;
 
     /*

Modified: initng/trunk/src/initng_depend.c
==============================================================================
--- initng/trunk/src/initng_depend.c	(original)
+++ initng/trunk/src/initng_depend.c	Wed Apr  5 22:57:12 2006
@@ -21,7 +21,7 @@
 
 
 #include <stdio.h>
-#include <stdlib.h>                         /* free() exit() */
+#include <stdlib.h>			    /* free() exit() */
 #include <string.h>
 #include <assert.h>
 
@@ -53,17 +53,17 @@
 
     /* it can never depend on itself */
     if (service == check)
-        return (FALSE);
+	return (FALSE);
 
     /* run the local static dep check */
     if (dep_on(service, check) == TRUE)
-        return (TRUE);
+	return (TRUE);
 
     /* run the global plugin dep check */
     while_list_safe(current, &g.DEP_ON, s)
     {
-        if ((result = (*current->c.dep_on_check) (service, check) == TRUE))
-            return (TRUE);
+	if ((result = (*current->c.dep_on_check) (service, check) == TRUE))
+	    return (TRUE);
     }
 
     return (FALSE);
@@ -78,7 +78,7 @@
  * Summary, does service depends on check?
  */
 static int initng_depend_deep2(active_db_h * service, active_db_h * check,
-                               int *stack);
+			       int *stack);
 int initng_depend_deep(active_db_h * service, active_db_h * check)
 {
     int stack = 0;
@@ -87,33 +87,33 @@
 }
 
 static int initng_depend_deep2(active_db_h * service, active_db_h * check,
-                               int *stack)
+			       int *stack)
 {
     active_db_h *current = NULL;
     int result = FALSE;
 
     if (current == service)
-        return (FALSE);
+	return (FALSE);
 
     /* if service depends on check, it also dep_on_deep's on check */
     /* this serves as an exit from the recursion */
     if (initng_depend(service, check))
-        return (TRUE);
+	return (TRUE);
 
     /* in case there is a circular dependency, break after 10 levels of recursion */
     (*stack)++;
     if (*stack > 10)
-        return (FALSE);
+	return (FALSE);
 
     /* loop over all services, if service depends on current, recursively check if
      * current may depend (deep) on check */
     while_active_db(current)
     {
-        if (initng_depend(service, current))
-        {
-            if ((result = initng_depend_deep2(current, check, stack)))
-                break;
-        }
+	if (initng_depend(service, current))
+	{
+	    if ((result = initng_depend_deep2(current, check, stack)))
+		break;
+	}
     }
     return result;
 }
@@ -130,21 +130,21 @@
 
     while_active_db(current)
     {
-        /* Dont mind stop itself */
-        if (current == service)
-            continue;
-
-        if (IS_UP(current) || IS_STARTING(current) || IS_STOPPING(current))
-        {
-
-            /* if current depends on service */
-            if (initng_depend_deep(current, service) == TRUE)
-            {
-                printf("Service %s depends on %s\n", current->name,
-                       service->name);
-                return (TRUE);
-            }
-        }
+	/* Dont mind stop itself */
+	if (current == service)
+	    continue;
+
+	if (IS_UP(current) || IS_STARTING(current) || IS_STOPPING(current))
+	{
+
+	    /* if current depends on service */
+	    if (initng_depend_deep(current, service) == TRUE)
+	    {
+		printf("Service %s depends on %s\n", current->name,
+		       service->name);
+		return (TRUE);
+	    }
+	}
     }
     printf("None found depending on %s.\n", service->name);
     return (FALSE);
@@ -161,20 +161,20 @@
 
     while ((string = get_next_string(&REQUIRE, service, &current)))
     {
-        if (strcmp(string, check->name) == 0)
-            return (TRUE);
+	if (strcmp(string, check->name) == 0)
+	    return (TRUE);
     }
     current = NULL;
     while ((string = get_next_string(&NEED, service, &current)))
     {
-        if (strcmp(string, check->name) == 0)
-            return (TRUE);
+	if (strcmp(string, check->name) == 0)
+	    return (TRUE);
     }
     current = NULL;
     while ((string = get_next_string(&USE, service, &current)))
     {
-        if (strcmp(string, check->name) == 0)
-            return (TRUE);
+	if (strcmp(string, check->name) == 0)
+	    return (TRUE);
     }
     return (FALSE);
 }
@@ -187,13 +187,13 @@
     /* also stop all service depending on service_to_stop */
     while_active_db_safe(current, safe)
     {
-        /* Dont mind stop itself */
-        if (current == service)
-            continue;
-
-        /* if current depends on the one we are stopping */
-        if (initng_depend_deep(current, service) == TRUE)
-            initng_handler_stop_service(current);
+	/* Dont mind stop itself */
+	if (current == service)
+	    continue;
+
+	/* if current depends on the one we are stopping */
+	if (initng_depend_deep(current, service) == TRUE)
+	    initng_handler_stop_service(current);
     }
 
     return (TRUE);
@@ -207,13 +207,13 @@
     /* also stop all service depending on service_to_stop */
     while_active_db_safe(current, safe)
     {
-        /* Dont mind stop itself */
-        if (current == service)
-            continue;
-
-        /* if current depends on the one we are stopping */
-        if (initng_depend_deep(current, service) == TRUE)
-            initng_handler_restart_service(current);
+	/* Dont mind stop itself */
+	if (current == service)
+	    continue;
+
+	/* if current depends on the one we are stopping */
+	if (initng_depend_deep(current, service) == TRUE)
+	    initng_handler_restart_service(current);
     }
 
     return (TRUE);
@@ -232,8 +232,8 @@
     while_list_safe(current, &g.UP_MET, s)
     {
 
-        if ((ret = (*current->c.up_met) (service)) < TRUE)
-            return (ret);
+	if ((ret = (*current->c.up_met) (service)) < TRUE)
+	    return (ret);
 
     }
 
@@ -259,84 +259,84 @@
     if (service->depend_cache == 0)
     {
 
-        /*
-         *    Check so all deps, that needs service, is up.
-         */
-        while_active_db(currentA)
-        {
-            if (currentA == service)
-                continue;
-
-            /* if current is not one that it depends on continue */
-            if (initng_depend(service, currentA) == FALSE)
-                continue;
-
-            /* If this service depends on me, it wont wait for it */
-            /* This is EXPRIMENTAL */
-            if (initng_depend(currentA, service) == TRUE)
-                continue;
-
-
-            /* if service dep on is starting, wait a bit */
-            if (IS_STARTING(currentA))
-            {
-                if (verbose)
-                {
-                    F_("Could not start service %s because it depends on service %s that is still starting.\n", service->name, currentA->name);
-                }
-                return (FALSE);
-            }
-
-            /* if service failed, return that */
-            if (IS_FAILED(currentA))
-            {
-                if (verbose)
-                {
-                    F_("Could not start service %s because it depends on service %s that is failed.\n", service->name, currentA->name);
-                }
-                return (FAIL);
-            }
-
-            /* if its marked down, and not starting, start it */
-            if (IS_DOWN(currentA))
-            {
-                initng_handler_start_service(currentA);
-                return (FALSE);
-            }
-
-            /* if its not starting or up, return FAIL */
-            if (!IS_UP(currentA))
-            {
-                F_("Could not start service %s because it depends on service %s has state %s\n", service->name, currentA->name, currentA->current_state->state_name);
-                return (FALSE);
-            }
-        }
+	/*
+	 *    Check so all deps, that needs service, is up.
+	 */
+	while_active_db(currentA)
+	{
+	    if (currentA == service)
+		continue;
+
+	    /* if current is not one that it depends on continue */
+	    if (initng_depend(service, currentA) == FALSE)
+		continue;
+
+	    /* If this service depends on me, it wont wait for it */
+	    /* This is EXPRIMENTAL */
+	    if (initng_depend(currentA, service) == TRUE)
+		continue;
+
+
+	    /* if service dep on is starting, wait a bit */
+	    if (IS_STARTING(currentA))
+	    {
+		if (verbose)
+		{
+		    F_("Could not start service %s because it depends on service %s that is still starting.\n", service->name, currentA->name);
+		}
+		return (FALSE);
+	    }
+
+	    /* if service failed, return that */
+	    if (IS_FAILED(currentA))
+	    {
+		if (verbose)
+		{
+		    F_("Could not start service %s because it depends on service %s that is failed.\n", service->name, currentA->name);
+		}
+		return (FAIL);
+	    }
+
+	    /* if its marked down, and not starting, start it */
+	    if (IS_DOWN(currentA))
+	    {
+		initng_handler_start_service(currentA);
+		return (FALSE);
+	    }
+
+	    /* if its not starting or up, return FAIL */
+	    if (!IS_UP(currentA))
+	    {
+		F_("Could not start service %s because it depends on service %s has state %s\n", service->name, currentA->name, currentA->current_state->state_name);
+		return (FALSE);
+	    }
+	}
 
-        service->depend_cache++;
+	service->depend_cache++;
     }
 
 
     /* run the global plugin dep check */
     while_list_safe(current, &g.START_DEP_MET, s)
     {
-        /* This is check number i */
-        i++;
+	/* This is check number i */
+	i++;
 
-        /* Only run this check if it has not been run before */
-        if (service->depend_cache > i)
-            continue;
-
-        if ((ret = (*current->c.start_dep_met) (service)) < TRUE)
-        {
-            if (verbose)
-            {
-                F_("Service %s can not be started because a plugin (START_DEP_MET) says so.\n", service->name);
-            }
-            return (ret);
-        }
+	/* Only run this check if it has not been run before */
+	if (service->depend_cache > i)
+	    continue;
+
+	if ((ret = (*current->c.start_dep_met) (service)) < TRUE)
+	{
+	    if (verbose)
+	    {
+		F_("Service %s can not be started because a plugin (START_DEP_MET) says so.\n", service->name);
+	    }
+	    return (ret);
+	}
 
-        /* if this succeds, count up one, so test wont be run again */
-        service->depend_cache++;
+	/* if this succeds, count up one, so test wont be run again */
+	service->depend_cache++;
     }
 
     service->depend_cache = 0;
@@ -360,76 +360,76 @@
     if (service->depend_cache == 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)
-        {
-            if (currentA == service)
-                continue;
-
-            /* Does service depends on current ?? */
-            if (initng_depend(currentA, service) == FALSE)
-                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;
-
-            /* 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);
-
-            if (IS_UP(currentA))
-                initng_handler_stop_service(currentA);
-
-            return (FALSE);
-        }
-        service->depend_cache++;
+	/*
+	 *    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)
+	{
+	    if (currentA == service)
+		continue;
+
+	    /* Does service depends on current ?? */
+	    if (initng_depend(currentA, service) == FALSE)
+		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;
+
+	    /* 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);
+
+	    if (IS_UP(currentA))
+		initng_handler_stop_service(currentA);
+
+	    return (FALSE);
+	}
+	service->depend_cache++;
     }
 
     /* run the global plugin dep check */
     while_list_safe(current, &g.STOP_DEP_MET, s)
     {
-        /* This is check number i */
-        i++;
+	/* This is check number i */
+	i++;
 
-        /* This counts how many test thats have succeded before */
-        if (service->depend_cache > i)
-            continue;
-
-        if ((ret = (*current->c.stop_dep_met) (service)) != TRUE)
-        {
-            if (verbose)
-            {
-                F_("Service %s can not be started because a plugin (START_DEP_MET) says so.\n", service->name);
-            }
-            return (FALSE);
-        }
+	/* This counts how many test thats have succeded before */
+	if (service->depend_cache > i)
+	    continue;
+
+	if ((ret = (*current->c.stop_dep_met) (service)) != TRUE)
+	{
+	    if (verbose)
+	    {
+		F_("Service %s can not be started because a plugin (START_DEP_MET) says so.\n", service->name);
+	    }
+	    return (FALSE);
+	}
 
-        /* count this check so it wont be run again */
-        service->depend_cache++;
+	/* count this check so it wont be run again */
+	service->depend_cache++;
     }
 
     service->depend_cache = 0;
@@ -453,46 +453,46 @@
 
     while ((tmp = get_next_string(&REQUIRE, service, &current)))
     {
-        /* look if it exits already */
-        if ((dep = initng_active_db_find_by_name(tmp)))
-        {
-            /* start the service if its down */
-            if (IS_DOWN(dep))
-                initng_handler_start_service(dep);
-            D_("No need to LOAD %s, it is already loaded!\n", tmp);
-            continue;
-        }
-
-        /* OKAY, start the service */
-
-        if (!initng_handler_start_new_service_named(tmp))
-        {
-            F_("%s required dep \"%s\" could not start!\n", service->name,
-               tmp);
-            initng_handler_stop_service(service);
-            return (FALSE);
-        }
+	/* look if it exits already */
+	if ((dep = initng_active_db_find_by_name(tmp)))
+	{
+	    /* start the service if its down */
+	    if (IS_DOWN(dep))
+		initng_handler_start_service(dep);
+	    D_("No need to LOAD %s, it is already loaded!\n", tmp);
+	    continue;
+	}
+
+	/* OKAY, start the service */
+
+	if (!initng_handler_start_new_service_named(tmp))
+	{
+	    F_("%s required dep \"%s\" could not start!\n", service->name,
+	       tmp);
+	    initng_handler_stop_service(service);
+	    return (FALSE);
+	}
     }
 
     current = NULL;
     while ((tmp = get_next_string(&NEED, service, &current)))
     {
-        /* look if it exits already */
-        if ((dep = initng_active_db_find_by_name(tmp)))
-        {
-            /* start service if down */
-            if (IS_DOWN(dep))
-                initng_handler_start_service(dep);
-            D_("No need to LOAD %s, it is already loaded!\n", tmp);
-            continue;
-        }
-
-        /* OKAY, start the service */
-
-        if (!initng_handler_start_new_service_named(tmp))
-        {
-            W_("service \"%s\" needs service \"%s\", that could not be found!\n", service->name, tmp);
-        }
+	/* look if it exits already */
+	if ((dep = initng_active_db_find_by_name(tmp)))
+	{
+	    /* start service if down */
+	    if (IS_DOWN(dep))
+		initng_handler_start_service(dep);
+	    D_("No need to LOAD %s, it is already loaded!\n", tmp);
+	    continue;
+	}
+
+	/* OKAY, start the service */
+
+	if (!initng_handler_start_new_service_named(tmp))
+	{
+	    W_("service \"%s\" needs service \"%s\", that could not be found!\n", service->name, tmp);
+	}
     }
 
 

Modified: initng/trunk/src/initng_env_variable.c
==============================================================================
--- initng/trunk/src/initng_env_variable.c	(original)
+++ initng/trunk/src/initng_env_variable.c	Wed Apr  5 22:57:12 2006
@@ -22,17 +22,17 @@
 #include "initng.h"
 
 /* system headers */
-#include <time.h>                           /* time() */
-#include <fcntl.h>                          /* fcntl() */
-#include <sys/un.h>                         /* memmove() strcmp() */
-#include <sys/wait.h>                       /* waitpid() sa */
-#include <linux/kd.h>                       /* KDSIGACCEPT */
-#include <sys/ioctl.h>                      /* ioctl() */
-#include <stdio.h>                          /* printf() */
-#include <stdlib.h>                         /* free() exit() */
-#include <sys/reboot.h>                     /* reboot() RB_DISABLE_CAD */
+#include <time.h>			    /* time() */
+#include <fcntl.h>			    /* fcntl() */
+#include <sys/un.h>			    /* memmove() strcmp() */
+#include <sys/wait.h>			    /* waitpid() sa */
+#include <linux/kd.h>			    /* KDSIGACCEPT */
+#include <sys/ioctl.h>			    /* ioctl() */
+#include <stdio.h>			    /* printf() */
+#include <stdlib.h>			    /* free() exit() */
+#include <sys/reboot.h>			    /* reboot() RB_DISABLE_CAD */
 #include <assert.h>
-#include <ctype.h>                          /* isgraph */
+#include <ctype.h>			    /* isgraph */
 
 /* own header */
 #include "initng_env_variable.h"
@@ -77,7 +77,7 @@
 
     /* Better safe than sorry... */
     if (s && s->name == NULL)
-        s->name = i_strdup("unknown");
+	s->name = i_strdup("unknown");
 
     /*
      * FIRST, try to figure out how big array we want to create.
@@ -87,14 +87,14 @@
     allocate = 114;
 
     /* count existing env's */
-#ifdef USE_OLD_ENV                          /* DO NOT USE - BROKEN */
+#ifdef USE_OLD_ENV			    /* DO NOT USE - BROKEN */
     while (environ[nr])
-        allocate++;
+	allocate++;
 #endif
 
     /* count ENVs in service ENV variable */
     if (s)
-        allocate += count_type(&ENV, s);
+	allocate += count_type(&ENV, s);
 
 
     /* finally allocate */
@@ -104,133 +104,133 @@
 #ifdef USE_OLD_ENV
     for (nr = 0; environ[nr] && nr < allocate; nr++)
     {
-        env[nr] = i_strdup(environ[nr]);
+	env[nr] = i_strdup(environ[nr]);
     }
 #endif
 
     /* add all static defined above in initng_environ */
     for (nr = 0; initng_environ[nr]; nr++)
     {
-        env[nr] = i_strdup(initng_environ[nr]);
+	env[nr] = i_strdup(initng_environ[nr]);
     }
 
 
     if (s && (nr + 4) < allocate)
     {
-        env[nr] = (char *) i_calloc(1, sizeof(char) * (9 + strlen(s->name)));
-        strcpy(env[nr], "SERVICE=");
-        strcat(env[nr], s->name);
-        nr++;
-
-        env[nr] = (char *) i_calloc(1, sizeof(char) * (6 + strlen(s->name)));
-        strcpy(env[nr], "NAME=");
-        strcat(env[nr], st_strip_path(s->name));
-        nr++;
-
-        env[nr] = (char *) i_calloc(1, sizeof(char) * (7 + strlen(s->name)));
-        strcpy(env[nr], "CLASS=");
-        strcat(env[nr], s->name);
-        st_strip_end(&env[nr]);
-        nr++;
-
-        if (g.dev_console)
-        {
-            env[nr] = (char *) i_calloc(1,
-                                        sizeof(char) * (9 +
-                                                        strlen(g.
-                                                               dev_console)));
-            strcpy(env[nr], "CONSOLE=");
-            strcat(env[nr], g.dev_console);
-            nr++;
-        }
-        else
-        {
-            env[nr] = (char *) i_calloc(1,
-                                        sizeof(char) * (9 +
-                                                        strlen
-                                                        (INITNG_CONSOLE)));
-            strcpy(env[nr], "CONSOLE=");
-            strcat(env[nr], INITNG_CONSOLE);
-            nr++;
-        }
-
-        if (g.runlevel && (nr + 1) < allocate)
-        {
-            env[nr] = (char *) i_calloc(1,
-                                        sizeof(char) * (10 +
-                                                        strlen(g.runlevel)));
-            strcpy(env[nr], "RUNLEVEL=");
-            strcat(env[nr], g.runlevel);
-            nr++;
-        }
-
-        if (g.old_runlevel && (nr + 1) < allocate)
-        {
-            env[nr] = (char *) i_calloc(1,
-                                        sizeof(char) * (14 +
-                                                        strlen(g.
-                                                               old_runlevel)));
-            strcpy(env[nr], "PREVLEVEL=");
-            strcat(env[nr], g.old_runlevel);
-            nr++;
-        }
-
-        env[nr] = NULL;
-        /* insert all env strings from config */
-        {
-            var = NULL;
-            s_data *tmp = NULL;
-
-            while ((nr + 1) < allocate)
-            {
-                char *fixed = NULL;
-
-                if (!(tmp = get_next(&ENV, s, tmp)))
-                    break;
-
-                fixed = fix_variables(tmp->t.s, s);
-
-                /* then malloc */
-                var = i_calloc((strlen(tmp->vn) + strlen(fixed) + 3),
-                               sizeof(char));
-                if (!var)
-                    continue;
-
-                /* copy the data */
-                strcpy(var, tmp->vn);
-                strcat(var, "=");
-                strcat(var, fixed);
-
-                /* free the fixed ones */
-                free(fixed);
-
-                /* check for duplicates */
-                for (i = 0; i < nr; i++)
-                {
-                    if (is_same_env_var(env[i], var))
-                    {
-                        /* we may want to override environemntal variables
-                           set above, particularly PATH and HOME */
-                        free(env[i]);
-                        env[i] = var;
-                        break;
-                    }
-                }
-
-                if (i == nr)
-                    env[nr++] = var;
-            }
-        }
+	env[nr] = (char *) i_calloc(1, sizeof(char) * (9 + strlen(s->name)));
+	strcpy(env[nr], "SERVICE=");
+	strcat(env[nr], s->name);
+	nr++;
+
+	env[nr] = (char *) i_calloc(1, sizeof(char) * (6 + strlen(s->name)));
+	strcpy(env[nr], "NAME=");
+	strcat(env[nr], st_strip_path(s->name));
+	nr++;
+
+	env[nr] = (char *) i_calloc(1, sizeof(char) * (7 + strlen(s->name)));
+	strcpy(env[nr], "CLASS=");
+	strcat(env[nr], s->name);
+	st_strip_end(&env[nr]);
+	nr++;
+
+	if (g.dev_console)
+	{
+	    env[nr] = (char *) i_calloc(1,
+					sizeof(char) * (9 +
+							strlen(g.
+							       dev_console)));
+	    strcpy(env[nr], "CONSOLE=");
+	    strcat(env[nr], g.dev_console);
+	    nr++;
+	}
+	else
+	{
+	    env[nr] = (char *) i_calloc(1,
+					sizeof(char) * (9 +
+							strlen
+							(INITNG_CONSOLE)));
+	    strcpy(env[nr], "CONSOLE=");
+	    strcat(env[nr], INITNG_CONSOLE);
+	    nr++;
+	}
+
+	if (g.runlevel && (nr + 1) < allocate)
+	{
+	    env[nr] = (char *) i_calloc(1,
+					sizeof(char) * (10 +
+							strlen(g.runlevel)));
+	    strcpy(env[nr], "RUNLEVEL=");
+	    strcat(env[nr], g.runlevel);
+	    nr++;
+	}
+
+	if (g.old_runlevel && (nr + 1) < allocate)
+	{
+	    env[nr] = (char *) i_calloc(1,
+					sizeof(char) * (14 +
+							strlen(g.
+							       old_runlevel)));
+	    strcpy(env[nr], "PREVLEVEL=");
+	    strcat(env[nr], g.old_runlevel);
+	    nr++;
+	}
+
+	env[nr] = NULL;
+	/* insert all env strings from config */
+	{
+	    var = NULL;
+	    s_data *tmp = NULL;
+
+	    while ((nr + 1) < allocate)
+	    {
+		char *fixed = NULL;
+
+		if (!(tmp = get_next(&ENV, s, tmp)))
+		    break;
+
+		fixed = fix_variables(tmp->t.s, s);
+
+		/* then malloc */
+		var = i_calloc((strlen(tmp->vn) + strlen(fixed) + 3),
+			       sizeof(char));
+		if (!var)
+		    continue;
+
+		/* copy the data */
+		strcpy(var, tmp->vn);
+		strcat(var, "=");
+		strcat(var, fixed);
+
+		/* free the fixed ones */
+		free(fixed);
+
+		/* check for duplicates */
+		for (i = 0; i < nr; i++)
+		{
+		    if (is_same_env_var(env[i], var))
+		    {
+			/* we may want to override environemntal variables
+			   set above, particularly PATH and HOME */
+			free(env[i]);
+			env[i] = var;
+			break;
+		    }
+		}
+
+		if (i == nr)
+		    env[nr++] = var;
+	    }
+	}
     }
 
     /* null last */
     if (env[nr] != NULL)
-        env[nr++] = NULL;
+	env[nr++] = NULL;
 
 #ifdef DEBUG
     for (nr = 0; env[nr]; nr++)
     {
-        D_("environ[%i] = \"%s\"\n", nr, env[nr]);
+	D_("environ[%i] = \"%s\"\n", nr, env[nr]);
     }
 #endif
 
@@ -249,7 +249,7 @@
     assert(tf);
     for (i = 0; tf[i]; tf++)
     {
-        free(tf[i]);
+	free(tf[i]);
     }
     free(tf);
 }
@@ -259,21 +259,21 @@
     int i = 0;
 
     if (!var1 || !var2)
-        return 0;                           /* bad error checking in caller! */
+	return 0;			    /* bad error checking in caller! */
 
     for (i = 0; var1[i] && var2[i] && var1[i] != '=' && var1[i] == var2[i];
-         i++)
-        ;
+	 i++)
+	;
 
     return var1[i] == var2[i];
 }
 
 /* Handles redefinitions like "env FOO = $FOO bar" */
 char *fix_redefined_variable(const char *name, const char *oldval,
-                             const char *newdef)
+			     const char *newdef)
 {
-    char *to;                   /* this is the pointer we are going to return */
-    char *set;                  /* pointer to step */
+    char *to;			/* this is the pointer we are going to return */
+    char *set;			/* pointer to step */
 
     assert(name);
     assert(oldval);
@@ -281,79 +281,79 @@
 
     /* make sure we got any data */
     if (!newdef)
-        return (NULL);
+	return (NULL);
 
     /* allocate that much memory that we think we need */
     /* TODO, add checks that this value is never overridden */
     to = (char *) i_calloc((strlen(newdef) + 150), sizeof(char));
     if (!to)
-        return (NULL);
+	return (NULL);
 
     set = to;
     /* while there is data to parse */
     while (newdef[0])
     {
-        int len = 0;
+	int len = 0;
 
-        /*
-         * if its not containing the magical char loop, just copy the
-         * char and continue the main loop.
-         */
-        if (newdef[0] != '$')
-        {
-            set[0] = newdef[0];
-            newdef++;
-            set++;
-            set[0] = '\0';
-            continue;
-        }
-
-
-        /* jump the '$' char */
-        newdef++;
-        if (!newdef[0])
-            continue;
-
-        /*
-         * Calculate length of variable ${VARIABLE}.
-         */
-        if (newdef[0] == '{')               /* if this is a ${VARIABLE} */
-        {
-            newdef++;
-            for (; newdef[len] && newdef[len] != '}'; len++) ;
-        }
-        else                                /* else a $VARIABLE */
-        {
-            for (; isgraph(newdef[len]); len++) ;
-        }
-
-        if (strncasecmp(newdef, name, len) == 0 && (int) strlen(name) == len)
-        {
-            strcpy(set, oldval);
-            /* go forward */
-            newdef += len;
-            if (newdef[0] == '}')
-                newdef++;
-            while (set[0])
-                set++;
-        }
-        else
-        {
-            if (newdef[-1] == '{')
-            {
-                strncpy(set, newdef - 2, len + 2);
-                newdef += len;
-                set += len + 2;
-                set[0] = '\0';
-            }
-            else
-            {
-                strncpy(set, newdef - 1, len + 1);
-                newdef += len;
-                set += len + 1;
-                set[0] = '\0';
-            }
-        }
+	/*
+	 * if its not containing the magical char loop, just copy the
+	 * char and continue the main loop.
+	 */
+	if (newdef[0] != '$')
+	{
+	    set[0] = newdef[0];
+	    newdef++;
+	    set++;
+	    set[0] = '\0';
+	    continue;
+	}
+
+
+	/* jump the '$' char */
+	newdef++;
+	if (!newdef[0])
+	    continue;
+
+	/*
+	 * Calculate length of variable ${VARIABLE}.
+	 */
+	if (newdef[0] == '{')		    /* if this is a ${VARIABLE} */
+	{
+	    newdef++;
+	    for (; newdef[len] && newdef[len] != '}'; len++) ;
+	}
+	else				    /* else a $VARIABLE */
+	{
+	    for (; isgraph(newdef[len]); len++) ;
+	}
+
+	if (strncasecmp(newdef, name, len) == 0 && (int) strlen(name) == len)
+	{
+	    strcpy(set, oldval);
+	    /* go forward */
+	    newdef += len;
+	    if (newdef[0] == '}')
+		newdef++;
+	    while (set[0])
+		set++;
+	}
+	else
+	{
+	    if (newdef[-1] == '{')
+	    {
+		strncpy(set, newdef - 2, len + 2);
+		newdef += len;
+		set += len + 2;
+		set[0] = '\0';
+	    }
+	    else
+	    {
+		strncpy(set, newdef - 1, len + 1);
+		newdef += len;
+		set += len + 1;
+		set[0] = '\0';
+	    }
+	}
     }
 
     /* make sure end is terminated */
@@ -369,216 +369,216 @@
  */
 char *fix_variables(const char *from, active_db_h * s)
 {
-    char *to;                   /* this is the pointer we are going to return */
-    char *set;                  /* pointer to step */
-    int i;                      /* temporary counter */
+    char *to;			/* this is the pointer we are going to return */
+    char *set;			/* pointer to step */
+    int i;			/* temporary counter */
 
     assert(s);
     assert(s->name);
 
     /* make sure we got any data */
     if (!from)
-        return (NULL);
+	return (NULL);
 
     /* allocate that much memory that we think we need */
     /* TODO, add checks that this value is never overridden */
     to = (char *) i_calloc((strlen(from) + 150), sizeof(char));
     if (!to)
-        return (NULL);
+	return (NULL);
 
     set = to;
     /* while there is data to parse */
     while (from[0])
     {
-        int len = 0;
+	int len = 0;
 
-        /*
-         * if its not containing the magical char loop, just copy the
-         * char and continue the main loop.
-         */
-        if (from[0] != '$')
-        {
-            set[0] = from[0];
-            from++;
-            set++;
-            set[0] = '\0';
-            continue;
-        }
-
-
-        /* jump the '$' char */
-        from++;
-        if (!from[0])
-            continue;
-
-        /*
-         * Calculate length of variable ${VARIABLE}.
-         */
-        if (from[0] == '{')                 /* if this is a ${VARIABLE} */
-        {
-            from++;
-            for (; from[len] && from[len] != '}'; len++) ;
-        }
-        else                                /* else a $VARIABLE */
-        {
-            for (; isgraph(from[len]); len++) ;
-        }
-
-        /*
-         * Start comparing keywords.
-         */
-
-        if (strncasecmp(from, "NAME", len) == 0)
-        {
-            const char *tmp = NULL;
-
-            if ((tmp = st_strip_path(s->name)))
-            {
-                strcpy(set, tmp);
-                goto go_forward;
-            }
-        }
-
-        if (strncasecmp(from, "SERVICE", len) == 0)
-        {
-            strcpy(set, s->name);
-            goto go_forward;
-        }
-
-        if (strncasecmp(from, "CLASS", len) == 0)
-        {
-            char *tmp = NULL;
-
-            if ((tmp = st_get_path(s->name)))
-            {
-                strcpy(set, tmp);
-                free(tmp);
-            }
-            goto go_forward;
-        }
-
-        if (g.runlevel && strncasecmp(from, "CONSOLE", len) == 0)
-        {
-            if (g.dev_console)
-                strcpy(set, g.dev_console);
-            else
-                strcpy(set, INITNG_CONSOLE);
-
-            goto go_forward;
-        }
-
-        if (g.runlevel && strncasecmp(from, "RUNLEVEL", len) == 0)
-        {
-            strcpy(set, g.runlevel);
-            goto go_forward;
-        }
-
-        if (g.runlevel && strncasecmp(from, "PREVLEVEL", len) == 0)
-        {
-            strcpy(set, g.old_runlevel);
-            goto go_forward;
-        }
-
-        /* Fetch variable from initng_environ */
-        for (i = 0; initng_environ[i]; i++)
-        {
-            if (strncasecmp(from, initng_environ[i], len) == 0
-                && initng_environ[i][len] == '=')
-            {
-                strcpy(set, &initng_environ[i][len + 1]);
-                goto go_forward;
-            }
-        }
-
-        {
-            s_data *tmp = NULL;
-
-            while ((tmp = get_next(&ENV, s, tmp)))
-            {
-                if (strncasecmp(from, tmp->vn, len) == 0 && tmp->vn[len] == 0)
-                {
-                    strcpy(set, tmp->t.s);
-                    goto go_forward;
-                }
-            }
-        }
-
-        /* Get the variable from the data set on an initng_variable */
-        {
-            s_entry *entry = NULL;
-
-            /* Copy the string, so that we can put an '\0' on the end */
-            char *tmp = i_strndup(from, len);
-
-            if (!tmp)
-                goto print_error;
-
-            /* search if a initng variable exits with that name */
-            entry = initng_service_data_types_find(tmp);
-
-            /* free the duped one */
-            free(tmp);
-
-            /* if we got an entry, and if the entry exits in this service */
-            if (entry && is(entry, s))
-            {
-                /* Handle differently with different types */
-                switch (entry->opt_type)
-                {
-                        /* if it is a string, just strcpy in it */
-                    case STRING:
-                        {
-                            strcpy(set, get_string(entry, s));
-                            goto go_forward;
-                        }
-                    case STRINGS:
-                        {
-                            const char *tmp2 = NULL;
-                            s_data *itterator = NULL;
-
-                            while ((tmp2 =
-                                    get_next_string(entry, s, &itterator)))
-                            {
-                                strcat(set, tmp2);
-                                strcat(set, " ");
-                            }
-                            if (tmp2)
-                                goto go_forward;
-                        }
-                        /* if it is an integer, sprintf in it */
-                    case INT:
-                        {
-                            sprintf(set, "%i", get_int(entry, s));
-                            goto go_forward;
-                        }
-                    default:
-                        {
-                            D_("Don't know how to set a variable with %s:%i\n", entry->opt_name, entry->opt_type);
-                            break;
-                        }
-                }
-            }
-        }
+	/*
+	 * if its not containing the magical char loop, just copy the
+	 * char and continue the main loop.
+	 */
+	if (from[0] != '$')
+	{
+	    set[0] = from[0];
+	    from++;
+	    set++;
+	    set[0] = '\0';
+	    continue;
+	}
+
+
+	/* jump the '$' char */
+	from++;
+	if (!from[0])
+	    continue;
+
+	/*
+	 * Calculate length of variable ${VARIABLE}.
+	 */
+	if (from[0] == '{')		    /* if this is a ${VARIABLE} */
+	{
+	    from++;
+	    for (; from[len] && from[len] != '}'; len++) ;
+	}
+	else				    /* else a $VARIABLE */
+	{
+	    for (; isgraph(from[len]); len++) ;
+	}
+
+	/*
+	 * Start comparing keywords.
+	 */
+
+	if (strncasecmp(from, "NAME", len) == 0)
+	{
+	    const char *tmp = NULL;
+
+	    if ((tmp = st_strip_path(s->name)))
+	    {
+		strcpy(set, tmp);
+		goto go_forward;
+	    }
+	}
+
+	if (strncasecmp(from, "SERVICE", len) == 0)
+	{
+	    strcpy(set, s->name);
+	    goto go_forward;
+	}
+
+	if (strncasecmp(from, "CLASS", len) == 0)
+	{
+	    char *tmp = NULL;
+
+	    if ((tmp = st_get_path(s->name)))
+	    {
+		strcpy(set, tmp);
+		free(tmp);
+	    }
+	    goto go_forward;
+	}
+
+	if (g.runlevel && strncasecmp(from, "CONSOLE", len) == 0)
+	{
+	    if (g.dev_console)
+		strcpy(set, g.dev_console);
+	    else
+		strcpy(set, INITNG_CONSOLE);
+
+	    goto go_forward;
+	}
+
+	if (g.runlevel && strncasecmp(from, "RUNLEVEL", len) == 0)
+	{
+	    strcpy(set, g.runlevel);
+	    goto go_forward;
+	}
+
+	if (g.runlevel && strncasecmp(from, "PREVLEVEL", len) == 0)
+	{
+	    strcpy(set, g.old_runlevel);
+	    goto go_forward;
+	}
+
+	/* Fetch variable from initng_environ */
+	for (i = 0; initng_environ[i]; i++)
+	{
+	    if (strncasecmp(from, initng_environ[i], len) == 0
+		&& initng_environ[i][len] == '=')
+	    {
+		strcpy(set, &initng_environ[i][len + 1]);
+		goto go_forward;
+	    }
+	}
+
+	{
+	    s_data *tmp = NULL;
+
+	    while ((tmp = get_next(&ENV, s, tmp)))
+	    {
+		if (strncasecmp(from, tmp->vn, len) == 0 && tmp->vn[len] == 0)
+		{
+		    strcpy(set, tmp->t.s);
+		    goto go_forward;
+		}
+	    }
+	}
+
+	/* Get the variable from the data set on an initng_variable */
+	{
+	    s_entry *entry = NULL;
+
+	    /* Copy the string, so that we can put an '\0' on the end */
+	    char *tmp = i_strndup(from, len);
+
+	    if (!tmp)
+		goto print_error;
+
+	    /* search if a initng variable exits with that name */
+	    entry = initng_service_data_types_find(tmp);
+
+	    /* free the duped one */
+	    free(tmp);
+
+	    /* if we got an entry, and if the entry exits in this service */
+	    if (entry && is(entry, s))
+	    {
+		/* Handle differently with different types */
+		switch (entry->opt_type)
+		{
+			/* if it is a string, just strcpy in it */
+		    case STRING:
+			{
+			    strcpy(set, get_string(entry, s));
+			    goto go_forward;
+			}
+		    case STRINGS:
+			{
+			    const char *tmp2 = NULL;
+			    s_data *itterator = NULL;
+
+			    while ((tmp2 =
+				    get_next_string(entry, s, &itterator)))
+			    {
+				strcat(set, tmp2);
+				strcat(set, " ");
+			    }
+			    if (tmp2)
+				goto go_forward;
+			}
+			/* if it is an integer, sprintf in it */
+		    case INT:
+			{
+			    sprintf(set, "%i", get_int(entry, s));
+			    goto go_forward;
+			}
+		    default:
+			{
+			    D_("Don't know how to set a variable with %s:%i\n", entry->opt_name, entry->opt_type);
+			    break;
+			}
+		}
+	    }
+	}
 
 
       print_error:
-        /* Print a fancy error message */
-        {
-            char *tmp = strndup(from, len);
-
-            W_("Service %s Unset variable ${%s}!\n", s->name, tmp);
-            free(tmp);
-        }
-        /* this will set the value to nothing */
-        set[0] = '\0';
+	/* Print a fancy error message */
+	{
+	    char *tmp = strndup(from, len);
+
+	    W_("Service %s Unset variable ${%s}!\n", s->name, tmp);
+	    free(tmp);
+	}
+	/* this will set the value to nothing */
+	set[0] = '\0';
 
       go_forward:
-        /* go forward */
-        from += len;
-        if (from[0] == '}')
-            from++;
-        while (set[0])
-            set++;
+	/* go forward */
+	from += len;
+	if (from[0] == '}')
+	    from++;
+	while (set[0])
+	    set++;
 
     }
 

Modified: initng/trunk/src/initng_env_variable.h
==============================================================================
--- initng/trunk/src/initng_env_variable.h	(original)
+++ initng/trunk/src/initng_env_variable.h	Wed Apr  5 22:57:12 2006
@@ -25,7 +25,7 @@
 #include "initng_active_db.h"
 
 char *fix_redefined_variable(const char *name, const char *oldval,
-                             const char *newdef);
+			     const char *newdef);
 char *fix_variables(const char *from, active_db_h * s);
 char **new_environ(active_db_h * s);
 void free_environ(char **tf);

Modified: initng/trunk/src/initng_error.c
==============================================================================
--- initng/trunk/src/initng_error.c	(original)
+++ initng/trunk/src/initng_error.c	Wed Apr  5 22:57:12 2006
@@ -21,7 +21,7 @@
 #include "initng.h"
 
 #define _GNU_SOURCE
-#include <stdlib.h>                         /* free() exit() */
+#include <stdlib.h>			    /* free() exit() */
 #include <stdio.h>
 #include <unistd.h>
 #include <string.h>
@@ -37,8 +37,8 @@
 int lock_error_printing = 0;
 
 static void initng_failsafe_print_error(e_mt mt, const char *file,
-                                        const char *func, int line,
-                                        const char *format, va_list arg)
+					const char *func, int line,
+					const char *format, va_list arg)
 {
     struct tm *ts;
     time_t t;
@@ -49,24 +49,24 @@
 
     switch (mt)
     {
-        case MSG_FAIL:
-            if (file && func)
-                fprintf(stderr,
-                        "\n\n FAILSAFE ERROR ** \"%s\", %s() line %i:\n",
-                        file, func, line);
-            fprintf(stderr, " %.2i:%.2i:%.2i -- FAIL:\t", ts->tm_hour,
-                    ts->tm_min, ts->tm_sec);
-            break;
-        case MSG_WARN:
-            if (file && func)
-                fprintf(stderr,
-                        "\n\n FAILSAFE ERROR ** \"%s\", %s() line %i:\n",
-                        file, func, line);
-            fprintf(stderr, " %.2i:%.2i:%.2i -- WARN:\t", ts->tm_hour,
-                    ts->tm_min, ts->tm_sec);
-            break;
-        default:
-            break;
+	case MSG_FAIL:
+	    if (file && func)
+		fprintf(stderr,
+			"\n\n FAILSAFE ERROR ** \"%s\", %s() line %i:\n",
+			file, func, line);
+	    fprintf(stderr, " %.2i:%.2i:%.2i -- FAIL:\t", ts->tm_hour,
+		    ts->tm_min, ts->tm_sec);
+	    break;
+	case MSG_WARN:
+	    if (file && func)
+		fprintf(stderr,
+			"\n\n FAILSAFE ERROR ** \"%s\", %s() line %i:\n",
+			file, func, line);
+	    fprintf(stderr, " %.2i:%.2i:%.2i -- WARN:\t", ts->tm_hour,
+		    ts->tm_min, ts->tm_sec);
+	    break;
+	default:
+	    break;
     }
 
     vfprintf(stderr, format, arg);
@@ -74,7 +74,7 @@
 }
 
 int initng_error_print(e_mt mt, const char *file, const char *func, int line,
-                       const char *format, ...)
+		       const char *format, ...)
 {
     assert(file);
     assert(func);
@@ -86,7 +86,7 @@
 
     /* This lock is to make sure we don't get into an endless print loop */
     if (lock_error_printing == 1)
-        return (0);
+	return (0);
 
     /* put the lock, to avoid a circular bug */
     lock_error_printing = 1;
@@ -97,26 +97,26 @@
     /* check for hooks */
     while_list(current, &g.ERR_MSG)
     {
-        va_list pass;
+	va_list pass;
 
-        va_copy(pass, arg);
+	va_copy(pass, arg);
 
-        if ((*current->c.err) (mt, file, func, line, format, pass) == TRUE)
-            delivered = TRUE;
+	if ((*current->c.err) (mt, file, func, line, format, pass) == TRUE)
+	    delivered = TRUE;
 
-        va_end(pass);
+	va_end(pass);
     }
 
     /* Print on failsafe if no hook is to listen. */
     if (delivered != TRUE)
     {
-        va_list pass;
+	va_list pass;
 
-        va_copy(pass, arg);
+	va_copy(pass, arg);
 
-        initng_failsafe_print_error(mt, file, func, line, format, pass);
+	initng_failsafe_print_error(mt, file, func, line, format, pass);
 
-        va_end(pass);
+	va_end(pass);
     }
 
     va_end(arg);
@@ -141,12 +141,12 @@
     int i;
 
     if (lock_error_printing == 1)
-        return;
+	return;
 
     W_("This words will i look for in debug: \n");
     for (i = 0; i < MAX_VERBOSES; i++)
-        if (g.verbose_this[i])
-            W_("  * \"%s\"\n", g.verbose_this[i]);
+	if (g.verbose_this[i])
+	    W_("  * \"%s\"\n", g.verbose_this[i]);
 }
 
 int initng_error_verbose_add(const char *string)
@@ -154,18 +154,18 @@
     int i = 0;
 
     if (g.verbose == 1)
-        g.verbose = 3;
+	g.verbose = 3;
     else
-        g.verbose = 2;
+	g.verbose = 2;
 
 
     while (g.verbose_this[i] && i < MAX_VERBOSES)
-        i++;
+	i++;
 
     if (i >= MAX_VERBOSES - 1)
     {
-        F_("Can't add another \"%s\" debug trace\n", string);
-        return (FALSE);
+	F_("Can't add another \"%s\" debug trace\n", string);
+	return (FALSE);
     }
 
     g.verbose_this[i] = i_strdup(string);
@@ -173,7 +173,7 @@
     initng_verbose_print();
 
     if (g.verbose_this[i])
-        return (TRUE);
+	return (TRUE);
     return (FALSE);
 }
 
@@ -183,12 +183,12 @@
     int t = FALSE;
 
     for (i = 0; i < MAX_VERBOSES; i++)
-        if (g.verbose_this[i] && strcasecmp(g.verbose_this[i], string) == 0)
-        {
-            free(g.verbose_this[i]);
-            g.verbose_this[i] = NULL;
-            t = TRUE;
-        }
+	if (g.verbose_this[i] && strcasecmp(g.verbose_this[i], string) == 0)
+	{
+	    free(g.verbose_this[i]);
+	    g.verbose_this[i] = NULL;
+	    t = TRUE;
+	}
     initng_verbose_print();
     return (t);
 }
@@ -198,46 +198,46 @@
     int i = 0;
 
     if (lock_error_printing == 1)
-        return;
+	return;
     lock_error_printing = 1;
 
     if (g.verbose == 2 || g.verbose == 3)
     {
-        for (i = 0; i < MAX_VERBOSES; i++)
-        {
-            if (g.verbose_this[i])
-            {
-                if (g.verbose_this[i][0] == '%' && (g.verbose_this[i] + 1))
-                {
-                    if (strcasestr(file, (g.verbose_this[i]) + 1) ||
-                        strcasestr(func, (g.verbose_this[i]) + 1))
-                    {
-                        lock_error_printing = 0;
-                        return;
-                    }
-                }
-                else
-                {
-                    if (strcasestr(file, g.verbose_this[i]) ||
-                        strcasestr(func, g.verbose_this[i]))
-                    {
-                        i = 1;
-                        break;
-                    }
-                }
-            }
-        }
+	for (i = 0; i < MAX_VERBOSES; i++)
+	{
+	    if (g.verbose_this[i])
+	    {
+		if (g.verbose_this[i][0] == '%' && (g.verbose_this[i] + 1))
+		{
+		    if (strcasestr(file, (g.verbose_this[i]) + 1) ||
+			strcasestr(func, (g.verbose_this[i]) + 1))
+		    {
+			lock_error_printing = 0;
+			return;
+		    }
+		}
+		else
+		{
+		    if (strcasestr(file, g.verbose_this[i]) ||
+			strcasestr(func, g.verbose_this[i]))
+		    {
+			i = 1;
+			break;
+		    }
+		}
+	    }
+	}
     }
 
     if (g.verbose == 1 || i == 1)
     {
-        if (last_file != file || last_func != func)
-        {
-            fprintf(stderr, "\n\n ** \"%s\", %s():\n", file, func);
-        }
+	if (last_file != file || last_func != func)
+	{
+	    fprintf(stderr, "\n\n ** \"%s\", %s():\n", file, func);
+	}
 
-        last_file = file;
-        last_func = func;
+	last_file = file;
+	last_func = func;
     }
 
     lock_error_printing = 0;
@@ -249,7 +249,7 @@
 
 
 int initng_error_print_debug(const char *file, const char *func, int line,
-                             const char *format, ...)
+			     const char *format, ...)
 {
     int done;
     struct tm *ts;
@@ -261,39 +261,39 @@
     assert(func);
 
     if (lock_error_printing == 1)
-        return (0);
+	return (0);
     lock_error_printing = 1;
 
 
 
     if (g.verbose == 1)
-        goto yes;
+	goto yes;
 
     if (g.verbose == 2 || g.verbose == 3)
-        for (i = 0; i < MAX_VERBOSES; i++)
-            if (g.verbose_this[i])
-            {
-                if (g.verbose_this[i][0] == '%' && (g.verbose_this[i] + 1))
-                {
-                    if (strcasestr(file, (g.verbose_this[i]) + 1) ||
-                        strcasestr(func, (g.verbose_this[i]) + 1))
-                    {
-                        lock_error_printing = 0;
-                        return (TRUE);
-                    }
-                }
-                else
-                {
-                    if (strcasestr(file, g.verbose_this[i]) ||
-                        strcasestr(func, g.verbose_this[i]))
-                    {
-                        goto yes;
-                    }
-                }
-            }
+	for (i = 0; i < MAX_VERBOSES; i++)
+	    if (g.verbose_this[i])
+	    {
+		if (g.verbose_this[i][0] == '%' && (g.verbose_this[i] + 1))
+		{
+		    if (strcasestr(file, (g.verbose_this[i]) + 1) ||
+			strcasestr(func, (g.verbose_this[i]) + 1))
+		    {
+			lock_error_printing = 0;
+			return (TRUE);
+		    }
+		}
+		else
+		{
+		    if (strcasestr(file, g.verbose_this[i]) ||
+			strcasestr(func, g.verbose_this[i]))
+		    {
+			goto yes;
+		    }
+		}
+	    }
 
     if (g.verbose == 3)
-        goto yes;
+	goto yes;
     /* else */
 
     lock_error_printing = 0;
@@ -304,7 +304,7 @@
     /* print the function name, if not set */
     if (last_file != file || last_func != func)
     {
-        fprintf(stderr, "\n\n ** \"%s\", %s():\n", file, func);
+	fprintf(stderr, "\n\n ** \"%s\", %s():\n", file, func);
     }
 
     last_file = file;
@@ -312,7 +312,7 @@
 
     if (g.i_am_init && getpid() != 1)
     {
-        fprintf(stderr, " NON_INIT: ");
+	fprintf(stderr, " NON_INIT: ");
     }
 
     /* Don't fetch time, until we know we wanna print on screen */
@@ -321,13 +321,13 @@
 
 
     fprintf(stderr, " %.2i:%.2i:%.2i -- line:%i\t", ts->tm_hour,
-            ts->tm_min, ts->tm_sec, line);
+	    ts->tm_min, ts->tm_sec, line);
 
     msgs++;
     if (msgs > 20)
     {
-        sleep(0.5);
-        msgs = 0;
+	sleep(0.5);
+	msgs = 0;
     }
 
     va_list arg;

Modified: initng/trunk/src/initng_error.h
==============================================================================
--- initng/trunk/src/initng_error.h	(original)
+++ initng/trunk/src/initng_error.h	Wed Apr  5 22:57:12 2006
@@ -27,12 +27,12 @@
 int initng_error_verbose_add(const char *string);
 int initng_error_verbose_del(const char *string);
 int initng_error_print_debug(const char *file, const char *func, int line,
-                             const char *format, ...);
+			     const char *format, ...);
 
 #endif
 
 int initng_error_print(e_mt mt, const char *file, const char *func, int line,
-                       const char *format, ...);
+		       const char *format, ...);
 
 void initng_error_print_func(const char *file, const char *func);
 #endif

Modified: initng/trunk/src/initng_execute.c
==============================================================================
--- initng/trunk/src/initng_execute.c	(original)
+++ initng/trunk/src/initng_execute.c	Wed Apr  5 22:57:12 2006
@@ -20,12 +20,12 @@
 
 #include "initng.h"
 
-#include <time.h>                           /* time() */
-#include <fcntl.h>                          /* fcntl() */
-#include <unistd.h>                         /* execv() pipe() usleep() pause() chown() */
-#include <sys/wait.h>                       /* waitpid() sa */
-#include <sys/ioctl.h>                      /* ioctl() */
-#include <stdlib.h>                         /* free() exit() */
+#include <time.h>			    /* time() */
+#include <fcntl.h>			    /* fcntl() */
+#include <unistd.h>			    /* execv() pipe() usleep() pause() chown() */
+#include <sys/wait.h>			    /* waitpid() sa */
+#include <sys/ioctl.h>			    /* ioctl() */
+#include <stdlib.h>			    /* free() exit() */
 #include <stdio.h>
 #include <string.h>
 #include <assert.h>
@@ -35,7 +35,7 @@
 #include "initng_global.h"
 #include "initng_process_db.h"
 #include "main.h"
-#include "initng_string_tools.h"            /* split() */
+#include "initng_string_tools.h"	    /* split() */
 #include "initng_execute.h"
 #include "initng_active_db.h"
 #include "initng_plugin_callers.h"
@@ -59,18 +59,18 @@
     process = initng_process_db_get(type, service);
     if (process != NULL)
     {
-        F_("There exists an \"%s\" process in \"%s\" already.\n",
-           process->pt->name, service->name);
-        /*assert(NULL); */
-        return (FALSE);
+	F_("There exists an \"%s\" process in \"%s\" already.\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_("(%s): unable to allocate start_process!\n", service->name);
-        return (FALSE);
+	F_("(%s): unable to allocate start_process!\n", service->name);
+	return (FALSE);
     }
 
     /* add the process to our service */
@@ -79,26 +79,26 @@
     /* walk the db with hooks */
     while_list_safe(current, &g.LAUNCH, q)
     {
-        /* call the start */
-        ret = (*current->c.launch) (service, process);
+	/* call the start */
+	ret = (*current->c.launch) (service, process);
 
-        /* if launch succeeded */
-        if (ret >= TRUE)
-            return (TRUE);
-
-        /* if that launcher did not get any to launch, take next launcher */
-        if (ret == FALSE)
-            continue;
-        if (ret < FALSE)
-            break;
+	/* if launch succeeded */
+	if (ret >= TRUE)
+	    return (TRUE);
+
+	/* if that launcher did not get any to launch, take next launcher */
+	if (ret == FALSE)
+	    continue;
+	if (ret < FALSE)
+	    break;
     }
 
-    if (ret < FALSE)                        /* ret == FAIL */
-        F_("initng_execute(%s): FAILED LAUNCHING, returned FAIL\n",
-           service->name);
+    if (ret < FALSE)			    /* ret == FAIL */
+	F_("initng_execute(%s): FAILED LAUNCHING, returned FAIL\n",
+	   service->name);
     else
-        D_("initng_execute(%s): FAILED LAUNCHING, noting font to launch.\n",
-           service->name);
+	D_("initng_execute(%s): FAILED LAUNCHING, noting font to launch.\n",
+	   service->name);
 
     /* on failure remove the process from list, and free it */
     list_del(&process->list);

Modified: initng/trunk/src/initng_fd.c
==============================================================================
--- initng/trunk/src/initng_fd.c	(original)
+++ initng/trunk/src/initng_fd.c	Wed Apr  5 22:57:12 2006
@@ -24,7 +24,7 @@
 #include <assert.h>
 #include <errno.h>
 #include <string.h>
-#include <fcntl.h>                          /* fcntl() */
+#include <fcntl.h>			    /* fcntl() */
 #include "initng.h"
 #include "initng_global.h"
 #include "initng_service_cache.h"
@@ -45,12 +45,12 @@
 
     while_list_safe(current, &g.FDWATCHERS, safe)
     {
-        close(current->c.fdh->fds);
-        list_del(&current->list);
+	close(current->c.fdh->fds);
+	list_del(&current->list);
 
-        if (current->from_file)
-            free(current->from_file);
-        free(current);
+	if (current->from_file)
+	    free(current->from_file);
+	free(current);
     }
 }
 
@@ -61,7 +61,7 @@
  * be printed to screen anyway.
  */
 static void initng_fd_plugin_readpipe(active_db_h * service,
-                                      process_h * process, char *buffer_pos)
+				      process_h * process, char *buffer_pos)
 {
     s_call *current = NULL;
     int delivered = FALSE;
@@ -71,20 +71,20 @@
 
     while_list(current, &g.PIPEWATCHERS)
     {
-        D_("Calling pipewatcher plugin.\n");
-        if ((*current->c.pipewatcher) (service, process, buffer_pos) == TRUE)
-            delivered = TRUE;
+	D_("Calling pipewatcher plugin.\n");
+	if ((*current->c.pipewatcher) (service, process, buffer_pos) == TRUE)
+	    delivered = TRUE;
 #ifdef DEBUG
-        else
-        {
-            D_("plugin %s returned FALSE\n", current->from_file);
-        }
+	else
+	{
+	    D_("plugin %s returned FALSE\n", current->from_file);
+	}
 #endif
     }
 
     /* make sure someone handled this */
     if (delivered != TRUE)
-        fprintf(stdout, "%s", buffer_pos);
+	fprintf(stdout, "%s", buffer_pos);
 }
 
 
@@ -104,8 +104,8 @@
 
     if (p->out_pipe[0] <= 0)
     {
-        F_("FIFO, can't be read! NOT OPEN!\n");
-        return;
+	F_("FIFO, can't be read! NOT OPEN!\n");
+	return;
     }
 
     /* INITZIATE
@@ -114,68 +114,68 @@
      */
     if (p->buffer)
     {
-        /* get the length of current data in buffer */
-        old_content_offset = strlen(p->buffer);
+	/* get the length of current data in buffer */
+	old_content_offset = strlen(p->buffer);
     }
     else
     {
-        /* initziate buffer fnctl */
-        int fd_flags;
+	/* initziate buffer fnctl */
+	int fd_flags;
 
-        fd_flags = fcntl(p->out_pipe[0], F_GETFL, 0);
-        fcntl(p->out_pipe[0], F_SETFL, fd_flags | O_NONBLOCK);
+	fd_flags = fcntl(p->out_pipe[0], F_GETFL, 0);
+	fcntl(p->out_pipe[0], F_SETFL, fd_flags | O_NONBLOCK);
     }
 
     /* read data from process, and continue again after a interrupt */
     do
     {
-        errno = 0;
+	errno = 0;
 
-        /* OBSERVE, i_realloc may change the path to the data, so dont set buffer_pos to early */
+	/* OBSERVE, i_realloc may change the path to the data, so dont set buffer_pos to early */
 
-        /* Make sure there is room for 100 more chars */
-        D_("left: %i > %i\n", old_content_offset + chars_read + 100,
-           p->buffer_allocated);
-        if (old_content_offset + chars_read + 100 > p->buffer_allocated)
-        {
-            /* do a realloc */
-            D_("Changing size of buffer %p to: %i\n", p->buffer,
-               p->buffer_allocated + 100 + 1);
-            char *tmp = i_realloc(p->buffer,
-                                  (p->buffer_allocated + 100 +
-                                   1) * sizeof(char));
-
-            /* make sure realloc suceeded */
-            if (tmp)
-            {
-                D_("p->buffer changes from %p to %p.\n", p->buffer, tmp);
-                p->buffer = tmp;
-                p->buffer_allocated += 100;
-            }
-            else
-            {
-                F_("realloc failed, possibly out of memory!\n");
-                return;
-            }
-        }
-
-        /* set read_pos to buffer + chars of old content + chars read so far */
-        read_pos = p->buffer + old_content_offset + chars_read;
-
-        /* read the data */
-        D_("Reading 100 chars.\n");
-        read_ret = read(p->out_pipe[0], read_pos, 100);
-
-        D_("read_ret = %i\n", read_ret);
-        /* make sure read does not return -1 */
-        if (read_ret <= 0)
-            break;
+	/* Make sure there is room for 100 more chars */
+	D_("left: %i > %i\n", old_content_offset + chars_read + 100,
+	   p->buffer_allocated);
+	if (old_content_offset + chars_read + 100 > p->buffer_allocated)
+	{
+	    /* do a realloc */
+	    D_("Changing size of buffer %p to: %i\n", p->buffer,
+	       p->buffer_allocated + 100 + 1);
+	    char *tmp = i_realloc(p->buffer,
+				  (p->buffer_allocated + 100 +
+				   1) * sizeof(char));
+
+	    /* make sure realloc suceeded */
+	    if (tmp)
+	    {
+		D_("p->buffer changes from %p to %p.\n", p->buffer, tmp);
+		p->buffer = tmp;
+		p->buffer_allocated += 100;
+	    }
+	    else
+	    {
+		F_("realloc failed, possibly out of memory!\n");
+		return;
+	    }
+	}
+
+	/* set read_pos to buffer + chars of old content + chars read so far */
+	read_pos = p->buffer + old_content_offset + chars_read;
+
+	/* read the data */
+	D_("Reading 100 chars.\n");
+	read_ret = read(p->out_pipe[0], read_pos, 100);
+
+	D_("read_ret = %i\n", read_ret);
+	/* make sure read does not return -1 */
+	if (read_ret <= 0)
+	    break;
 
-        /* make sure its nulled at end */
-        read_pos[read_ret] = '\0';
+	/* make sure its nulled at end */
+	read_pos[read_ret] = '\0';
 
-        /* increase read_pos */
-        chars_read += read_ret;
+	/* increase read_pos */
+	chars_read += read_ret;
     }
     /* if read_ret == 100, it migit be more to read, or it got interrupted. */
     while (read_ret >= 100 || errno == EINTR);
@@ -183,47 +183,47 @@
     /* make sure there is any */
     if (chars_read > 0)
     {
-        /* let all plugin take part of data */
-        initng_fd_plugin_readpipe(service, p, p->buffer + old_content_offset);
+	/* let all plugin take part of data */
+	initng_fd_plugin_readpipe(service, p, p->buffer + old_content_offset);
     }
 
     /* if EOF close pipes */
     if (read_ret == 0)
     {
-        D_("Closing fifos for %s.\n", service->name);
-        if (p->out_pipe[0] > 0)
-            close(p->out_pipe[0]);
-        if (p->out_pipe[1] > 0)
-            close(p->out_pipe[1]);
-        p->out_pipe[0] = -1;
-        p->out_pipe[1] = -1;
-        return;
+	D_("Closing fifos for %s.\n", service->name);
+	if (p->out_pipe[0] > 0)
+	    close(p->out_pipe[0]);
+	if (p->out_pipe[1] > 0)
+	    close(p->out_pipe[1]);
+	p->out_pipe[0] = -1;
+	p->out_pipe[1] = -1;
+	return;
     }
 
     /* if buffer reached 10000 chars */
     if (old_content_offset + chars_read > 10000)
     {
-        char *tmp;
+	char *tmp;
 
-        /* copy the string from 1000 chars, to first */
-        memmove(p->buffer, &p->buffer[1000], 9000 * sizeof(char));
-        /* rezise the buffer */
-        tmp = i_realloc(p->buffer, 9001 * sizeof(char));
-
-        /* make sure realloc suceeded */
-        if (tmp)
-        {
-            p->buffer = tmp;
-            p->buffer_allocated = 9000;
-            p->buffer[9000] = '\0';
-        }
-        else
-        {
-            /* make the best for the current situation */
-            p->buffer[0] = '\0';
-            F_("realloc failed, possibly out of memory!\n");
-            return;
-        }
+	/* copy the string from 1000 chars, to first */
+	memmove(p->buffer, &p->buffer[1000], 9000 * sizeof(char));
+	/* rezise the buffer */
+	tmp = i_realloc(p->buffer, 9001 * sizeof(char));
+
+	/* make sure realloc suceeded */
+	if (tmp)
+	{
+	    p->buffer = tmp;
+	    p->buffer_allocated = 9000;
+	    p->buffer[9000] = '\0';
+	}
+	else
+	{
+	    /* make the best for the current situation */
+	    p->buffer[0] = '\0';
+	    F_("realloc failed, possibly out of memory!\n");
+	    return;
+	}
     }
 }
 
@@ -276,35 +276,35 @@
     currentC = NULL;
     while_list(currentC, &g.FDWATCHERS)
     {
-        /* first, some checking */
-        if (currentC->c.fdh->fds <= 2)
-            continue;
-        if (!currentC->c.fdh->call_module)
-            continue;
-
-        /*D_("adding fd #%i, from an call_db.\n", current->c.fdh->fds); */
-        if (currentC->c.fdh->what & FDW_READ)
-            FD_SET(currentC->c.fdh->fds, &readset);
-        if (currentC->c.fdh->what & FDW_WRITE)
-            FD_SET(currentC->c.fdh->fds, &writeset);
-        if (currentC->c.fdh->what & FDW_ERROR)
-            FD_SET(currentC->c.fdh->fds, &errset);
-        added++;
+	/* first, some checking */
+	if (currentC->c.fdh->fds <= 2)
+	    continue;
+	if (!currentC->c.fdh->call_module)
+	    continue;
+
+	/*D_("adding fd #%i, from an call_db.\n", current->c.fdh->fds); */
+	if (currentC->c.fdh->what & FDW_READ)
+	    FD_SET(currentC->c.fdh->fds, &readset);
+	if (currentC->c.fdh->what & FDW_WRITE)
+	    FD_SET(currentC->c.fdh->fds, &writeset);
+	if (currentC->c.fdh->what & FDW_ERROR)
+	    FD_SET(currentC->c.fdh->fds, &errset);
+	added++;
     }
 
     /* Then add all file descriptors from process read pipes */
     currentA = NULL;
     while_active_db(currentA)
     {
-        currentP = NULL;
-        while_processes(currentP, currentA)
-        {
-            if (currentP->out_pipe[0] > 2)
-            {
-                FD_SET(currentP->out_pipe[0], &readset);
-                added++;
-            }
-        }
+	currentP = NULL;
+	while_processes(currentP, currentA)
+	{
+	    if (currentP->out_pipe[0] > 2)
+	    {
+		FD_SET(currentP->out_pipe[0], &readset);
+		added++;
+	    }
+	}
     }
 
 
@@ -315,9 +315,9 @@
     /* check if there are any set */
     if (added <= 0)
     {
-        D_("No file descriptors set.\n");
-        sleep(timeout);
-        return;
+	D_("No file descriptors set.\n");
+	sleep(timeout);
+	return;
     }
     D_("%i file descriptors added.\n", added);
 
@@ -329,15 +329,15 @@
     /* error - Truly a interrupt */
     if (retval < 0)
     {
-        D_("Select returned %i\n", retval);
-        return;
+	D_("Select returned %i\n", retval);
+	return;
     }
 
     /* none was found */
     if (retval == 0)
     {
-        D_("There was no data found on any added fd.\n");
-        return;
+	D_("There was no data found on any added fd.\n");
+	return;
     }
 
     D_("%d fd's active\n", retval);
@@ -355,33 +355,33 @@
     qC = NULL;
     while_list_safe(currentC, &g.FDWATCHERS, qC)
     {
-        int what = 0;
+	int what = 0;
 
-        if (currentC->c.fdh->fds <= 2)
-            continue;
-        if (!currentC->c.fdh->call_module)
-            continue;
-
-        if (FD_ISSET(currentC->c.fdh->fds, &readset))
-            what |= FDW_READ;
-        if (FD_ISSET(currentC->c.fdh->fds, &writeset))
-            what |= FDW_WRITE;
-        if (FD_ISSET(currentC->c.fdh->fds, &errset))
-            what |= FDW_ERROR;
-
-        if (what == 0)
-            continue;
-
-
-        D_("Calling plugin handler for fd #%i, what=%i\n",
-           currentC->c.fdh->fds, what);
-        (*currentC->c.fdh->call_module) (currentC->c.fdh, what);
-        D_("Call handler returned.\n");
-
-        /* Found match, that means we need to look for one less, if we've found all we should then return */
-        retval--;
-        if (retval == 0)
-            return;
+	if (currentC->c.fdh->fds <= 2)
+	    continue;
+	if (!currentC->c.fdh->call_module)
+	    continue;
+
+	if (FD_ISSET(currentC->c.fdh->fds, &readset))
+	    what |= FDW_READ;
+	if (FD_ISSET(currentC->c.fdh->fds, &writeset))
+	    what |= FDW_WRITE;
+	if (FD_ISSET(currentC->c.fdh->fds, &errset))
+	    what |= FDW_ERROR;
+
+	if (what == 0)
+	    continue;
+
+
+	D_("Calling plugin handler for fd #%i, what=%i\n",
+	   currentC->c.fdh->fds, what);
+	(*currentC->c.fdh->call_module) (currentC->c.fdh, what);
+	D_("Call handler returned.\n");
+
+	/* Found match, that means we need to look for one less, if we've found all we should then return */
+	retval--;
+	if (retval == 0)
+	    return;
     }
 
     /* scan every service */
@@ -389,25 +389,25 @@
     qA = NULL;
     while_active_db_safe(currentA, qA)
     {
-        currentP = NULL;
-        qP = NULL;
-        /* and all the processes */
-        while_processes_safe(currentP, qP, currentA)
-        {
-            /* if matching */
-            if (currentP->out_pipe[0] > 2
-                && FD_ISSET(currentP->out_pipe[0], &readset))
-            {
-                D_("Will read from %s->start_process on fd #%i\n",
-                   currentA->name, currentP->out_pipe[0]);
-                /* Do the actual read from pipe */
-                initng_fd_process_read_input(currentA, currentP);
-                /* Found match, that means we need to look for one less, if we've found all we should then return */
-                retval--;
-                if (retval == 0)
-                    return;
-            }
-        }
+	currentP = NULL;
+	qP = NULL;
+	/* and all the processes */
+	while_processes_safe(currentP, qP, currentA)
+	{
+	    /* if matching */
+	    if (currentP->out_pipe[0] > 2
+		&& FD_ISSET(currentP->out_pipe[0], &readset))
+	    {
+		D_("Will read from %s->start_process on fd #%i\n",
+		   currentA->name, currentP->out_pipe[0]);
+		/* Do the actual read from pipe */
+		initng_fd_process_read_input(currentA, currentP);
+		/* Found match, that means we need to look for one less, if we've found all we should then return */
+		retval--;
+		if (retval == 0)
+		    return;
+	    }
+	}
     }
 
     return;

Modified: initng/trunk/src/initng_fork.c
==============================================================================
--- initng/trunk/src/initng_fork.c	(original)
+++ initng/trunk/src/initng_fork.c	Wed Apr  5 22:57:12 2006
@@ -20,12 +20,12 @@
 
 #include "initng.h"
 
-#include <time.h>                           /* time() */
-#include <fcntl.h>                          /* fcntl() */
-#include <unistd.h>                         /* execv() pipe() usleep() pause() chown() pid_t */
-#include <sys/wait.h>                       /* waitpid() sa */
-#include <sys/ioctl.h>                      /* ioctl() */
-#include <stdlib.h>                         /* free() exit() */
+#include <time.h>			    /* time() */
+#include <fcntl.h>			    /* fcntl() */
+#include <unistd.h>			    /* execv() pipe() usleep() pause() chown() pid_t */
+#include <sys/wait.h>			    /* waitpid() sa */
+#include <sys/ioctl.h>			    /* ioctl() */
+#include <stdlib.h>			    /* free() exit() */
 #include <stdio.h>
 #include <string.h>
 #include <assert.h>
@@ -48,8 +48,8 @@
 pid_t initng_fork(active_db_h * service, process_h * process)
 {
     /* This is the real service kicker */
-    pid_t pid_fork;             /* pid got from fork() */
-    int try_count = 0;          /* Count tryings */
+    pid_t pid_fork;		/* pid got from fork() */
+    int try_count = 0;		/* Count tryings */
     s_call *current = NULL;
 
     assert(service);
@@ -58,119 +58,119 @@
     /* open pipe */
     if (pipe(process->out_pipe) != 0)
     {
-        F_("Failed adding pipe ! %s\n", strerror(errno));
-        return (-1);
+	F_("Failed adding pipe ! %s\n", strerror(errno));
+	return (-1);
     }
 
     /* alloc buffer */
     if (process->buffer)
     {
-        free(process->buffer);
-        process->buffer = NULL;
-        process->buffer_allocated = 0;
+	free(process->buffer);
+	process->buffer = NULL;
+	process->buffer_allocated = 0;
     }
 
 
     /* Try to fork 30 times */
     while ((pid_fork = fork()) == -1)
     {
-        if (try_count > 30)
-        {                                   /* Already tried 30 times = no more try */
-            F_("GIVING UP TRY TO FORK, FATAL for service.\n");
-            return (pid_fork);
-        }
-        F_("FAILED TO FORK! try no# %i, this can be FATAL!\n", try_count);
-        usleep(++try_count * 2000);         /* Sleep a while before trying again */
+	if (try_count > 30)
+	{				    /* Already tried 30 times = no more try */
+	    F_("GIVING UP TRY TO FORK, FATAL for service.\n");
+	    return (pid_fork);
+	}
+	F_("FAILED TO FORK! try no# %i, this can be FATAL!\n", try_count);
+	usleep(++try_count * 2000);	    /* Sleep a while before trying again */
     }
 
     /* if this is child */
     if (pid_fork == 0)
     {
-        /* from now, don't trap signals */
-        initng_signal_disable();
+	/* from now, don't trap signals */
+	initng_signal_disable();
 
 #ifdef DEBUG
-        /* unverbose by default for now */
-        /* g.verbose = 0; */
+	/* unverbose by default for now */
+	/* g.verbose = 0; */
 #endif
 
 
 
-        /* TODO, comment this */
-        if (g.i_am_init)
-        {
-            ioctl(0, TIOCNOTTY, 0);
-            setsid();                       /* Run a program in a new session ??? */
-        }
-
-        /*
-         * set up file descriptors, for local fork,
-         * a fork in initng, should now receive any input, but stdout & stderr, should be sent
-         * to process->out_pipe[], that is set up by pipe() #man 2 pipe
-         * [0] for reading, and [1] for writing, as the pipe is for sending output
-         * FROM the fork, to initng for handle, the input part should be closed here,
-         * the other are mapped to STDOUT and STDERR.
-         */
-
-        /* close stdin/stdout/stderr */
-        /*close(STDIN_FILENO); */
-        close(STDOUT_FILENO);
-        close(STDERR_FILENO);
-
-        /* Duplicate stdout and stderr to the stdout[1] */
-        dup2(process->out_pipe[1], STDOUT_FILENO);
-        dup2(process->out_pipe[1], STDERR_FILENO);
-
-        /* set stdin, stdout, and stderr, that is should not be closed, if this child do execve() */
-        fcntl(STDIN_FILENO, F_SETFD, 0);
-        fcntl(STDOUT_FILENO, F_SETFD, 0);
-        fcntl(STDERR_FILENO, F_SETFD, 0);
-
-        /* Close the sides of the pipes we don't need, as we're in fork we won't need this part. */
-        close(process->out_pipe[0]);
-        process->out_pipe[0] = -1;
+	/* TODO, comment this */
+	if (g.i_am_init)
+	{
+	    ioctl(0, TIOCNOTTY, 0);
+	    setsid();			    /* Run a program in a new session ??? */
+	}
+
+	/*
+	 * set up file descriptors, for local fork,
+	 * a fork in initng, should now receive any input, but stdout & stderr, should be sent
+	 * to process->out_pipe[], that is set up by pipe() #man 2 pipe
+	 * [0] for reading, and [1] for writing, as the pipe is for sending output
+	 * FROM the fork, to initng for handle, the input part should be closed here,
+	 * the other are mapped to STDOUT and STDERR.
+	 */
+
+	/* close stdin/stdout/stderr */
+	/*close(STDIN_FILENO); */
+	close(STDOUT_FILENO);
+	close(STDERR_FILENO);
+
+	/* Duplicate stdout and stderr to the stdout[1] */
+	dup2(process->out_pipe[1], STDOUT_FILENO);
+	dup2(process->out_pipe[1], STDERR_FILENO);
+
+	/* set stdin, stdout, and stderr, that is should not be closed, if this child do execve() */
+	fcntl(STDIN_FILENO, F_SETFD, 0);
+	fcntl(STDOUT_FILENO, F_SETFD, 0);
+	fcntl(STDERR_FILENO, F_SETFD, 0);
+
+	/* Close the sides of the pipes we don't need, as we're in fork we won't need this part. */
+	close(process->out_pipe[0]);
+	process->out_pipe[0] = -1;
 
 
 
-        /* There might be plug-ins that will work here */
-        while_list(current, &g.A_FORK)
-        {
-            if (((*current->c.af_launcher) (service, process)) == FALSE)
-            {
-                F_("Some plugin did fail (from:%s), in after fork launch.\n",
-                   current->from_file);
-                _exit(1);
-            }
-        }
-
-        /* close all open fds, except STDIN, STDOUT, STDERR (0, 1, 2) */
-        {
-            int i;
-
-            for (i = 3; i <= 1013; i++)
-                close(i);
-        }
-
-        /* TODO, what does this do? */
-        if (g.i_am_init)
-            tcsetpgrp(0, getpgrp());        /* run this in foreground on fd 0 */
-
-        /* do a minimum sleep, to let the mother process 
-           to register child, and notice death */
-        usleep(ALL_USLEEP);
+	/* There might be plug-ins that will work here */
+	while_list(current, &g.A_FORK)
+	{
+	    if (((*current->c.af_launcher) (service, process)) == FALSE)
+	    {
+		F_("Some plugin did fail (from:%s), in after fork launch.\n",
+		   current->from_file);
+		_exit(1);
+	    }
+	}
+
+	/* close all open fds, except STDIN, STDOUT, STDERR (0, 1, 2) */
+	{
+	    int i;
+
+	    for (i = 3; i <= 1013; i++)
+		close(i);
+	}
+
+	/* TODO, what does this do? */
+	if (g.i_am_init)
+	    tcsetpgrp(0, getpgrp());	    /* run this in foreground on fd 0 */
+
+	/* do a minimum sleep, to let the mother process 
+	   to register child, and notice death */
+	usleep(ALL_USLEEP);
 
     }
     else
     {
 
-        /* close the receiving end on pipe, on parent */
-        close(process->out_pipe[1]);
-        process->out_pipe[1] = -1;
-        if (pid_fork > 0)
-        {
-            process->pid = pid_fork;
-            process->pst = P_RUNNING;
-        }
+	/* close the receiving end on pipe, on parent */
+	close(process->out_pipe[1]);
+	process->out_pipe[1] = -1;
+	if (pid_fork > 0)
+	{
+	    process->pid = pid_fork;
+	    process->pst = P_RUNNING;
+	}
     }
 
     return (pid_fork);

Modified: initng/trunk/src/initng_fork.h
==============================================================================
--- initng/trunk/src/initng_fork.h	(original)
+++ initng/trunk/src/initng_fork.h	Wed Apr  5 22:57:12 2006
@@ -20,9 +20,9 @@
 
 #ifndef INITNG_FORK_H
 #define INITNG_FORK_H
-#include <unistd.h>                         /* pid_t */
-#include "initng_active_db.h"               /* active_h */
-#include "initng_process_db.h"              /* process_h */
+#include <unistd.h>			    /* pid_t */
+#include "initng_active_db.h"		    /* active_h */
+#include "initng_process_db.h"		    /* process_h */
 
 pid_t initng_fork(active_db_h * service, process_h * process);
 

Modified: initng/trunk/src/initng_global.c
==============================================================================
--- initng/trunk/src/initng_global.c	(original)
+++ initng/trunk/src/initng_global.c	Wed Apr  5 22:57:12 2006
@@ -53,8 +53,8 @@
 
     for (i = 0; i < argc; i++)
     {
-        g.Argv[i] = i_strdup(argv[i]);
-        assert(g.Argv[i]);
+	g.Argv[i] = i_strdup(argv[i]);
+	assert(g.Argv[i]);
     }
     g.Argv[argc] = NULL;
 
@@ -67,11 +67,11 @@
     g.maxproclen = 0;
     for (i = 0; i < argc; i++)
     {
-        g.maxproclen += strlen(argv[i]) + 1;
+	g.maxproclen += strlen(argv[i]) + 1;
     }
     for (i = 0; env[i] != NULL; i++)
     {
-        g.maxproclen += strlen(env[i]) + 1;
+	g.maxproclen += strlen(env[i]) + 1;
     }
     D_("Maximum length for our process name is %d\n", g.maxproclen);
 
@@ -163,24 +163,24 @@
 
     for (i = 0; argv[i]; i++)
     {
-        /* set opt to argv */
-        char *opt = argv[i];
+	/* set opt to argv */
+	char *opt = argv[i];
 
-        /* don't parse options starting with an '+' */
-        if (opt[0] == '+')
-            continue;
-        /*
-         * if arg is --verbose, skip the two -- here, and start checking.
-         * if arg is -verbose, skip and continue for loop.
-         * if arg is verbose, check it below
-         */
-
-        /* if its a double --, its ok */
-        if (opt[0] == '-' && opt[1] == '-')
-            opt += 2;
-        /* but a single is not ! */
-        if (opt[0] == '-')
-            continue;
+	/* don't parse options starting with an '+' */
+	if (opt[0] == '+')
+	    continue;
+	/*
+	 * if arg is --verbose, skip the two -- here, and start checking.
+	 * if arg is -verbose, skip and continue for loop.
+	 * if arg is verbose, check it below
+	 */
+
+	/* if its a double --, its ok */
+	if (opt[0] == '-' && opt[1] == '-')
+	    opt += 2;
+	/* but a single is not ! */
+	if (opt[0] == '-')
+	    continue;
 
 
 #define R_L "runlevel="
@@ -189,32 +189,32 @@
 #define C_L "console="
 
 #ifdef DEBUG
-        if (strcmp(opt, "verbose") == 0)
-            g.verbose = TRUE;
+	if (strcmp(opt, "verbose") == 0)
+	    g.verbose = TRUE;
 #endif
-        if (strcmp(opt, "i_am_init") == 0)
-            g.i_am_init = TRUE;
-        if (strcmp(opt, "hot_reload") == 0)
-        {
-            D_(" Will start after a hot reload ...\n");
-            g.hot_reload = TRUE;
-        }
-        if (strcmp(opt, "i_am_not_init") == 0)
-            g.i_am_init = FALSE;
-
-        if (strcmp(opt, "no_circular") == 0)
-            g.no_circular = TRUE;
-
-        /* the ones with a value */
-        if (strncmp(opt, R_L, strlen(R_L)) == 0)
-            g.runlevel = i_strdup((opt) + strlen(R_L));
-        if (!g.runlevel && strncmp(opt, KR_L, strlen(KR_L)) == 0)
-            g.runlevel = i_strdup((opt) + strlen(KR_L));
-        if (strncmp(opt, C_L, strlen(C_L)) == 0)
-            g.dev_console = i_strdup((opt) + strlen(C_L));
+	if (strcmp(opt, "i_am_init") == 0)
+	    g.i_am_init = TRUE;
+	if (strcmp(opt, "hot_reload") == 0)
+	{
+	    D_(" Will start after a hot reload ...\n");
+	    g.hot_reload = TRUE;
+	}
+	if (strcmp(opt, "i_am_not_init") == 0)
+	    g.i_am_init = FALSE;
+
+	if (strcmp(opt, "no_circular") == 0)
+	    g.no_circular = TRUE;
+
+	/* the ones with a value */
+	if (strncmp(opt, R_L, strlen(R_L)) == 0)
+	    g.runlevel = i_strdup((opt) + strlen(R_L));
+	if (!g.runlevel && strncmp(opt, KR_L, strlen(KR_L)) == 0)
+	    g.runlevel = i_strdup((opt) + strlen(KR_L));
+	if (strncmp(opt, C_L, strlen(C_L)) == 0)
+	    g.dev_console = i_strdup((opt) + strlen(C_L));
 #ifdef DEBUG
-        if (strncmp(opt, V_T, strlen(V_T)) == 0)
-            initng_error_verbose_add((opt) + strlen(V_T));
+	if (strncmp(opt, V_T, strlen(V_T)) == 0)
+	    initng_error_verbose_add((opt) + strlen(V_T));
 #endif
     }
 }
@@ -224,26 +224,26 @@
     int i;
 
     /* free all databases */
-    initng_active_db_free_all();            /* clean process_db */
-    initng_service_cache_free_all();        /* clean service_cache_db */
+    initng_active_db_free_all();	    /* clean process_db */
+    initng_service_cache_free_all();	    /* clean service_cache_db */
     initng_service_data_types_free_all();   /* clean option_db */
-    initng_command_free_all();              /* clean command_db */
+    initng_command_free_all();		    /* clean command_db */
 
     /* free dynamic global variables */
     dfree_all(&g);
 
     /* free runlevel name string */
     if (g.runlevel)
-        free(g.runlevel);
+	free(g.runlevel);
 
     /* free console string if set */
     if (g.dev_console)
-        free(g.dev_console);
+	free(g.dev_console);
 
     /* free our copy of argv, and argc */
     for (i = 0; i < g.Argc; i++)
     {
-        free(g.Argv[i]);
+	free(g.Argv[i]);
     }
     free(g.Argv);
 
@@ -251,7 +251,7 @@
     /* close all open fd, over 3, this may hang boot */
     for (i = 3; i <= 1013; i++)
     {
-        close(i);
+	close(i);
     }
 
 }

Modified: initng/trunk/src/initng_global.h
==============================================================================
--- initng/trunk/src/initng_global.h	(original)
+++ initng/trunk/src/initng_global.h	Wed Apr  5 22:57:12 2006
@@ -61,28 +61,28 @@
     data_head data;
 
     /* all hooks to hook at */
-    s_call ASTATUS_CHANGE;      /* Calls as soon as the ASTATUS changes */
-    s_call PARSERS;             /* Called when a service needs its data */
-    s_call ADDITIONAL_PARSE;    /* Called after a service been parsed, and extra parsing may exist */
-    s_call SWATCHERS;           /* Called when system state changes */
-    s_call FDWATCHERS;          /* Called when initng open file descriptors receive data */
-    s_call PIPEWATCHERS;        /* Called when a service has some output, that initng received */
-    s_call SIGNAL;              /* Called when initng rescives a signal, like SIGHUP */
-    s_call MAIN;                /* Called every main loop */
-    s_call A_FORK;              /* Called after a process forks to start */
-    s_call HANDLE_KILLED;       /* Called when a process dies */
-    s_call COMPENSATE_TIME;     /* Called when initng detects a system time change */
-    s_call ERR_MSG;             /* Called when an error message is sent, so all output plug-ins can show it */
-    s_call LAUNCH;              /* Called when a process are getting launched */
-    s_call DUMP_ACTIVE_DB;      /* Asks for a plugin willing to dump the acytive_db */
-    s_call RELOAD_ACTIVE_DB;    /* Asks for a plugin willing to reload the active_db from a dump */
-    s_call DEP_ON;              /* Called when a function tries to find out a service dependency */
+    s_call ASTATUS_CHANGE;	/* Calls as soon as the ASTATUS changes */
+    s_call PARSERS;		/* Called when a service needs its data */
+    s_call ADDITIONAL_PARSE;	/* Called after a service been parsed, and extra parsing may exist */
+    s_call SWATCHERS;		/* Called when system state changes */
+    s_call FDWATCHERS;		/* Called when initng open file descriptors receive data */
+    s_call PIPEWATCHERS;	/* Called when a service has some output, that initng received */
+    s_call SIGNAL;		/* Called when initng rescives a signal, like SIGHUP */
+    s_call MAIN;		/* Called every main loop */
+    s_call A_FORK;		/* Called after a process forks to start */
+    s_call HANDLE_KILLED;	/* Called when a process dies */
+    s_call COMPENSATE_TIME;	/* Called when initng detects a system time change */
+    s_call ERR_MSG;		/* Called when an error message is sent, so all output plug-ins can show it */
+    s_call LAUNCH;		/* Called when a process are getting launched */
+    s_call DUMP_ACTIVE_DB;	/* Asks for a plugin willing to dump the acytive_db */
+    s_call RELOAD_ACTIVE_DB;	/* Asks for a plugin willing to reload the active_db from a dump */
+    s_call DEP_ON;		/* Called when a function tries to find out a service dependency */
 
     /* new ones */
-    s_call IS_CHANGE;           /* Called when the rough state of a service changes */
-    s_call START_DEP_MET;       /* Called and all this hooks have to return TRUE for launch to start */
-    s_call STOP_DEP_MET;        /* Called and all this hooks have to return TRUE for the service to stop */
-    s_call UP_MET;              /* Called when a service is trying to set the RUNNING state, is a up test */
+    s_call IS_CHANGE;		/* Called when the rough state of a service changes */
+    s_call START_DEP_MET;	/* Called and all this hooks have to return TRUE for launch to start */
+    s_call STOP_DEP_MET;	/* Called and all this hooks have to return TRUE for the service to stop */
+    s_call UP_MET;		/* Called when a service is trying to set the RUNNING state, is a up test */
 
 
     /* global variables */

Modified: initng/trunk/src/initng_handler.c
==============================================================================
--- initng/trunk/src/initng_handler.c	(original)
+++ initng/trunk/src/initng_handler.c	Wed Apr  5 22:57:12 2006
@@ -21,15 +21,15 @@
 #include "initng.h"
 
 #include <sys/time.h>
-#include <time.h>                           /* time() */
-#include <fcntl.h>                          /* fcntl() */
-#include <sys/un.h>                         /* memmove() strcmp() */
-#include <sys/wait.h>                       /* waitpid() sa */
-#include <linux/kd.h>                       /* KDSIGACCEPT */
-#include <sys/ioctl.h>                      /* ioctl() */
-#include <stdio.h>                          /* printf() */
-#include <stdlib.h>                         /* free() exit() */
-#include <sys/reboot.h>                     /* reboot() RB_DISABLE_CAD */
+#include <time.h>			    /* time() */
+#include <fcntl.h>			    /* fcntl() */
+#include <sys/un.h>			    /* memmove() strcmp() */
+#include <sys/wait.h>			    /* waitpid() sa */
+#include <linux/kd.h>			    /* KDSIGACCEPT */
+#include <sys/ioctl.h>			    /* ioctl() */
+#include <stdio.h>			    /* printf() */
+#include <stdlib.h>			    /* free() exit() */
+#include <sys/reboot.h>			    /* reboot() RB_DISABLE_CAD */
 #include <assert.h>
 #include <errno.h>
 
@@ -56,11 +56,11 @@
     /* make sure there is no more restarting running or stopping */
     while_active_db(current)
     {
-        if (IS_STOPPING(current))
-        {
-            if (is(&RESTARTING, current))
-                return;
-        }
+	if (IS_STOPPING(current))
+	{
+	    if (is(&RESTARTING, current))
+		return;
+	}
     }
 
     /* Okey, there was no stopping restart marked services. */
@@ -70,17 +70,17 @@
     current = NULL;
     while_active_db(current)
     {
-        if (IS_DOWN(current))
-        {
-            if (is(&RESTARTING, current))
-            {
-                /* remove the restarting flag */
-                dfree(&RESTARTING, current);
-
-                /* start the service */
-                initng_handler_start_service(current);
-            }
-        }
+	if (IS_DOWN(current))
+	{
+	    if (is(&RESTARTING, current))
+	    {
+		/* remove the restarting flag */
+		dfree(&RESTARTING, current);
+
+		/* start the service */
+		initng_handler_start_service(current);
+	    }
+	}
     }
 }
 
@@ -97,12 +97,12 @@
     /* walk through all active services */
     while_active_db_safe(current, q)
     {
-        assert(current->name);
-        assert(current->current_state);
+	assert(current->name);
+	assert(current->current_state);
 
-        /* call state handler, now when we got an g.interrupt */
-        if (current->current_state->state_interrupt)
-            (*current->current_state->state_interrupt) (current);
+	/* call state handler, now when we got an g.interrupt */
+	if (current->current_state->state_interrupt)
+	    (*current->current_state->state_interrupt) (current);
     }
 }
 
@@ -122,38 +122,38 @@
     /* walk through all active services */
     while_active_db_safe(current, q)
     {
-        assert(current->name);
-        assert(current->current_state);
+	assert(current->name);
+	assert(current->current_state);
 
-        /* skip services where alarm is not set */
-        if (current->alarm == 0)
-            continue;
-
-        /* if alarm has gone */
-        if (g.now.tv_sec >= current->alarm)
-        {
-            /* reset alarm */
-            current->alarm = 0;
-
-
-            /* call alarm handler, now when we got an g.interrupt */
-            if (current->current_state->state_alarm)
-                (*current->current_state->state_alarm) (current);
-            continue;
-        }
-
-        /* if no next_to_get is set */
-        if (!g.next_alarm)
-        {
-            g.next_alarm = current->alarm;
-            continue;
-        }
-
-        /* if this alarm is more early then next_to_get set it. */
-        if (current->alarm < g.next_alarm)
-        {
-            g.next_alarm = current->alarm;
-        }
+	/* skip services where alarm is not set */
+	if (current->alarm == 0)
+	    continue;
+
+	/* if alarm has gone */
+	if (g.now.tv_sec >= current->alarm)
+	{
+	    /* reset alarm */
+	    current->alarm = 0;
+
+
+	    /* call alarm handler, now when we got an g.interrupt */
+	    if (current->current_state->state_alarm)
+		(*current->current_state->state_alarm) (current);
+	    continue;
+	}
+
+	/* if no next_to_get is set */
+	if (!g.next_alarm)
+	{
+	    g.next_alarm = current->alarm;
+	    continue;
+	}
+
+	/* if this alarm is more early then next_to_get set it. */
+	if (current->alarm < g.next_alarm)
+	{
+	    g.next_alarm = current->alarm;
+	}
     }
 }
 
@@ -170,64 +170,64 @@
 
     if (!service_to_start->type)
     {
-        F_("Type for service %s not set.\n", service_to_start->name);
-        return (FALSE);
+	F_("Type for service %s not set.\n", service_to_start->name);
+	return (FALSE);
     }
 
     /* check system state, if we can launch. */
     if (g.sys_state != STATE_STARTING && g.sys_state != STATE_UP)
     {
-        F_("Can't start service %s, when system status is: %i !\n",
-           service_to_start->name, g.sys_state);
-        return (FALSE);
+	F_("Can't start service %s, when system status is: %i !\n",
+	   service_to_start->name, g.sys_state);
+	return (FALSE);
     }
 
     /* else, mark the service for restarting and stop it */
     if (is(&RESTARTING, service_to_start))
     {
-        D_("Cant manually start a service that is restarting.\n");
-        return (FALSE);
+	D_("Cant manually start a service that is restarting.\n");
+	return (FALSE);
     }
 
     /* it might already be starting */
     if (IS_STARTING(service_to_start) || IS_WAITING(service_to_start))
     {
-        D_("service %s is starting already.\n", service_to_start->name);
-        return (TRUE);
+	D_("service %s is starting already.\n", service_to_start->name);
+	return (TRUE);
     }
 
     /* if it failed */
     if (IS_FAILED(service_to_start))
     {
-        F_("Service %s failed and must be reset before it can be started again!\n", service_to_start->name);
-        return (FALSE);
+	F_("Service %s failed and must be reset before it can be started again!\n", service_to_start->name);
+	return (FALSE);
     }
 
     /* it might already be up */
     if (IS_UP(service_to_start))
     {
-        D_("service %s is already up!\n", service_to_start->name);
-        return (TRUE);
+	D_("service %s is already up!\n", service_to_start->name);
+	return (TRUE);
     }
 
     /* it must be down or stopping to start it */
     if (!(IS_DOWN(service_to_start) || IS_STOPPING(service_to_start)))
     {
-        W_("Can't set a service with status %s, to start\n",
-           service_to_start->current_state->state_name);
-        return (FALSE);
+	W_("Can't set a service with status %s, to start\n",
+	   service_to_start->current_state->state_name);
+	return (FALSE);
     }
 
     /* This will run this functuin (start_service) for all dependecys this service have. */
     if (initng_depend_start_deps(service_to_start) != TRUE)
     {
-        F_("Could not start %s, because a required dependency could not be found.\n");
-        return (FALSE);
+	F_("Could not start %s, because a required dependency could not be found.\n");
+	return (FALSE);
     }
 
     /* Now execute the local start_service code, in the service type plugin. */
     if (!service_to_start->type->start_service)
-        return (FALSE);
+	return (FALSE);
 
     /* execute it */
     return ((*service_to_start->type->start_service) (service_to_start));
@@ -245,47 +245,47 @@
 
     if (!service_to_stop->type)
     {
-        F_("Service %s type is missing!\n", service_to_stop->name);
-        return (FALSE);
+	F_("Service %s type is missing!\n", service_to_stop->name);
+	return (FALSE);
     }
 
     /* check so it not failed */
     if (IS_FAILED(service_to_stop))
     {
-        D_("Service %s is set filed, and cant be stopped.\n",
-           service_to_stop->name);
-        return (TRUE);
+	D_("Service %s is set filed, and cant be stopped.\n",
+	   service_to_stop->name);
+	return (TRUE);
     }
 
     /* IF service is stopping, do nothing. */
     if (IS_STOPPING(service_to_stop))
     {
-        D_("service %s is stopping already!\n", service_to_stop->name);
-        return (TRUE);
+	D_("service %s is stopping already!\n", service_to_stop->name);
+	return (TRUE);
     }
 
     /* check if its currently already down */
     if (IS_DOWN(service_to_stop))
     {
-        D_("Service %s is down already.\n", service_to_stop->name);
-        return (TRUE);
+	D_("Service %s is down already.\n", service_to_stop->name);
+	return (TRUE);
     }
 
     /* must be up or starting, to stop */
     if (!(IS_UP(service_to_stop) || IS_STARTING(service_to_stop)))
     {
-        W_("Service %s is not up but %s, and cant be stopped.\n",
-           service_to_stop->name, service_to_stop->current_state->state_name);
+	W_("Service %s is not up but %s, and cant be stopped.\n",
+	   service_to_stop->name, service_to_stop->current_state->state_name);
 
-        return (FALSE);
+	return (FALSE);
     }
 
     /* if stop_service code is included in type, use it. */
     if (!service_to_stop->type->stop_service)
     {
-        W_("Service %s Type %s  has no stopper, will return FALSE!\n",
-           service_to_stop->name, service_to_stop->type->name);
-        return (FALSE);
+	W_("Service %s Type %s  has no stopper, will return FALSE!\n",
+	   service_to_stop->name, service_to_stop->type->name);
+	return (FALSE);
     }
 
 
@@ -301,14 +301,14 @@
 
     /* type has to be known to restart the service */
     if (!service_to_restart->type)
-        return (FALSE);
+	return (FALSE);
 
     if (!IS_UP(service_to_restart))
     {
-        D_("Can only restart a running service %s. ( now_state : %s )\n",
-           service_to_restart->name,
-           service_to_restart->current_state->state_name);
-        return (FALSE);
+	D_("Can only restart a running service %s. ( now_state : %s )\n",
+	   service_to_restart->name,
+	   service_to_restart->current_state->state_name);
+	return (FALSE);
     }
 
     /* Restart all dependencys to this service */
@@ -316,8 +316,8 @@
 
     /* if there exits a restart code, use it */
     if (service_to_restart->type->restart_service)
-        return ((*service_to_restart->type->
-                 restart_service) (service_to_restart));
+	return ((*service_to_restart->type->
+		 restart_service) (service_to_restart));
 
     /* else, mark the service for restarting and stop it */
     set(&RESTARTING, service_to_restart);
@@ -338,21 +338,21 @@
     /* Try to find it */
     if ((to_load = initng_active_db_find_by_name(service)))
     {
-        if (!IS_DOWN(to_load))
-        {
-            D_("Service %s exits already, and is not stopped!\n",
-               to_load->name);
-            return (to_load);
-        }
+	if (!IS_DOWN(to_load))
+	{
+	    D_("Service %s exits already, and is not stopped!\n",
+	       to_load->name);
+	    return (to_load);
+	}
 
     }
     /* else try create and load a new service */
     else if (!(to_load = initng_common_load_to_active(service)))
     {
 
-        /* the function calling this function will print out an error */
-        D_("Unable to load active for service %s\n", service);
-        return (NULL);
+	/* the function calling this function will print out an error */
+	D_("Unable to load active for service %s\n", service);
+	return (NULL);
     }
 
     /* okay, now start it */
@@ -371,16 +371,16 @@
 
     while_active_db_safe(ser, q)
     {
-        /* don't stop a stopping service */
-        if (IS_STOPPING(ser))
-            continue;
-        if (IS_DOWN(ser))
-            continue;
-        if (IS_FAILED(ser))
-            continue;
+	/* don't stop a stopping service */
+	if (IS_STOPPING(ser))
+	    continue;
+	if (IS_DOWN(ser))
+	    continue;
+	if (IS_FAILED(ser))
+	    continue;
 
-        /* stop services */
-        initng_handler_stop_service(ser);
+	/* stop services */
+	initng_handler_stop_service(ser);
     }
     return (TRUE);
 }

Modified: initng/trunk/src/initng_kill_handler.c
==============================================================================
--- initng/trunk/src/initng_kill_handler.c	(original)
+++ initng/trunk/src/initng_kill_handler.c	Wed Apr  5 22:57:12 2006
@@ -20,15 +20,15 @@
 
 #include "initng.h"
 
-#include <time.h>                           /* time() */
-#include <fcntl.h>                          /* fcntl() */
-#include <sys/un.h>                         /* memmove() strcmp() */
-#include <sys/wait.h>                       /* waitpid() sa */
-#include <linux/kd.h>                       /* KDSIGACCEPT */
-#include <sys/ioctl.h>                      /* ioctl() */
-#include <stdio.h>                          /* printf() */
-#include <stdlib.h>                         /* free() exit() */
-#include <sys/reboot.h>                     /* reboot() RB_DISABLE_CAD */
+#include <time.h>			    /* time() */
+#include <fcntl.h>			    /* fcntl() */
+#include <sys/un.h>			    /* memmove() strcmp() */
+#include <sys/wait.h>			    /* waitpid() sa */
+#include <linux/kd.h>			    /* KDSIGACCEPT */
+#include <sys/ioctl.h>			    /* ioctl() */
+#include <stdio.h>			    /* printf() */
+#include <stdlib.h>			    /* free() exit() */
+#include <sys/reboot.h>			    /* reboot() RB_DISABLE_CAD */
 #include <assert.h>
 
 #include "initng_global.h"
@@ -62,13 +62,13 @@
 
     /* don't do anything on this pid */
     if (kpid <= 1)
-        return;
+	return;
 
     /* Look in process database for a match */
     if (!(service = initng_active_db_find_by_pid(kpid)))
     {
-        D_("handle_killed_by_pid(%i): No match in active_db!\n", kpid);
-        return;
+	D_("handle_killed_by_pid(%i): No match in active_db!\n", kpid);
+	return;
     }
 
     D_("handle_killed_by_pid(%i): found service \"%s\"...\n", kpid,
@@ -77,8 +77,8 @@
     /* Get the process pointer from the service */
     if (!(process = initng_process_db_get_by_pid(kpid, service)))
     {
-        W_("Could not fetch process, even when initng_active_db_find_by_pid() saw it here!\n");
-        return;
+	W_("Could not fetch process, even when initng_active_db_find_by_pid() saw it here!\n");
+	return;
     }
 
     D_("(%i), found process type: %s\n", kpid, process->pt->name);
@@ -93,19 +93,19 @@
      */
     if (process->out_pipe[0] > 0)
     {
-        /*
-         * calling initng_process_read_input, Make sure all buffers read, before closing them.
-         */
-        initng_fd_process_read_input(service, process);
-
-        /* now close */
-        close(process->out_pipe[0]);
-        process->out_pipe[0] = 0;
+	/*
+	 * calling initng_process_read_input, Make sure all buffers read, before closing them.
+	 */
+	initng_fd_process_read_input(service, process);
+
+	/* now close */
+	close(process->out_pipe[0]);
+	process->out_pipe[0] = 0;
     }
     if (process->out_pipe[1] > 0)
     {
-        close(process->out_pipe[1]);
-        process->out_pipe[1] = 0;
+	close(process->out_pipe[1]);
+	process->out_pipe[1] = 0;
     }
 
     /*
@@ -116,21 +116,21 @@
     /* Check if a plugin wants to override handle_killed behavior */
     if (initng_plugin_callers_handle_killed(service, process))
     {
-        D_("Plugin did handle this kill.\n");
-        return;
+	D_("Plugin did handle this kill.\n");
+	return;
     }
 
 
     /* launch a kill_handler if any */
     if (process->pt && process->pt->kill_handler)
     {
-        D_("Launching process->pt->kill_handler\n");
-        (*process->pt->kill_handler) (service, process);
+	D_("Launching process->pt->kill_handler\n");
+	(*process->pt->kill_handler) (service, process);
     }
     else
     {
-        D_("service %s pid %i p_type %s died with unknown handler, freeing process!\n", service->name, kpid, process->pt->name);
-        list_del(&process->list);
-        initng_process_db_free(process);
+	D_("service %s pid %i p_type %s died with unknown handler, freeing process!\n", service->name, kpid, process->pt->name);
+	list_del(&process->list);
+	initng_process_db_free(process);
     }
 }

Modified: initng/trunk/src/initng_list.h
==============================================================================
--- initng/trunk/src/initng_list.h	(original)
+++ initng/trunk/src/initng_list.h	Wed Apr  5 22:57:12 2006
@@ -39,7 +39,7 @@
  * the prev/next entries already!
  */
 static inline void __list_add(struct list_head *new, struct list_head *prev,
-                              struct list_head *next)
+			      struct list_head *next)
 {
     next->prev = new;
     new->next = next;
@@ -59,7 +59,7 @@
 {
     /* make sure its not already added */
     if (new->next || new->prev)
-        return;
+	return;
     __list_add(new, head, head->next);
 }
 
@@ -72,11 +72,11 @@
  * This is useful for implementing queues.
  */
 static inline void list_add_tail(struct list_head *new,
-                                 struct list_head *head)
+				 struct list_head *head)
 {
     /* make sure its not already added */
     if (new->next || new->prev)
-        return;
+	return;
     __list_add(new, head->prev, head);
 }
 
@@ -103,9 +103,9 @@
     /* only if list is added on a struct */
     if (entry->next || entry->prev)
     {
-        __list_del(entry->prev, entry->next);
-        entry->next = (void *) 0;
-        entry->prev = (void *) 0;
+	__list_del(entry->prev, entry->next);
+	entry->next = (void *) 0;
+	entry->prev = (void *) 0;
     }
 }
 
@@ -136,7 +136,7 @@
  * @head: the head that will follow our entry
  */
 static inline void list_move_tail(struct list_head *list,
-                                  struct list_head *head)
+				  struct list_head *head)
 {
     __list_del(list->prev, list->next);
     list_add_tail(list, head);
@@ -152,7 +152,7 @@
 }
 
 static inline void __list_splice(struct list_head *list,
-                                 struct list_head *head)
+				 struct list_head *head)
 {
     struct list_head *first = list->next;
     struct list_head *last = list->prev;
@@ -173,7 +173,7 @@
 static inline void list_splice(struct list_head *list, struct list_head *head)
 {
     if (!list_empty(list))
-        __list_splice(list, head);
+	__list_splice(list, head);
 }
 
 /**
@@ -184,12 +184,12 @@
  * The list at @list is reinitialised
  */
 static inline void list_splice_init(struct list_head *list,
-                                    struct list_head *head)
+				    struct list_head *head)
 {
     if (!list_empty(list))
     {
-        __list_splice(list, head);
-        INIT_LIST_HEAD(list);
+	__list_splice(list, head);
+	INIT_LIST_HEAD(list);
     }
 }
 

Modified: initng/trunk/src/initng_load_module.c
==============================================================================
--- initng/trunk/src/initng_load_module.c	(original)
+++ initng/trunk/src/initng_load_module.c	Wed Apr  5 22:57:12 2006
@@ -96,10 +96,10 @@
 
     while_module_db(m)
     {
-        if (strcmp(m->module_name, module_name) == 0)
-        {
-            return TRUE;
-        }
+	if (strcmp(m->module_name, module_name) == 0)
+	{
+	    return TRUE;
+	}
     }
     return FALSE;
 }
@@ -117,7 +117,7 @@
     /* if there are no needs, then we have met them */
     if (m->module_needs == NULL)
     {
-        return TRUE;
+	return TRUE;
     }
 
     /* otherwise check each one */
@@ -125,15 +125,15 @@
     retval = TRUE;
     if (needs != NULL)
     {
-        while (*needs != NULL)
-        {
-            if (!initng_load_module_is_loaded(*needs))
-            {
-                D_("Module \"%s\" needs \"%s\"\n", m->module_name, *needs);
-                retval = FALSE;
-            }
-            needs++;
-        }
+	while (*needs != NULL)
+	{
+	    if (!initng_load_module_is_loaded(*needs))
+	    {
+		D_("Module \"%s\" needs \"%s\"\n", m->module_name, *needs);
+		retval = FALSE;
+	    }
+	    needs++;
+	}
     }
     return retval;
 }
@@ -154,8 +154,8 @@
     /* allocate, the new module info struct */
     if (!(m = (m_h *) i_calloc(1, sizeof(m_h))))
     {
-        F_("Unable to allocate memory, for new module description.\n");
-        return (NULL);
+	F_("Unable to allocate memory, for new module description.\n");
+	return (NULL);
     }
 
     m->initziated = FALSE;
@@ -163,13 +163,13 @@
     /* check that file exists */
     if (stat(module_path, &st) != 0)
     {
-        F_("Module \"%s\" not found\n", module_path);
-        free(m);
-        return (NULL);
+	F_("Module \"%s\" not found\n", module_path);
+	free(m);
+	return (NULL);
     }
 
     /* open module */
-    dlerror();                              /* clear any existing error */
+    dlerror();				    /* clear any existing error */
     m->module_dlhandle = dlopen(module_path, RTLD_LAZY);
     /* 
      * this breaks ngc2 on my testbox - neuron : 
@@ -177,37 +177,37 @@
      * */
     if (m->module_dlhandle == NULL)
     {
-        F_("Error opening module %s; %s\n", module_name, dlerror());
-        free(m);
-        return (NULL);
+	F_("Error opening module %s; %s\n", module_name, dlerror());
+	free(m);
+	return (NULL);
     }
 
     D_("Success opening module \"%s\"\n", module_name);
 
     /* get initialization function */
-    dlerror();                              /* clear any existing error */
+    dlerror();				    /* clear any existing error */
     m->module_init = dlsym(m->module_dlhandle, "module_init");
     if (m->module_init == NULL)
     {
-        errmsg = dlerror();
-        F_("Error reading module_init(); %s\n", errmsg);
-        initng_load_module_close_and_free(m);
-        return (NULL);
+	errmsg = dlerror();
+	F_("Error reading module_init(); %s\n", errmsg);
+	initng_load_module_close_and_free(m);
+	return (NULL);
     }
 
     /* get unload function */
-    dlerror();                              /* clear any existing error */
+    dlerror();				    /* clear any existing error */
     m->module_unload = dlsym(m->module_dlhandle, "module_unload");
     if (m->module_unload == NULL)
     {
-        errmsg = dlerror();
-        F_("Error reading module_unload(); %s\n", errmsg);
-        initng_load_module_close_and_free(m);
-        return (NULL);
+	errmsg = dlerror();
+	F_("Error reading module_unload(); %s\n", errmsg);
+	initng_load_module_close_and_free(m);
+	return (NULL);
     }
 
     /* get dependency list (may be NULL - this is not an error) */
-    dlerror();                              /* clear any existing error */
+    dlerror();				    /* clear any existing error */
     m->module_needs = (char **) dlsym(m->module_dlhandle, "module_needs");
     /* XXX: is there any way to check for "not found", since we don't 
      * consider that an error? */
@@ -228,13 +228,13 @@
     /* free module name */
     if (m->module_name)
     {
-        free(m->module_name);
-        m->module_name = NULL;
+	free(m->module_name);
+	m->module_name = NULL;
     }
 
     /* close the lib */
     if (m->module_dlhandle)
-        dlclose(m->module_dlhandle);
+	dlclose(m->module_dlhandle);
 
     /* remove from list if added */
     list_del(&m->list);
@@ -256,16 +256,16 @@
     /* look for duplicates */
     if (initng_load_module_is_loaded(module_name))
     {
-        F_("Module \"%s\" already loaded, won't load it twice\n",
-           module_name);
-        return (NULL);
+	F_("Module \"%s\" already loaded, won't load it twice\n",
+	   module_name);
+	return (NULL);
     }
 
 
     /* build a path */
     module_path = (char *) i_calloc(1,
-                                    strlen(INITNG_PLUGIN_DIR) +
-                                    strlen(module_name) + 9);
+				    strlen(INITNG_PLUGIN_DIR) +
+				    strlen(module_name) + 9);
     strcpy(module_path, INITNG_PLUGIN_DIR "/lib");
     strcat(module_path, module_name);
     strcat(module_path, ".so");
@@ -276,17 +276,17 @@
 
     if (!new_m)
     {
-        F_("Unable to load module \"%s\"\n", module_name);
-        return (NULL);
+	F_("Unable to load module \"%s\"\n", module_name);
+	return (NULL);
     }
 
     /* see if we have our dependencies met */
     if (!initng_load_module_needs_are_loaded(new_m))
     {
-        F_("Not loading module \"%s\", missing needed module(s)\n",
-           module_path);
-        initng_load_module_close_and_free(new_m);
-        return (NULL);
+	F_("Not loading module \"%s\", missing needed module(s)\n",
+	   module_path);
+	initng_load_module_close_and_free(new_m);
+	return (NULL);
     }
 
     /* run module_init */
@@ -296,12 +296,12 @@
 
     if (new_m->initziated < 1)
     {
-        F_("Module %s did not load correctly (module_init() returned %i)\n",
-           module_path, new_m->initziated);
-        /* XXX: used to be here, but why? */
-        /* sleep(1); */
-        initng_load_module_close_and_free(new_m);
-        return (NULL);
+	F_("Module %s did not load correctly (module_init() returned %i)\n",
+	   module_path, new_m->initziated);
+	/* XXX: used to be here, but why? */
+	/* sleep(1); */
+	initng_load_module_close_and_free(new_m);
+	return (NULL);
     }
 
     assert(new_m->module_name);
@@ -327,21 +327,21 @@
 
     while_module_db(m)
     {
-        /* if not this module, have needs set, continue.. */
-        if (!(m->module_needs))
-            continue;
-        needs = m->module_needs;
-
-        while (*needs != NULL)
-        {
-            if (strcmp(module_name, *needs) == 0)
-            {
-                F_("Module \"%s\" needed by \"%s\"\n", module_name,
-                   m->module_name);
-                retval = TRUE;
-            }
-            needs++;
-        }
+	/* if not this module, have needs set, continue.. */
+	if (!(m->module_needs))
+	    continue;
+	needs = m->module_needs;
+
+	while (*needs != NULL)
+	{
+	    if (strcmp(module_name, *needs) == 0)
+	    {
+		F_("Module \"%s\" needed by \"%s\"\n", module_name,
+		   m->module_name);
+		retval = TRUE;
+	    }
+	    needs++;
+	}
     }
     return retval;
 }
@@ -374,8 +374,8 @@
 
     if (!initng_load_module_is_loaded(name))
     {
-        F_("Not unloading module \"%s\", it is not loaded\n", name);
-        return FALSE;
+	F_("Not unloading module \"%s\", it is not loaded\n", name);
+	return FALSE;
     }
 
 
@@ -383,12 +383,12 @@
 
     while_module_db(m)
     {
-        if (strcmp(m->module_name, name) == 0)
-        {
-            m->marked_for_removal = TRUE;
-            g.modules_to_unload = TRUE;
-            return (TRUE);
-        }
+	if (strcmp(m->module_name, name) == 0)
+	{
+	    m->marked_for_removal = TRUE;
+	    g.modules_to_unload = TRUE;
+	    return (TRUE);
+	}
     }
 
     return FALSE;
@@ -406,8 +406,8 @@
     /* open plugin dir */
     if (!(d = opendir(INITNG_PLUGIN_DIR)))
     {
-        F_("Unable to open plugin directory " INITNG_PLUGIN_DIR ".\n");
-        return FALSE;
+	F_("Unable to open plugin directory " INITNG_PLUGIN_DIR ".\n");
+	return FALSE;
     }
 
     /* memory for full path */
@@ -416,48 +416,48 @@
     /* get every entry */
     while ((e = readdir(d)) != NULL)
     {
-        /* check for files, ending with .so */
-        if (fnmatch("lib*.so", e->d_name, 0) == 0)
-        {
-            module_name = i_strndup(e->d_name + 3, strlen(e->d_name + 3) - 3);
-
-            /* search the plugin name, for blacklisted */
-            if (initng_common_service_blacklisted(module_name))
-            {
-                F_("Plugin %s blacklisted.\n", module_name);
-                free(module_name);
-                module_name = NULL;
-                continue;
-            }
-
-            /* set full path */
-            strcpy(module_path, INITNG_PLUGIN_DIR "/");
-            strcat(module_path, e->d_name);
-
-            /* open the module */
-            current = initng_load_module_open(module_path, module_name);
-
-            /* add this to the list of loaded modules */
-            if (!current)
-            {
-                free(module_name);
-                module_name = NULL;
-                continue;
-            }
-
-            /* add to list and continue */
-            assert(current->module_name);
-            list_add(&current->list, &g.module_db.list);
-        }
-        else
-        {
+	/* check for files, ending with .so */
+	if (fnmatch("lib*.so", e->d_name, 0) == 0)
+	{
+	    module_name = i_strndup(e->d_name + 3, strlen(e->d_name + 3) - 3);
+
+	    /* search the plugin name, for blacklisted */
+	    if (initng_common_service_blacklisted(module_name))
+	    {
+		F_("Plugin %s blacklisted.\n", module_name);
+		free(module_name);
+		module_name = NULL;
+		continue;
+	    }
+
+	    /* set full path */
+	    strcpy(module_path, INITNG_PLUGIN_DIR "/");
+	    strcat(module_path, e->d_name);
+
+	    /* open the module */
+	    current = initng_load_module_open(module_path, module_name);
+
+	    /* add this to the list of loaded modules */
+	    if (!current)
+	    {
+		free(module_name);
+		module_name = NULL;
+		continue;
+	    }
+
+	    /* add to list and continue */
+	    assert(current->module_name);
+	    list_add(&current->list, &g.module_db.list);
+	}
+	else
+	{
 #ifdef DEBUG
-            if (e->d_name[0] != '.')
-            {
-                D_("Won't load module \"%s\", doesn't match \"*.so\" pattern.\n", e->d_name);
-            }
+	    if (e->d_name[0] != '.')
+	    {
+		D_("Won't load module \"%s\", doesn't match \"*.so\" pattern.\n", e->d_name);
+	    }
 #endif
-        }
+	}
     }
     closedir(d);
 
@@ -466,27 +466,27 @@
     /* load the entries on our TODO list */
     while_module_db_safe(current, safe)
     {
-        /* already initialized */
-        if (current->initziated == TRUE)
-            continue;
-
-        if (!initng_load_module_needs_are_loaded(current))
-        {
-            initng_load_module_close_and_free(current);
-            continue;
-        }
-
-        /* if we did find find a module with needs loaded, try to load it */
-        current->initziated = (*current->module_init) (API_VERSION);
-        D_("for module \"%s\" return: %i\n", current->module_name,
-           current->initziated);
-
-        /* check if it was initialized correctly */
-        if (current->initziated != TRUE)
-        {
-            F_("Module %s did not load correctly (module_init() returned %i)\n", current->module_name, current->initziated);
-            initng_load_module_close_and_free(current);
-        }
+	/* already initialized */
+	if (current->initziated == TRUE)
+	    continue;
+
+	if (!initng_load_module_needs_are_loaded(current))
+	{
+	    initng_load_module_close_and_free(current);
+	    continue;
+	}
+
+	/* if we did find find a module with needs loaded, try to load it */
+	current->initziated = (*current->module_init) (API_VERSION);
+	D_("for module \"%s\" return: %i\n", current->module_name,
+	   current->initziated);
+
+	/* check if it was initialized correctly */
+	if (current->initziated != TRUE)
+	{
+	    F_("Module %s did not load correctly (module_init() returned %i)\n", current->module_name, current->initziated);
+	    initng_load_module_close_and_free(current);
+	}
 
     }
 
@@ -507,7 +507,7 @@
 
     while_module_db_safe(m, safe)
     {
-        initng_unload_module(m);
+	initng_unload_module(m);
     }
 
     /* reset the list, to make sure its empty */
@@ -529,18 +529,18 @@
 
     while_module_db_safe(m, safe)
     {
-        if (m->marked_for_removal == TRUE)
-        {
-            if (initng_load_module_is_needed(m->module_name))
-            {
-                F_("Not unloading module \"%s\", it is needed\n",
-                   m->module_name);
-                m->marked_for_removal = FALSE;
-                continue;
-            }
-            D_("now unloading marked module %s.\n", m->module_name);
+	if (m->marked_for_removal == TRUE)
+	{
+	    if (initng_load_module_is_needed(m->module_name))
+	    {
+		F_("Not unloading module \"%s\", it is needed\n",
+		   m->module_name);
+		m->marked_for_removal = FALSE;
+		continue;
+	    }
+	    D_("now unloading marked module %s.\n", m->module_name);
 
-            initng_unload_module(m);
-        }
+	    initng_unload_module(m);
+	}
     }
 }

Modified: initng/trunk/src/initng_load_module.h
==============================================================================
--- initng/trunk/src/initng_load_module.h	(original)
+++ initng/trunk/src/initng_load_module.h	Wed Apr  5 22:57:12 2006
@@ -34,7 +34,7 @@
 
 /* functions for internal use only (exposed for testing) */
 m_h *initng_load_module_open(const char *module_path,
-                             const char *module_name);
+			     const char *module_name);
 void initng_load_module_close_and_free(m_h * m);
 
 #endif

Modified: initng/trunk/src/initng_main.c
==============================================================================
--- initng/trunk/src/initng_main.c	(original)
+++ initng/trunk/src/initng_main.c	Wed Apr  5 22:57:12 2006
@@ -20,14 +20,14 @@
 
 #include "initng.h"
 
-#include <time.h>                           /* time() */
-#include <fcntl.h>                          /* fcntl() */
-#include <sys/un.h>                         /* memmove() strcmp() */
-#include <sys/wait.h>                       /* waitpid() sa */
-#include <linux/kd.h>                       /* KDSIGACCEPT */
-#include <sys/ioctl.h>                      /* ioctl() */
-#include <stdlib.h>                         /* free() exit() */
-#include <sys/reboot.h>                     /* reboot() RB_DISABLE_CAD */
+#include <time.h>			    /* time() */
+#include <fcntl.h>			    /* fcntl() */
+#include <sys/un.h>			    /* memmove() strcmp() */
+#include <sys/wait.h>			    /* waitpid() sa */
+#include <linux/kd.h>			    /* KDSIGACCEPT */
+#include <sys/ioctl.h>			    /* ioctl() */
+#include <stdlib.h>			    /* free() exit() */
+#include <sys/reboot.h>			    /* reboot() RB_DISABLE_CAD */
 #include <sys/mount.h>
 #include <termios.h>
 #include <stdio.h>
@@ -63,20 +63,20 @@
     /* If the last process has died, quit initng */
     while_active_db(current)
     {
-        /* Don't check with failed services */
-        if (IS_FAILED(current))
-            continue;
-
-        /* if its down, its nothing to count on */
-        if (IS_DOWN(current))
-            continue;
-
-        /*
-         * if we got here,
-         * its must be an non failing service, 
-         * left.
-         */
-        return (FALSE);
+	/* Don't check with failed services */
+	if (IS_FAILED(current))
+	    continue;
+
+	/* if its down, its nothing to count on */
+	if (IS_DOWN(current))
+	    continue;
+
+	/*
+	 * if we got here,
+	 * its must be an non failing service, 
+	 * left.
+	 */
+	return (FALSE);
     }
 
     return (TRUE);
@@ -91,27 +91,27 @@
 
     while_active_db(current)
     {
-        if (IS_FAILED(current))
-        {
-            failing++;
-            printf("\n [%i] service \"%s\" marked \"%s\"\n", failing,
-                   current->name, current->current_state->state_name);
-        }
+	if (IS_FAILED(current))
+	{
+	    failing++;
+	    printf("\n [%i] service \"%s\" marked \"%s\"\n", failing,
+		   current->name, current->current_state->state_name);
+	}
     }
     if (failing > 0)
     {
-        printf("\n\n All %i services listed above, are marked with a failure.\n", failing);
-        printf(" Will sleep for 15 seconds before reboot/halt so you can see them.\n\n");
-        sleep(15);
+	printf("\n\n All %i services listed above, are marked with a failure.\n", failing);
+	printf(" Will sleep for 15 seconds before reboot/halt so you can see them.\n\n");
+	sleep(15);
     }
 
 
 
     if (g.i_am_init && getpid() != 1)
     {
-        F_("I AM NOT INIT, THIS CANT BE HAPPENING!\n");
-        sleep(3);
-        return;
+	F_("I AM NOT INIT, THIS CANT BE HAPPENING!\n");
+	sleep(3);
+	return;
     }
 
     /* always good to do */
@@ -120,27 +120,27 @@
     /* none of these calls should return, so the su_login on the end will be a fallback */
     switch (g.when_out)
     {
-        case THEN_QUIT:
-            P_(" ** Now Quiting **\n");
-            initng_main_exit(0);
-            break;
-        case THEN_SULOGIN:
-            P_(" ** Now SuLogin\n");
-            /* break here leads to su_login below */
-            break;
-        case THEN_RESTART:
-            P_(" ** Now restarting\n");
-            initng_main_restart();
-            break;
-        case THEN_NEW_INIT:
-            P_(" ** Launching new init\n");
-            initng_main_new_init();
-            break;
-        case THEN_REBOOT:
-        case THEN_HALT:
-        case THEN_POWEROFF:
-            initng_hard(g.when_out);
-            break;
+	case THEN_QUIT:
+	    P_(" ** Now Quiting **\n");
+	    initng_main_exit(0);
+	    break;
+	case THEN_SULOGIN:
+	    P_(" ** Now SuLogin\n");
+	    /* break here leads to su_login below */
+	    break;
+	case THEN_RESTART:
+	    P_(" ** Now restarting\n");
+	    initng_main_restart();
+	    break;
+	case THEN_NEW_INIT:
+	    P_(" ** Launching new init\n");
+	    initng_main_new_init();
+	    break;
+	case THEN_REBOOT:
+	case THEN_HALT:
+	case THEN_POWEROFF:
+	    initng_hard(g.when_out);
+	    break;
     }
 
     /* fallback */
@@ -155,18 +155,18 @@
     /* set the sys state */
     switch (t)
     {
-        case THEN_REBOOT:
-            initng_main_set_sys_state(STATE_REBOOT);
-            break;
-        case THEN_HALT:
-            initng_main_set_sys_state(STATE_HALT);
-            break;
-        case THEN_POWEROFF:
-            initng_main_set_sys_state(STATE_POWEROFF);
-            break;
-        default:
-            F_("initng_hard can only handle STATE_REBOOT, STATE_POWEROFF, or STATE_HALT for now.\n");
-            return;
+	case THEN_REBOOT:
+	    initng_main_set_sys_state(STATE_REBOOT);
+	    break;
+	case THEN_HALT:
+	    initng_main_set_sys_state(STATE_HALT);
+	    break;
+	case THEN_POWEROFF:
+	    initng_main_set_sys_state(STATE_POWEROFF);
+	    break;
+	default:
+	    F_("initng_hard can only handle STATE_REBOOT, STATE_POWEROFF, or STATE_HALT for now.\n");
+	    return;
     }
 
 
@@ -175,7 +175,7 @@
 
     /* make sure we are root */
     if (getuid() != 0)
-        return;
+	return;
 
     /* unload all modules (plugins) found */
     initng_unload_module_unload_all();
@@ -185,16 +185,16 @@
 
     if (errno == EBUSY)
     {
-        F_("Failed to remount / ro, EBUSY\n");
+	F_("Failed to remount / ro, EBUSY\n");
     }
 
     /* check so that / is mounted read only, by trying to open a file */
     if ((test = fopen("/initng_write_testfile", "w")) != NULL)
     {
-        fclose(test);
-        unlink("/initng_write_testfile");
-        F_("/ IS NOT REMOUNTED READ-ONLY, WONT REBOOT/HALT BECAUSE THE FILE SYSTEM CAN BREAK!\n");
-        return;
+	fclose(test);
+	unlink("/initng_write_testfile");
+	F_("/ IS NOT REMOUNTED READ-ONLY, WONT REBOOT/HALT BECAUSE THE FILE SYSTEM CAN BREAK!\n");
+	return;
     }
 
     /* Under certain unknown circumstances, calling reboot(RB_POWER_OFF) from
@@ -205,35 +205,35 @@
     /* if succeded (pid==0) or failed (pid < 0) */
     if (pid <= 0)
     {
-        /* child process - shut down the machine */
-        switch (t)
-        {
-            case THEN_REBOOT:
-                reboot(RB_AUTOBOOT);
-                break;
-            case THEN_HALT:
-                reboot(RB_HALT_SYSTEM);
-                break;
-            case THEN_POWEROFF:
-                reboot(RB_POWER_OFF);
-                break;
-            default:
-                /* What to do here */
-                break;
-        }
-
-        /* if in fork, quit it */
-        if (pid == 0)
-            _exit(0);
+	/* child process - shut down the machine */
+	switch (t)
+	{
+	    case THEN_REBOOT:
+		reboot(RB_AUTOBOOT);
+		break;
+	    case THEN_HALT:
+		reboot(RB_HALT_SYSTEM);
+		break;
+	    case THEN_POWEROFF:
+		reboot(RB_POWER_OFF);
+		break;
+	    default:
+		/* What to do here */
+		break;
+	}
+
+	/* if in fork, quit it */
+	if (pid == 0)
+	    _exit(0);
     }
 
     /* parent process waits for child to exit */
     if (pid > 0)
-        waitpid(pid, NULL, 0);
+	waitpid(pid, NULL, 0);
 
     /* idle forever */
     while (1)
-        sleep(1);
+	sleep(1);
 }
 
 #define TRY_TIMES 2
@@ -248,52 +248,52 @@
 #ifdef SELINUX
     if (is_selinux_enabled > 0)
     {
-        security_context_t *contextlist = NULL;
+	security_context_t *contextlist = NULL;
 
-        if (get_ordered_context_list("root", 0, &contextlist) > 0)
-        {
-            if (setexeccon(contextlist[0]) != 0)
-                fprintf(stderr, "setexeccon failed\n");
-            freeconary(contextlist);
-        }
+	if (get_ordered_context_list("root", 0, &contextlist) > 0)
+	{
+	    if (setexeccon(contextlist[0]) != 0)
+		fprintf(stderr, "setexeccon failed\n");
+	    freeconary(contextlist);
+	}
     }
 #endif
     /* sulogin nicely 2 times */
     if (local_sulogin_count <= TRY_TIMES)
     {
-        printf("This is a sulogin offer,\n"
-               "you will be able to login for %i times (now %i),\n"
-               "and on return initng will try continue where it was,\n"
-               "if the times go out, initng will launch\n"
-               "/sbin/initng-segfault on next su_login request.\n\n",
-               TRY_TIMES, local_sulogin_count);
-        sulogin_pid = fork();
-
-        if (sulogin_pid == 0)
-        {
-            const char *sulogin_argv[] = { "/sbin/sulogin", NULL };
-            const char *sulogin_env[] = { NULL };
-
-            /* launch sulogin */
-            execve(sulogin_argv[0], (char **) sulogin_argv,
-                   (char **) sulogin_env);
-
-            printf("Unable to execute /sbin/sulogin!\n");
-            _exit(1);
-        }
-
-        if (sulogin_pid > 0)
-        {
-            do
-            {
-                sulogin_pid = waitpid(sulogin_pid, &status, WUNTRACED);
-            }
-            while (!WIFEXITED(status) && !WIFSIGNALED(status));
-
-            /* increase the sulogin_count */
-            local_sulogin_count++;
-            return;
-        }
+	printf("This is a sulogin offer,\n"
+	       "you will be able to login for %i times (now %i),\n"
+	       "and on return initng will try continue where it was,\n"
+	       "if the times go out, initng will launch\n"
+	       "/sbin/initng-segfault on next su_login request.\n\n",
+	       TRY_TIMES, local_sulogin_count);
+	sulogin_pid = fork();
+
+	if (sulogin_pid == 0)
+	{
+	    const char *sulogin_argv[] = { "/sbin/sulogin", NULL };
+	    const char *sulogin_env[] = { NULL };
+
+	    /* launch sulogin */
+	    execve(sulogin_argv[0], (char **) sulogin_argv,
+		   (char **) sulogin_env);
+
+	    printf("Unable to execute /sbin/sulogin!\n");
+	    _exit(1);
+	}
+
+	if (sulogin_pid > 0)
+	{
+	    do
+	    {
+		sulogin_pid = waitpid(sulogin_pid, &status, WUNTRACED);
+	    }
+	    while (!WIFEXITED(status) && !WIFSIGNALED(status));
+
+	    /* increase the sulogin_count */
+	    local_sulogin_count++;
+	    return;
+	}
     }
 
     /* else run segfault script */
@@ -309,22 +309,22 @@
 void initng_main_start_extra_services(void)
 {
     int i;
-    int a_count = 0;            /* counts orders from argv to start */
+    int a_count = 0;		/* counts orders from argv to start */
 
     initng_main_set_sys_state(STATE_STARTING);
     /* check with argv which service to start initiating */
     for (i = 1; i < g.Argc; i++)
     {
-        /* start all services that is +service */
-        if (g.Argv[i][0] != '+')
-            continue;
-
-        /* if succeed to load this service */
-        if (initng_handler_start_new_service_named(g.Argv[i] + 1))
-            a_count++;
-        else
-            F_(" Requested service \"%s\", could not be executed!\n",
-               g.Argv[i]);
+	/* start all services that is +service */
+	if (g.Argv[i][0] != '+')
+	    continue;
+
+	/* if succeed to load this service */
+	if (initng_handler_start_new_service_named(g.Argv[i] + 1))
+	    a_count++;
+	else
+	    F_(" Requested service \"%s\", could not be executed!\n",
+	       g.Argv[i]);
     }
 }
 
@@ -336,12 +336,12 @@
     initng_main_set_sys_state(STATE_EXECVE);
     for (i = 3; i <= 1013; i++)
     {
-        close(i);
+	close(i);
     }
     if (!g.new_init || !g.new_init[0])
     {
-        F_(" g.new_init is not set!\n");
-        return;
+	F_(" g.new_init is not set!\n");
+	return;
     }
     P_("\n\n\n          Launching new init (%s)\n\n", g.new_init[0]);
     execve(g.new_init[0], g.new_init, environ);
@@ -356,7 +356,7 @@
     initng_main_set_sys_state(STATE_RESTART);
     for (i = 3; i <= 1013; i++)
     {
-        close(i);
+	close(i);
     }
     argv = (char **) i_calloc(3, sizeof(char *));
 
@@ -373,7 +373,7 @@
 {
     /* don't set a state that is */
     if (state == g.sys_state)
-        return;
+	return;
 
     D_("set_sys_state(): %% Setting state to: %i %% \n", state);
     g.sys_state = state;
@@ -422,8 +422,8 @@
     /* if this is not init */
     if (!g.i_am_init)
     {
-        /* just quit */
-        _exit(99);
+	/* just quit */
+	_exit(99);
     }
 
 #ifdef DEBUG
@@ -432,26 +432,26 @@
     /* Try to launch a getty, that we may if lucky login to tty9 and run gdb there */
     if (fork() == 0)
     {
-        const char *getty_argv[] = { "/sbin/getty", "38400", "tty9", NULL };
-        const char *getty_env[] = { NULL };
+	const char *getty_argv[] = { "/sbin/getty", "38400", "tty9", NULL };
+	const char *getty_env[] = { NULL };
 
-        /* execve getty in the fork */
-        execve((char *) getty_argv[0], (char **) getty_argv,
-               (char **) getty_env);
-        _exit(1);
+	/* execve getty in the fork */
+	execve((char *) getty_argv[0], (char **) getty_argv,
+	       (char **) getty_env);
+	_exit(1);
     }
 
     /* if we compiled debug mode, we get the user 20 seconds to fire up gdb, and attach pid 1 */
     while (i < 5)
     {
-        emergency_output = open("/dev/console", O_WRONLY);
-        if (emergency_output > 0)
-        {
-            write(emergency_output, MESSAGE, sizeof(char) * strlen(MESSAGE));
-            close(emergency_output);
-        }
-        sleep(4);                           /*  5 times 4 is 20 seconds */
-        i++;
+	emergency_output = open("/dev/console", O_WRONLY);
+	if (emergency_output > 0)
+	{
+	    write(emergency_output, MESSAGE, sizeof(char) * strlen(MESSAGE));
+	    close(emergency_output);
+	}
+	sleep(4);			    /*  5 times 4 is 20 seconds */
+	i++;
     }
 #endif
 
@@ -459,40 +459,40 @@
     emergency_output = open("/dev/console", O_WRONLY);
     if (emergency_output > 0)
     {
-        write(emergency_output, LMESSAGE, sizeof(char) * strlen(LMESSAGE));
-        close(emergency_output);
+	write(emergency_output, LMESSAGE, sizeof(char) * strlen(LMESSAGE));
+	close(emergency_output);
     }
 
     /* launch initng-segfault */
     {
-        const char *segfault_argv[] = { "/sbin/initng-segfault", NULL };
-        const char *segfault_argv_initng[] = { "/sbin/initng", "--hot_reload", NULL };
-        const char *segfault_env[] = { NULL };
-
-        /* first try /sbin/initng-segfault */
-        if (execve
-            ((char *) segfault_argv[0], (char **) segfault_argv,
-             (char **) segfault_env) == -1)
-        {
-            /* then try /sbin/initng --hot_reload */
-            if (execve
-                ((char *) segfault_argv_initng[0], (char **) segfault_argv,
-                 (char **) segfault_env) == -1)
-
-            {
-                /* else tell the user, it dont succeded to start a replacement */
-                fprintf(stderr,
-                        "/sbin/initng-segfault did not exist, will die!\n");
-            }
-        }
+	const char *segfault_argv[] = { "/sbin/initng-segfault", NULL };
+	const char *segfault_argv_initng[] = { "/sbin/initng", "--hot_reload", NULL };
+	const char *segfault_env[] = { NULL };
+
+	/* first try /sbin/initng-segfault */
+	if (execve
+	    ((char *) segfault_argv[0], (char **) segfault_argv,
+	     (char **) segfault_env) == -1)
+	{
+	    /* then try /sbin/initng --hot_reload */
+	    if (execve
+		((char *) segfault_argv_initng[0], (char **) segfault_argv,
+		 (char **) segfault_env) == -1)
+
+	    {
+		/* else tell the user, it dont succeded to start a replacement */
+		fprintf(stderr,
+			"/sbin/initng-segfault did not exist, will die!\n");
+	    }
+	}
 
     }
 
     /* Looop forever ever, becouse init cant die */
     while (1)
     {
-        sleep(10);
-        fprintf(stderr, "INITNG_SEGFAULT\n");
+	sleep(10);
+	fprintf(stderr, "INITNG_SEGFAULT\n");
     }
 }
 
@@ -501,15 +501,15 @@
     /* first free the old_runlevel */
     if (g.old_runlevel)
     {
-        free(g.old_runlevel);
-        g.old_runlevel = NULL;
+	free(g.old_runlevel);
+	g.old_runlevel = NULL;
     }
 
     /* then move the last new, to the old */
     if (g.runlevel)
     {
-        g.old_runlevel = g.runlevel;
-        g.runlevel = NULL;
+	g.old_runlevel = g.runlevel;
+	g.runlevel = NULL;
     }
 
     /* and set the new */

Modified: initng/trunk/src/initng_open_read_close.c
==============================================================================
--- initng/trunk/src/initng_open_read_close.c	(original)
+++ initng/trunk/src/initng_open_read_close.c	Wed Apr  5 22:57:12 2006
@@ -39,9 +39,9 @@
 
 int open_read_close(const char *filename, char **buffer)
 {
-    int conf_file;              /* File descriptor for config file */
+    int conf_file;		/* File descriptor for config file */
     struct stat stat_buf;
-    int res;                    /* Result of read */
+    int res;			/* Result of read */
 
     /* Mark *buffer and conf_file as not set, for cleanup if bailing out... */
 
@@ -54,20 +54,20 @@
 
     if (conf_file == -1)
     {
-        D_("open_read_close(%s) error %d opening file; %s\n",
-           filename, errno, strerror(errno));
+	D_("open_read_close(%s) error %d opening file; %s\n",
+	   filename, errno, strerror(errno));
 
-        bailout(&conf_file, buffer);
-        return (FALSE);
+	bailout(&conf_file, buffer);
+	return (FALSE);
     }
 
     if (fstat(conf_file, &stat_buf) == -1)
     {
-        D_("open_read_close(%s) error %s getting file size; %s\n",
-           filename, errno, strerror(errno));
+	D_("open_read_close(%s) error %s getting file size; %s\n",
+	   filename, errno, strerror(errno));
 
-        bailout(&conf_file, buffer);
-        return (FALSE);
+	bailout(&conf_file, buffer);
+	return (FALSE);
     }
 
     /* Allocate a file buffer */
@@ -80,34 +80,34 @@
 
     if (res == -1)
     {
-        F_("open_read_close(%s): Error %d reading file; %s\n",
-           filename, errno, strerror(errno));
+	F_("open_read_close(%s): Error %d reading file; %s\n",
+	   filename, errno, strerror(errno));
 
-        bailout(&conf_file, buffer);
-        return (FALSE);
+	bailout(&conf_file, buffer);
+	return (FALSE);
     }
 
     if (res != stat_buf.st_size)
     {
-        F_("open_read_close(%s): read %d instead of %d bytes\n",
-           filename, (int) res, (int) stat_buf.st_size);
+	F_("open_read_close(%s): read %d instead of %d bytes\n",
+	   filename, (int) res, (int) stat_buf.st_size);
 
-        bailout(&conf_file, buffer);
-        return (FALSE);
+	bailout(&conf_file, buffer);
+	return (FALSE);
     }
 
     /* Normally we wouldn't care about this, but as this is init(ng)? */
 
     if (close(conf_file) < 0)
     {
-        F_("open_read_close(%s): Error %d closing file; %s\n",
-           filename, errno, strerror(errno));
+	F_("open_read_close(%s): Error %d closing file; %s\n",
+	   filename, errno, strerror(errno));
 
-        bailout(&conf_file, buffer);
-        return (FALSE);
+	bailout(&conf_file, buffer);
+	return (FALSE);
     }
 
-    (*buffer)[stat_buf.st_size] = '\0';     /* Null terminate *buffer */
+    (*buffer)[stat_buf.st_size] = '\0';	    /* Null terminate *buffer */
 
     return (TRUE);
 }
@@ -118,14 +118,14 @@
     /* if conf_file != -1 it is open */
 
     if (*p_conf_file != -1)
-        (void) close(*p_conf_file);         /* Ignore result this time */
+	(void) close(*p_conf_file);	    /* Ignore result this time */
 
     *p_conf_file = -1;
 
     /* *buffer != NULL => we have called calloc, so free it */
 
     if (*buffer)
-        free(*buffer);
+	free(*buffer);
 
     *buffer = NULL;
 }

Modified: initng/trunk/src/initng_plugin.h
==============================================================================
--- initng/trunk/src/initng_plugin.h	(original)
+++ initng/trunk/src/initng_plugin.h	Wed Apr  5 22:57:12 2006
@@ -26,9 +26,9 @@
 /* flags for f_module_h.what - correspond to the arguments of select() */
 typedef enum
 {
-    FDW_READ = 1,               /* Want notification when data is ready to be read */
-    FDW_WRITE = 2,                          /* when data can be written successfully */
-    FDW_ERROR = 4,                          /* when an exceptional condition occurs */
+    FDW_READ = 1,		/* Want notification when data is ready to be read */
+    FDW_WRITE = 2,			    /* when data can be written successfully */
+    FDW_ERROR = 4,			    /* when an exceptional condition occurs */
 } e_fdw;
 
 typedef struct ft_module_h f_module_h;
@@ -49,14 +49,14 @@
     service_cache_h *(*parser) (const char *name);
     void (*swatcher) (h_sys_state state);
     int (*pipewatcher) (active_db_h * service, process_h * process,
-                        char *buffer_pos);
+			char *buffer_pos);
     int (*launch) (active_db_h * service, process_h * process);
     int (*af_launcher) (active_db_h * service, process_h * process);
     int (*handle_killed) (active_db_h * service, process_h * process);
     void (*main) (void);
     void (*compensate_time) (int seconds);
     int (*err) (e_mt mt, const char *file, const char *func, int line,
-                const char *format, va_list ap);
+		const char *format, va_list ap);
     int (*dep_on_check) (active_db_h * service, active_db_h * check);
     void (*signal_hook) (int signal);
     f_module_h *fdh;

Modified: initng/trunk/src/initng_plugin_callers.c
==============================================================================
--- initng/trunk/src/initng_plugin_callers.c	(original)
+++ initng/trunk/src/initng_plugin_callers.c	Wed Apr  5 22:57:12 2006
@@ -24,7 +24,7 @@
 #include <assert.h>
 #include <errno.h>
 #include <string.h>
-#include <fcntl.h>                          /* fcntl() */
+#include <fcntl.h>			    /* fcntl() */
 #include <time.h>
 #include "initng.h"
 #include "initng_global.h"
@@ -44,7 +44,7 @@
 
     while_list_safe(current, &g.SIGNAL, q)
     {
-        (*current->c.signal_hook) (signal);
+	(*current->c.signal_hook) (signal);
     }
 }
 
@@ -54,10 +54,10 @@
 
     while_list_safe(current, &g.HANDLE_KILLED, q)
     {
-        D_("Calling killed_handle plugin from %s\n", current->from_file);
-        if (current->c.handle_killed)
-            if (((*current->c.handle_killed) (s, p)) == TRUE)
-                return (TRUE);
+	D_("Calling killed_handle plugin from %s\n", current->from_file);
+	if (current->c.handle_killed)
+	    if (((*current->c.handle_killed) (s, p)) == TRUE)
+		return (TRUE);
 
     }
     return (FALSE);
@@ -70,12 +70,12 @@
 
     while_list_safe(current, &g.COMPENSATE_TIME, q)
     {
-        if (current->c.swatcher)
-        {
-            D_("Calling system_state_changed plugin from %s\n",
-               current->from_file);
-            (*current->c.swatcher) (t);
-        }
+	if (current->c.swatcher)
+	{
+	    D_("Calling system_state_changed plugin from %s\n",
+	       current->from_file);
+	    (*current->c.swatcher) (t);
+	}
     }
 
 }
@@ -87,12 +87,12 @@
 
     while_list_safe(current, &g.SWATCHERS, q)
     {
-        if (current->c.swatcher)
-        {
-            D_("Calling system_state_changed plugin from %s\n",
-               current->from_file);
-            (*current->c.swatcher) (state);
-        }
+	if (current->c.swatcher)
+	{
+	    D_("Calling system_state_changed plugin from %s\n",
+	       current->from_file);
+	    (*current->c.swatcher) (state);
+	}
     }
     return;
 }
@@ -105,22 +105,22 @@
 
     while_list_safe(current, &g.DUMP_ACTIVE_DB, q)
     {
-        if (current->c.dump_active_db)
-        {
-            D_("Calling dump_active_db plugin from %s\n", current->from_file);
-            retval = (*current->c.dump_active_db) ();
-            if (retval == TRUE)
-            {
-                D_("dump_active_db plugin from %s succeeded\n",
-                   current->from_file);
-                break;
-            }
-            else if (retval == FAIL)
-            {
-                F_("dump_state plugin from %s failed\n", current->from_file);
-                break;
-            }
-        }
+	if (current->c.dump_active_db)
+	{
+	    D_("Calling dump_active_db plugin from %s\n", current->from_file);
+	    retval = (*current->c.dump_active_db) ();
+	    if (retval == TRUE)
+	    {
+		D_("dump_active_db plugin from %s succeeded\n",
+		   current->from_file);
+		break;
+	    }
+	    else if (retval == FAIL)
+	    {
+		F_("dump_state plugin from %s failed\n", current->from_file);
+		break;
+	    }
+	}
     }
     return retval;
 
@@ -134,24 +134,24 @@
 
     while_list_safe(current, &g.RELOAD_ACTIVE_DB, q)
     {
-        if (current->c.reload_active_db)
-        {
-            D_("Calling reload_active_db plugin from %s\n",
-               current->from_file);
-            retval = (*current->c.reload_active_db) ();
-            if (retval == TRUE)
-            {
-                D_("reload_active_db plugin from %s succeeded\n",
-                   current->from_file);
-                break;
-            }
-            else if (retval == FAIL)
-            {
-                F_("reload_active_db plugin from %s failed\n",
-                   current->from_file);
-                break;
-            }
-        }
+	if (current->c.reload_active_db)
+	{
+	    D_("Calling reload_active_db plugin from %s\n",
+	       current->from_file);
+	    retval = (*current->c.reload_active_db) ();
+	    if (retval == TRUE)
+	    {
+		D_("reload_active_db plugin from %s succeeded\n",
+		   current->from_file);
+		break;
+	    }
+	    else if (retval == FAIL)
+	    {
+		F_("reload_active_db plugin from %s failed\n",
+		   current->from_file);
+		break;
+	    }
+	}
     }
     return retval;
 }

Modified: initng/trunk/src/initng_plugin_hook.c
==============================================================================
--- initng/trunk/src/initng_plugin_hook.c	(original)
+++ initng/trunk/src/initng_plugin_hook.c	Wed Apr  5 22:57:12 2006
@@ -28,7 +28,7 @@
 #include "initng_plugin.h"
 #include "initng_plugin_hook.h"
 void initng_plugin_hook_del_real(const char *from_file, const char *func,
-                                 int line, s_call * t, void *hook)
+				 int line, s_call * t, void *hook)
 {
     s_call *current, *safe = NULL;
 
@@ -40,17 +40,17 @@
 
     while_list_safe(current, t, safe)
     {
-        /* make sure the pointer is right */
-        if (current->c.pointer != hook)
-            continue;
+	/* make sure the pointer is right */
+	if (current->c.pointer != hook)
+	    continue;
 
-        list_del(&current->list);
+	list_del(&current->list);
 
-        if (current->from_file)
-            free(current->from_file);
+	if (current->from_file)
+	    free(current->from_file);
 
-        free(current);
-        return;
+	free(current);
+	return;
     }
 
     F_("Could not find hook to delete, file: %s, func:%s, line %i!!!!\n",
@@ -58,7 +58,7 @@
 }
 
 int initng_plugin_hook_add_real(const char *from_file, s_call * t, int order,
-                                void *hook)
+				void *hook)
 {
     s_call *new_call = NULL;
     s_call *current = NULL;
@@ -81,19 +81,19 @@
     /* if list is empty, we don't need to care about order */
     if (list_empty(&t->list))
     {
-        list_add(&new_call->list, &t->list);
-        D_("Hook added to list successfully, as first.\n");
-        return (TRUE);
+	list_add(&new_call->list, &t->list);
+	D_("Hook added to list successfully, as first.\n");
+	return (TRUE);
     }
 
 
     /* fast forward, we wanna add hooks in order. */
     while_list(current, t)
     {
-        /*D_("from %s order: %i\n", current->from_file, current->order); */
-        if (current->order < order)
-            continue;
-        break;
+	/*D_("from %s order: %i\n", current->from_file, current->order); */
+	if (current->order < order)
+	    continue;
+	break;
     }
 
     /* add it in order */

Modified: initng/trunk/src/initng_plugin_hook.h
==============================================================================
--- initng/trunk/src/initng_plugin_hook.h	(original)
+++ initng/trunk/src/initng_plugin_hook.h	Wed Apr  5 22:57:12 2006
@@ -24,9 +24,9 @@
 #include "initng_plugin.h"
 
 void initng_plugin_hook_del_real(const char *from_file, const char *func,
-                                 int line, s_call * t, void *hook);
+				 int line, s_call * t, void *hook);
 int initng_plugin_hook_add_real(const char *from_file, s_call * t, int order,
-                                void *hook);
+				void *hook);
 #define initng_plugin_hook_add(t,o,h) \
     initng_plugin_hook_add_real(__FILE__, t, o, h)
 #define initng_plugin_hook_del(t,h) \

Modified: initng/trunk/src/initng_process_db.c
==============================================================================
--- initng/trunk/src/initng_process_db.c	(original)
+++ initng/trunk/src/initng_process_db.c	Wed Apr  5 22:57:12 2006
@@ -40,11 +40,11 @@
     process_h *new_p = NULL;
 
     /* allocate a new process entry */
-    new_p = (process_h *) i_calloc(1, sizeof(process_h));       /* Allocate memory for a new process */
+    new_p = (process_h *) i_calloc(1, sizeof(process_h));	/* Allocate memory for a new process */
     if (!new_p)
     {
-        F_("Unable to allocate process!\n");
-        return (NULL);
+	F_("Unable to allocate process!\n");
+	return (NULL);
     }
 
     new_p->pt = type;
@@ -70,8 +70,8 @@
 
     while_processes(current, service)
     {
-        if (current->pt == type)
-            return (current);
+	if (current->pt == type)
+	    return (current);
     }
     return (NULL);
 }
@@ -81,14 +81,14 @@
  * if it exists 
  */
 process_h *initng_process_db_get_by_name(const char *name,
-                                         active_db_h * service)
+					 active_db_h * service)
 {
     process_h *current = NULL;
 
     while_processes(current, service)
     {
-        if (strcmp(current->pt->name, name) == 0)
-            return (current);
+	if (strcmp(current->pt->name, name) == 0)
+	    return (current);
     }
     return (NULL);
 
@@ -103,8 +103,8 @@
 
     while_processes(current, service)
     {
-        if (current->pid == pid)
-            return (current);
+	if (current->pid == pid)
+	    return (current);
     }
     return (NULL);
 }
@@ -119,11 +119,11 @@
     list_del(&free_this->list);
 
     if (free_this->out_pipe[0] > 0)
-        close(free_this->out_pipe[0]);
+	close(free_this->out_pipe[0]);
     if (free_this->out_pipe[1] > 0)
-        close(free_this->out_pipe[1]);
+	close(free_this->out_pipe[1]);
     if (free_this->buffer)
-        free(free_this->buffer);
+	free(free_this->buffer);
 
     free(free_this);
     return;

Modified: initng/trunk/src/initng_process_db.h
==============================================================================
--- initng/trunk/src/initng_process_db.h	(original)
+++ initng/trunk/src/initng_process_db.h	Wed Apr  5 22:57:12 2006
@@ -49,14 +49,14 @@
 struct t_process_h
 {
     ptype_h *pt;
-    pid_t pid;                  /* pid of process */
+    pid_t pid;			/* pid of process */
     int r_code;
-    int out_pipe[2];            /* pipes of process */
-    char *buffer;               /* stdout buffer ## THE BEGINNING ## */
+    int out_pipe[2];		/* pipes of process */
+    char *buffer;		/* stdout buffer ## THE BEGINNING ## */
     int buffer_allocated;
     e_pst pst;
 
-    struct list_head list;      /* this process should be in a list */
+    struct list_head list;	/* this process should be in a list */
 };
 
 struct t_ptype_h
@@ -78,7 +78,7 @@
 void initng_process_db_free(process_h * free_this);
 process_h *initng_process_db_get(ptype_h * type, active_db_h * service);
 process_h *initng_process_db_get_by_name(const char *name,
-                                         active_db_h * service);
+					 active_db_h * service);
 process_h *initng_process_db_get_by_pid(pid_t pid, active_db_h * service);
 
 #define while_processes(current, service) list_for_each_entry_prev(current, &service->processes.list, list)

Modified: initng/trunk/src/initng_service_cache.c
==============================================================================
--- initng/trunk/src/initng_service_cache.c	(original)
+++ initng/trunk/src/initng_service_cache.c	Wed Apr  5 22:57:12 2006
@@ -51,9 +51,9 @@
     /* Check that we are unique */
     if (initng_service_cache_find_by_exact_name(s->name) != NULL)
     {
-        D_("service_db_add(%s): WARNING: DUPLICATE. Already added!\n",
-           s->name);
-        return (FALSE);
+	D_("service_db_add(%s): WARNING: DUPLICATE. Already added!\n",
+	   s->name);
+	return (FALSE);
     }
 
     /* if not found, add this one on the list */
@@ -81,8 +81,8 @@
     new_serv = (service_cache_h *) i_calloc(1, sizeof(service_cache_h));
     if (!new_serv)
     {
-        F_("Could not allocate space, for new copy of service!\n");
-        return (NULL);
+	F_("Could not allocate space, for new copy of service!\n");
+	return (NULL);
     }
 
     /* copy service structure */
@@ -116,8 +116,8 @@
     D_("default_service();\n");
     if (!(new_s = (service_cache_h *) i_calloc(1, sizeof(service_cache_h))))
     {
-        F_("OUT OF MEMORY default_service().\n");
-        return (NULL);
+	F_("OUT OF MEMORY default_service().\n");
+	return (NULL);
     }
 
     /* set name & type */
@@ -151,10 +151,10 @@
     while_service_cache(current)
     {
 
-        assert(current->name);
-        /* check if this service name is like service */
-        if (strcmp(current->name, service) == 0)
-            return (current);               /* return it */
+	assert(current->name);
+	/* check if this service name is like service */
+	if (strcmp(current->name, service) == 0)
+	    return (current);		    /* return it */
     }
 
     /* did not find any */
@@ -174,7 +174,7 @@
 
     /* first give the exact find a shot */
     if ((current = initng_service_cache_find_by_exact_name(service)))
-        return (current);
+	return (current);
 
     /* did not find any */
     return NULL;
@@ -185,17 +185,17 @@
     current = NULL;
     while_service_cache(current)
     {
-        assert(current->name);
-        /*
-         * then try to find alike name
-         * When searching for services, in service cache, the match is reverse,
-         * then how active_db_find_by_name.
-         * 
-         * The service name searching data for is always correct, but the data,
-         * might have an '*' or '?'
-         */
-        if (service_match(service, current->name))
-            return (current);
+	assert(current->name);
+	/*
+	 * then try to find alike name
+	 * When searching for services, in service cache, the match is reverse,
+	 * then how active_db_find_by_name.
+	 * 
+	 * The service name searching data for is always correct, but the data,
+	 * might have an '*' or '?'
+	 */
+	if (service_match(service, current->name))
+	    return (current);
 
     }
 
@@ -217,15 +217,15 @@
 
     /* first search by name */
     if ((current = initng_service_cache_find_by_name(service)))
-        return (current);
+	return (current);
 
     /* Don't return any match, if the user was searching for an exact match */
     if (!strchr(service, '/'))
-        return NULL;
+	return NULL;
 
     /* remove starting wildcards */
     while (service[0] == '*' || service[0] == '?')
-        service++;
+	service++;
 
     copy = i_strdup(service);
     assert(copy);
@@ -233,22 +233,22 @@
     /* remove last wildcards */
     for (i = 0; copy[i]; i++)
     {
-        if (copy[i] == '*' || copy[i] == '?')
-            copy[i] = '\0';
+	if (copy[i] == '*' || copy[i] == '?')
+	    copy[i] = '\0';
     }
 
     /* then search for a word match */
     current = NULL;
     while_service_cache(current)
     {
-        assert(current->name);
-        /* check if this service name is like service */
-        if (strstr(current->name, copy))
-        {
-            D_("Warning, the return is not an exact match!\n");
-            free(copy);
-            return (current);               /* return it */
-        }
+	assert(current->name);
+	/* check if this service name is like service */
+	if (strstr(current->name, copy))
+	{
+	    D_("Warning, the return is not an exact match!\n");
+	    free(copy);
+	    return (current);		    /* return it */
+	}
     }
     free(copy);
 
@@ -263,17 +263,17 @@
  * and removes it.
  */
 static void initng_service_cache_clear_father_pointer_from(service_cache_h *
-                                                           s)
+							   s)
 {
     service_cache_h *current = NULL;
 
     while_service_cache(current)
     {
-        if (current->father == s)
-        {
-            current->father = NULL;
-            current->data.res = NULL;
-        }
+	if (current->father == s)
+	{
+	    current->father = NULL;
+	    current->data.res = NULL;
+	}
     }
 }
 
@@ -301,15 +301,15 @@
 
     /* free father_name */
     if (to_free->father_name)
-        free(to_free->father_name);
+	free(to_free->father_name);
 
     /* free service name */
     if (to_free->name)
-        free(to_free->name);
+	free(to_free->name);
 
     /* make sure its not on the service list */
     if (to_free->list.next || to_free->list.prev)
-        list_del(&to_free->list);
+	list_del(&to_free->list);
 
     free(to_free);
     return (TRUE);
@@ -324,7 +324,7 @@
 
     while_service_cache_safe(current, q)
     {
-        initng_service_cache_free(current);
+	initng_service_cache_free(current);
     }
 }
 
@@ -338,19 +338,19 @@
     assert(service);
     /* if father is known, return ok */
     if (service->father)
-        return (TRUE);
+	return (TRUE);
     /* if no father is needed */
     if (!service->father_name)
-        return (FALSE);
+	return (FALSE);
 
     service->father = initng_common_parse_service(service->father_name);
 
     /* check */
     if (service->father)
     {
-        /* Put service data collection to be resursive to fathers data */
-        service->data.res = &service->father->data;
-        return (TRUE);
+	/* Put service data collection to be resursive to fathers data */
+	service->data.res = &service->father->data;
+	return (TRUE);
     }
 
     /* else fail */

Modified: initng/trunk/src/initng_service_cache.h
==============================================================================
--- initng/trunk/src/initng_service_cache.h	(original)
+++ initng/trunk/src/initng_service_cache.h	Wed Apr  5 22:57:12 2006
@@ -60,7 +60,7 @@
 
 /* update */
 void initng_service_cache_change(service_cache_h * from,
-                                 service_cache_h * to);
+				 service_cache_h * to);
 
 /* standard wrappers using service */
 #define initng_service_cache_get_next(t,s,l) d_get_next(t, &(s)->data.list, l)

Modified: initng/trunk/src/initng_service_data_types.c
==============================================================================
--- initng/trunk/src/initng_service_data_types.c	(original)
+++ initng/trunk/src/initng_service_data_types.c	Wed Apr  5 22:57:12 2006
@@ -45,33 +45,33 @@
      * an optimize so that we don't need to strlen every time accessing this one.
      */
     if (ent->opt_name)
-        ent->opt_name_len = strlen(ent->opt_name);
+	ent->opt_name_len = strlen(ent->opt_name);
     else
-        ent->opt_name_len = 0;
+	ent->opt_name_len = 0;
 
 #ifdef CHECK_IF_CURRENTLY_ADDED
     {
-        s_entry *current = NULL;
+	s_entry *current = NULL;
 
-        /* walk the option_db, and make sure its not added, or option_name taken */
-        while_service_data_types(current)
-        {
-            if (current == ent)
-            {
-                if (ent->opt_name)
-                    F_("Option %s, already added!\n", ent->opt_name);
-                else
-                    F_("Option, already added!\n");
-
-                return;
-            }
-            if (current->opt_name && ent->opt_name
-                && strcmp(current->opt_name, ent->opt_name) == 0)
-            {
-                F_("option %s, name taken.\n");
-                return;
-            }
-        }
+	/* walk the option_db, and make sure its not added, or option_name taken */
+	while_service_data_types(current)
+	{
+	    if (current == ent)
+	    {
+		if (ent->opt_name)
+		    F_("Option %s, already added!\n", ent->opt_name);
+		else
+		    F_("Option, already added!\n");
+
+		return;
+	    }
+	    if (current->opt_name && ent->opt_name
+		&& strcmp(current->opt_name, ent->opt_name) == 0)
+	    {
+		F_("option %s, name taken.\n");
+		return;
+	    }
+	}
     }
 #endif
 
@@ -79,7 +79,7 @@
     list_add(&ent->list, &g.option_db.list);
 #ifdef DEBUG
     if (ent->opt_name)
-        D_(" \"%s\" added to option_db!\n", ent->opt_name);
+	D_(" \"%s\" added to option_db!\n", ent->opt_name);
 #endif
 }
 
@@ -99,13 +99,13 @@
     /* clear the active db for this data */
     while_active_db(currentA)
     {
-        dfree(ent, currentA);
+	dfree(ent, currentA);
     }
 
     /* clear the file cache from this data */
     while_service_cache(currentS)
     {
-        dfree(ent, currentS);
+	dfree(ent, currentS);
     }
 
     /* remove it from the list */
@@ -123,7 +123,7 @@
     /* walk the option db, remove all */
     while_service_data_types_safe(current, safe)
     {
-        initng_service_data_types_del(current);
+	initng_service_data_types_del(current);
     }
 
     /* make sure the list is cleared! */
@@ -143,8 +143,8 @@
     D_("looking for %s.\n", string);
     while_service_data_types(current)
     {
-        if (current->opt_name && strcmp(current->opt_name, string) == 0)
-            return (current);
+	if (current->opt_name && strcmp(current->opt_name, string) == 0)
+	    return (current);
     }
     return (NULL);
 }

Modified: initng/trunk/src/initng_service_data_types.h
==============================================================================
--- initng/trunk/src/initng_service_data_types.h	(original)
+++ initng/trunk/src/initng_service_data_types.h	Wed Apr  5 22:57:12 2006
@@ -27,13 +27,13 @@
 
 typedef enum
 {
-    U_D_T = 0,                  /* UnDefinedType, unknown data type */
-    STRING = 1,                             /* Entry shud contain a string, when set again, the old string is owerwritten */
-    STRINGS = 2,                            /* On every add, a new string with same name is added */
-    SET = 3,                                /* A Bool, Enable or Disable */
-    INT = 6,                                /* An value set in it */
-    ALIAS = 7,                              /* Set this datatype when s_entry->alias is filled */
-    TIME_T = 8,                             /* Contains an time entry */
+    U_D_T = 0,			/* UnDefinedType, unknown data type */
+    STRING = 1,				    /* Entry shud contain a string, when set again, the old string is owerwritten */
+    STRINGS = 2,			    /* On every add, a new string with same name is added */
+    SET = 3,				    /* A Bool, Enable or Disable */
+    INT = 6,				    /* An value set in it */
+    ALIAS = 7,				    /* Set this datatype when s_entry->alias is filled */
+    TIME_T = 8,				    /* Contains an time entry */
 
     /*
      * This works works like abow, but you can attach variable names to it,
@@ -50,11 +50,11 @@
 struct ss_entry
 {
     /* set in statically */
-    const char *opt_name;       /* The option name in a string */
-    e_dt opt_type;              /* The variable type, the type of content, see abow */
-    stype_h *ot;                /* Only used if you want to bound the option, to a special service type */
-    const char *opt_desc;       /* Short description, shown by ngc -O */
-    s_entry *alias;             /* You might point this to another s_entry, with another option_name, to get an alias */
+    const char *opt_name;	/* The option name in a string */
+    e_dt opt_type;		/* The variable type, the type of content, see abow */
+    stype_h *ot;		/* Only used if you want to bound the option, to a special service type */
+    const char *opt_desc;	/* Short description, shown by ngc -O */
+    s_entry *alias;		/* You might point this to another s_entry, with another option_name, to get an alias */
 
     /* this should not be set static */
     int opt_name_len;

Modified: initng/trunk/src/initng_service_types.c
==============================================================================
--- initng/trunk/src/initng_service_types.c	(original)
+++ initng/trunk/src/initng_service_types.c	Wed Apr  5 22:57:12 2006
@@ -29,8 +29,8 @@
 
     while_service_types(current)
     {
-        if (strncmp(current->name, name, current->name_len) == 0)
-            return (current);
+	if (strncmp(current->name, name, current->name_len) == 0)
+	    return (current);
     }
     return (NULL);
 }

Modified: initng/trunk/src/initng_signal.c
==============================================================================
--- initng/trunk/src/initng_signal.c	(original)
+++ initng/trunk/src/initng_signal.c	Wed Apr  5 22:57:12 2006
@@ -20,9 +20,9 @@
 
 #include "initng.h"
 
-#include <sys/wait.h>                       /* waitpid() sa */
-#include <stdlib.h>                         /* free() exit() */
-#include <stdio.h>                          /* printf() */
+#include <sys/wait.h>			    /* waitpid() sa */
+#include <stdlib.h>			    /* free() exit() */
+#include <stdio.h>			    /* printf() */
 #include <errno.h>
 #include <string.h>
 #include <assert.h>
@@ -44,59 +44,59 @@
  */
 void initng_signal_handle_sigchild(void)
 {
-    int status;                 /* data got from waitpid, never used */
-    pid_t killed;               /* pid of killed app */
+    int status;			/* data got from waitpid, never used */
+    pid_t killed;		/* pid of killed app */
 
     for (;;)
     {
-        /* slaying zombies */
-        do
-        {
-            killed = waitpid(-1, &status, WNOHANG);
-        }
-        while ((killed < 0) && (errno == EINTR));
-
-        /* Nothing killed */
-        if (killed == 0)
-        {
-            return;
-        }
-
-        /* unknown child */
-        if ((killed < 0) && (errno == ECHILD))
-        {
-            return;
-        }
-
-        /* Error */
-        if (killed < 0)
-        {
-            W_("Error, waitpid returned pid %d (%s)\n", killed,
-               strerror(errno));
-            return;
-        }
-
-        D_("sigchild(): PID %i KILLED WITH:\n"
-           "WEXITSTATUS %i\n"
-           "WIFEXITED %i\n"
-           "WIFSIGNALED %i\n"
-           "WTERMSIG %i\n"
-           "WCOREDUMP %i\n"
-           "WIFSTOPPED %i\n"
-           "WSTOPSIG %i\n"
-           "\n",
-           killed,
-           WEXITSTATUS(status),
-           WIFEXITED(status),
-           WIFSIGNALED(status),
-           WTERMSIG(status),
-           WCOREDUMP(status), WIFSTOPPED(status), WSTOPSIG(status));
-
-        /*
-         * call handle_killed_by_pid(), and will walk the active_db
-         * setting the a_status of the service touched
-         */
-        initng_kill_handler_killed_by_pid(killed, WEXITSTATUS(status));
+	/* slaying zombies */
+	do
+	{
+	    killed = waitpid(-1, &status, WNOHANG);
+	}
+	while ((killed < 0) && (errno == EINTR));
+
+	/* Nothing killed */
+	if (killed == 0)
+	{
+	    return;
+	}
+
+	/* unknown child */
+	if ((killed < 0) && (errno == ECHILD))
+	{
+	    return;
+	}
+
+	/* Error */
+	if (killed < 0)
+	{
+	    W_("Error, waitpid returned pid %d (%s)\n", killed,
+	       strerror(errno));
+	    return;
+	}
+
+	D_("sigchild(): PID %i KILLED WITH:\n"
+	   "WEXITSTATUS %i\n"
+	   "WIFEXITED %i\n"
+	   "WIFSIGNALED %i\n"
+	   "WTERMSIG %i\n"
+	   "WCOREDUMP %i\n"
+	   "WIFSTOPPED %i\n"
+	   "WSTOPSIG %i\n"
+	   "\n",
+	   killed,
+	   WEXITSTATUS(status),
+	   WIFEXITED(status),
+	   WIFSIGNALED(status),
+	   WTERMSIG(status),
+	   WCOREDUMP(status), WIFSTOPPED(status), WSTOPSIG(status));
+
+	/*
+	 * call handle_killed_by_pid(), and will walk the active_db
+	 * setting the a_status of the service touched
+	 */
+	initng_kill_handler_killed_by_pid(killed, WEXITSTATUS(status));
     }
 }
 
@@ -118,17 +118,17 @@
     /*printf("signal: %i\n", sig); */
     for (i = 0; i < SIGNAL_STACK; i++)
     {
-        /* check if this signaltype is alredy on the list of signals */
-        if (signals_got[i] == sig)
-            return;
-
-        /* else add this on a free spot */
-        if (signals_got[i] == -1)
-        {
-            /*printf("signals_got[%i]=%i\n", i, sig); */
-            signals_got[i] = sig;
-            return;
-        }
+	/* check if this signaltype is alredy on the list of signals */
+	if (signals_got[i] == sig)
+	    return;
+
+	/* else add this on a free spot */
+	if (signals_got[i] == -1)
+	{
+	    /*printf("signals_got[%i]=%i\n", i, sig); */
+	    signals_got[i] = sig;
+	    return;
+	}
     }
     F_("SIGNAL STACK FULL!\n");
 }
@@ -164,7 +164,7 @@
 
     /* clear signal */
     for (i = 0; i < SIGNAL_STACK; i++)
-        signals_got[i] = -1;
+	signals_got[i] = -1;
 
     /* SA_NOCLDSTOP = Don't give initng signal if we kill the app with SIGSTOP */
     /* SA_RESTART = call signal over again next time */
@@ -173,18 +173,18 @@
     /* segfault */
     if (g.i_am_init)
     {
-        sa.sa_handler = sigsegv;
-        sigaction(SIGSEGV, &sa, 0);
-        sigaction(SIGABRT, &sa, 0);
+	sa.sa_handler = sigsegv;
+	sigaction(SIGSEGV, &sa, 0);
+	sigaction(SIGABRT, &sa, 0);
     }
 
     sa.sa_handler = set_signal;
-    sigaction(SIGCHLD, &sa, 0);             /* Dead children */
-    sigaction(SIGINT, &sa, 0);              /* ctrl-alt-del */
-    sigaction(SIGWINCH, &sa, 0);            /* keyboard request */
-    sigaction(SIGALRM, &sa, 0);             /* alarm, something has to be checked */
-    sigaction(SIGHUP, &sa, 0);              /* sighup, plugin actions */
-    sigaction(SIGPIPE, &sa, 0);             /* sigpipe, plugin actions */
+    sigaction(SIGCHLD, &sa, 0);		    /* Dead children */
+    sigaction(SIGINT, &sa, 0);		    /* ctrl-alt-del */
+    sigaction(SIGWINCH, &sa, 0);	    /* keyboard request */
+    sigaction(SIGALRM, &sa, 0);		    /* alarm, something has to be checked */
+    sigaction(SIGHUP, &sa, 0);		    /* sighup, plugin actions */
+    sigaction(SIGPIPE, &sa, 0);		    /* sigpipe, plugin actions */
 }
 
 /* 
@@ -205,10 +205,10 @@
     sa.sa_handler = SIG_DFL;
     sigaction(SIGSEGV, &sa, 0);
     sigaction(SIGABRT, &sa, 0);
-    sigaction(SIGCHLD, &sa, 0);             /* Dead children */
-    sigaction(SIGINT, &sa, 0);              /* ctrl-alt-del */
-    sigaction(SIGWINCH, &sa, 0);            /* keyboard request */
-    sigaction(SIGALRM, &sa, 0);             /* alarm, something has to be checked */
-    sigaction(SIGHUP, &sa, 0);              /* sighup, plugin actions */
+    sigaction(SIGCHLD, &sa, 0);		    /* Dead children */
+    sigaction(SIGINT, &sa, 0);		    /* ctrl-alt-del */
+    sigaction(SIGWINCH, &sa, 0);	    /* keyboard request */
+    sigaction(SIGALRM, &sa, 0);		    /* alarm, something has to be checked */
+    sigaction(SIGHUP, &sa, 0);		    /* sighup, plugin actions */
 
 }

Modified: initng/trunk/src/initng_signal.h
==============================================================================
--- initng/trunk/src/initng_signal.h	(original)
+++ initng/trunk/src/initng_signal.h	Wed Apr  5 22:57:12 2006
@@ -21,7 +21,7 @@
 #ifndef INITNG_SIGNAL_H
 #define INITNG_SIGNAL_H
 
-#include <sys/wait.h>                       /* waitpid() sa */
+#include <sys/wait.h>			    /* waitpid() sa */
 #define SIGNAL_STACK 10
 
 extern volatile int signals_got[SIGNAL_STACK];

Modified: initng/trunk/src/initng_static_service_types.c
==============================================================================
--- initng/trunk/src/initng_static_service_types.c	(original)
+++ initng/trunk/src/initng_static_service_types.c	Wed Apr  5 22:57:12 2006
@@ -20,15 +20,15 @@
 
 #include "initng.h"
 
-#include <time.h>                           /* time() */
-#include <fcntl.h>                          /* fcntl() */
-#include <sys/un.h>                         /* memmove() strcmp() */
-#include <sys/wait.h>                       /* waitpid() sa */
-#include <linux/kd.h>                       /* KDSIGACCEPT */
-#include <sys/ioctl.h>                      /* ioctl() */
-#include <stdio.h>                          /* printf() */
-#include <stdlib.h>                         /* free() exit() */
-#include <sys/reboot.h>                     /* reboot() RB_DISABLE_CAD */
+#include <time.h>			    /* time() */
+#include <fcntl.h>			    /* fcntl() */
+#include <sys/un.h>			    /* memmove() strcmp() */
+#include <sys/wait.h>			    /* waitpid() sa */
+#include <linux/kd.h>			    /* KDSIGACCEPT */
+#include <sys/ioctl.h>			    /* ioctl() */
+#include <stdio.h>			    /* printf() */
+#include <stdlib.h>			    /* free() exit() */
+#include <sys/reboot.h>			    /* reboot() RB_DISABLE_CAD */
 #include <assert.h>
 #include <errno.h>
 

Modified: initng/trunk/src/initng_static_states.c
==============================================================================
--- initng/trunk/src/initng_static_states.c	(original)
+++ initng/trunk/src/initng_static_states.c	Wed Apr  5 22:57:12 2006
@@ -21,15 +21,15 @@
 
 #include "initng.h"
 
-#include <time.h>                           /* time() */
-#include <fcntl.h>                          /* fcntl() */
-#include <sys/un.h>                         /* memmove() strcmp() */
-#include <sys/wait.h>                       /* waitpid() sa */
-#include <linux/kd.h>                       /* KDSIGACCEPT */
-#include <sys/ioctl.h>                      /* ioctl() */
-#include <stdio.h>                          /* printf() */
-#include <stdlib.h>                         /* free() exit() */
-#include <sys/reboot.h>                     /* reboot() RB_DISABLE_CAD */
+#include <time.h>			    /* time() */
+#include <fcntl.h>			    /* fcntl() */
+#include <sys/un.h>			    /* memmove() strcmp() */
+#include <sys/wait.h>			    /* waitpid() sa */
+#include <linux/kd.h>			    /* KDSIGACCEPT */
+#include <sys/ioctl.h>			    /* ioctl() */
+#include <stdio.h>			    /* printf() */
+#include <stdlib.h>			    /* free() exit() */
+#include <sys/reboot.h>			    /* reboot() RB_DISABLE_CAD */
 #include <assert.h>
 #include <errno.h>
 

Modified: initng/trunk/src/initng_string_tools.c
==============================================================================
--- initng/trunk/src/initng_string_tools.c	(original)
+++ initng/trunk/src/initng_string_tools.c	Wed Apr  5 22:57:12 2006
@@ -55,25 +55,25 @@
     assert(buf);
 
     for (s = buf; *s; s++)
-        if (*s == '\n' || *s == ',' || *s == ';' || *s == ' ')
-            n++;
+	if (*s == '\n' || *s == ',' || *s == ';' || *s == ' ')
+	    n++;
     /* step 2: allocate space for pointers */
     v = (char **) i_calloc((n + plus), sizeof(char *));
     if (!v)
-        return 0;
+	return 0;
     w = v + ofs;
     *w++ = buf;
     for (s = buf;; s++)
     {
-        while (*s && *s != '\n' && *s != ',' && *s != ';' && *s != ' ')
-            s++;
-        if (*s == 0)
-            break;
-        if (*s == '\n' || *s == ',' || *s == ';' || *s == ' ')
-        {
-            *s = 0;
-            *w++ = s + 1;
-        }
+	while (*s && *s != '\n' && *s != ',' && *s != ';' && *s != ' ')
+	    s++;
+	if (*s == 0)
+	    break;
+	if (*s == '\n' || *s == ',' || *s == ';' || *s == ' ')
+	{
+	    *s = 0;
+	    *w++ = s + 1;
+	}
     }
     *len = w - v;
     return v;
@@ -101,26 +101,26 @@
     size_t i = 0;
 
     if (!string)
-        return (NULL);
+	return (NULL);
 
     while (string[ofs] != '\0')
     {
-        len = strcspn(string + ofs, delim);
-        if (len != 0)
-        {
-            i++;
-            array = (char **) i_realloc(array, sizeof(char *) * (i + 1));
-            array[i - 1] = string + ofs;
-            if (string[len + ofs] != '\0')
-            {
-                string[len + ofs] = '\0';
-                len++;
-            }
-        }
-        else
-            len = 1;
+	len = strcspn(string + ofs, delim);
+	if (len != 0)
+	{
+	    i++;
+	    array = (char **) i_realloc(array, sizeof(char *) * (i + 1));
+	    array[i - 1] = string + ofs;
+	    if (string[len + ofs] != '\0')
+	    {
+		string[len + ofs] = '\0';
+		len++;
+	    }
+	}
+	else
+	    len = 1;
 
-        ofs += len;
+	ofs += len;
     }
 
     array[i] = NULL;
@@ -145,17 +145,17 @@
 
     /* skip beginning first spaces */
     JUMP_SPACES(*string)
-                                                                                                        /* this might be an "comp pare" */
-                                                                                                        if
-                                                                                                        ((*string)[0] == '"' && to_cmp[0] != '"')
-        (*string)++;
+													/* this might be an "comp pare" */
+													if
+													((*string)[0] == '"' && to_cmp[0] != '"')
+	(*string)++;
 
     /* ok, strcasecmp this */
     if (strncasecmp((*string), to_cmp, chars) == 0)
     {
-        /* increase the string pointer */
-        (*string) += chars;
-        return (TRUE);
+	/* increase the string pointer */
+	(*string) += chars;
+	return (TRUE);
     }
     return (FALSE);
 }
@@ -175,40 +175,40 @@
     /* skip beginning first spaces */
     JUMP_SPACES(*string);
     if (!(*string)[0] || (*string)[0] == '\n')
-        return (NULL);
+	return (NULL);
 
     /* handle '"' chars */
     if ((*string)[0] == '"')
     {
-        (*string)++;
-        i = strcspn(*string, "\"");
-        if (i < 1)
-            return (NULL);
-        td = i_strndup(*string, i);
-        (*string) += i;
-        if (*string[0] == '"')
-            (*string)++;
-        return (td);
+	(*string)++;
+	i = strcspn(*string, "\"");
+	if (i < 1)
+	    return (NULL);
+	td = i_strndup(*string, i);
+	(*string) += i;
+	if (*string[0] == '"')
+	    (*string)++;
+	return (td);
     }
 
     /* handle '{' '}' chars */
     if ((*string)[0] == '{')
     {
-        (*string)++;
-        i = strcspn(*string, "}");
-        if (i < 1)
-            return (NULL);
-        td = i_strndup(*string, i);
-        (*string) += i;
-        if (*string[0] == '}')
-            (*string)++;
-        return (td);
+	(*string)++;
+	i = strcspn(*string, "}");
+	if (i < 1)
+	    return (NULL);
+	td = i_strndup(*string, i);
+	(*string) += i;
+	if (*string[0] == '}')
+	    (*string)++;
+	return (td);
     }
 
     /* or copy until space tab newline, ; or , */
     i = strcspn(*string, " \t\n;,");
     if (i < 1)
-        return (NULL);
+	return (NULL);
     /* copy string */
     td = i_strndup(*string, i);
     (*string) += i;
@@ -229,40 +229,40 @@
     /* skip beginning first spaces */
     JUMP_SPACES(*string);
     if (!(*string)[0] || (*string)[0] == '\n')
-        return (NULL);
+	return (NULL);
 
     /* handle '"' chars */
     if ((*string)[0] == '"')
     {
-        (*string)++;
-        i = strcspn(*string, "\"");
-        if (i < 1)
-            return (NULL);
-        td = i_strndup(*string, i);
-        (*string) += i;
-        if (*string[0] == '"')
-            (*string)++;
-        return (td);
+	(*string)++;
+	i = strcspn(*string, "\"");
+	if (i < 1)
+	    return (NULL);
+	td = i_strndup(*string, i);
+	(*string) += i;
+	if (*string[0] == '"')
+	    (*string)++;
+	return (td);
     }
 
     /* handle '{' '}' chars */
     if ((*string)[0] == '{')
     {
-        (*string)++;
-        i = strcspn(*string, "}");
-        if (i < 1)
-            return (NULL);
-        td = i_strndup(*string, i);
-        (*string) += i;
-        if (*string[0] == '}')
-            (*string)++;
-        return (td);
+	(*string)++;
+	i = strcspn(*string, "}");
+	if (i < 1)
+	    return (NULL);
+	td = i_strndup(*string, i);
+	(*string) += i;
+	if (*string[0] == '}')
+	    (*string)++;
+	return (td);
     }
 
     /* or copy until space tab newline, ; or , */
     i = strcspn(*string, "\n;");
     if (i < 1)
-        return (NULL);
+	return (NULL);
     /* copy string */
     td = i_strndup(*string, i);
     (*string) += i;
@@ -279,14 +279,14 @@
 
     /* go to end */
     while (string[i] != '\0')
-        i++;
+	i++;
 
     /* go back to the '/' char */
     while (i && string[i] != '/')
-        i--;
+	i--;
 
     if (string[i] == '/')
-        return (&string[i + 1]);
+	return (&string[i + 1]);
     return (string);
 }
 
@@ -299,13 +299,13 @@
 
     /* go to end */
     while (string[i] != '\0')
-        i++;
+	i++;
     /* step back */
     while (i && string[i] != '/')
-        i--;
+	i--;
 
     if (i)
-        return (i_strndup(string, i));
+	return (i_strndup(string, i));
 
     return (i_strdup(string));
 }
@@ -319,17 +319,17 @@
 
     /* stand on last char */
     while ((*string)[i] != '\0')
-        i++;
+	i++;
 
     /* rewind until standing on a '/' */
     while (i && (*string)[i] != '/')
-        i--;
+	i--;
 
     /* if we really are standing on a '/' */
     if ((*string)[i] == '/')
     {
-        (*string)[i] = '\0';                /* truncate */
-        return (TRUE);
+	(*string)[i] = '\0';		    /* truncate */
+	return (TRUE);
     }
     return (FALSE);
 }
@@ -350,20 +350,20 @@
     /* do pattern matching only if service name does not contain wildcards */
     if (strchr(string, '*') || strchr(string, '?'))
     {
-        F_("The string \"%s\" contains wildcards line '*' and '?'!\n",
-           string);
-        return (FALSE);
+	F_("The string \"%s\" contains wildcards line '*' and '?'!\n",
+	   string);
+	return (FALSE);
     }
 
     /* if existing service is a pattern */
     if (strchr(pattern, '*') || strchr(pattern, '?'))
     {
-        if (fnmatch(pattern, string, FNM_CASEFOLD) == 0)
+	if (fnmatch(pattern, string, FNM_CASEFOLD) == 0)
 
-        {
-            /* found */
-            return (TRUE);
-        }
+	{
+	    /* found */
+	    return (TRUE);
+	}
     }
 
     /* create service name mask for pattern matching */
@@ -375,8 +375,8 @@
 
     if (fnmatch(service_mask, pattern, FNM_CASEFOLD) == 0)
     {
-        free(service_mask);
-        return (TRUE);
+	free(service_mask);
+	return (TRUE);
     }
 
     /* did not find any */
@@ -391,16 +391,16 @@
  */
 int mprintf(char **p, const char *format, ...)
 {
-    va_list arg;                /* used for the variable lists */
+    va_list arg;		/* used for the variable lists */
 
-    int len = 0;                /* will contain lent for current string */
-    int add_len = 0;            /* This mutch more strings are we gonna alloc for */
+    int len = 0;		/* will contain lent for current string */
+    int add_len = 0;		/* This mutch more strings are we gonna alloc for */
 
     /*printf("\n\nmprintf(%s);\n", format); */
 
     /* count old chars */
     if (*p)
-        len = strlen(*p);
+	len = strlen(*p);
 
     /*
      * format contains the minimum needed chars that
@@ -417,32 +417,32 @@
      */
     /*printf("Changing size to %i\n", len + add_len); */
     if (!(*p = realloc(*p, ((len + add_len) * sizeof(char)))))
-        return (-1);
+	return (-1);
 
     /* Ok, have a try until vsnprintf succeds */
     while (1)
     {
-        /* start filling the newly allocaded area */
-        va_start(arg, format);
-        int done = vsnprintf((*p) + len, add_len, format, arg);
-
-        va_end(arg);
-
-        /* check if that was enouth */
-        if (done > -1 && done < add_len)
-        {
-            /*printf("GOOD: done : %i, len: %i\n", done, add_len); */
-
-            /* Ok return happily */
-            return (done);
-        }
-        /*printf("BAD: done : %i, len: %i\n", done, add_len); */
-
-        /* try increase it a bit. */
-        add_len = (done < 0 ? add_len * 2 : done + 1);
-        /*printf("Changing size to %i\n", len + add_len); */
-        if (!(*p = realloc(*p, ((len + add_len) * sizeof(char)))))
-            return (-1);
+	/* start filling the newly allocaded area */
+	va_start(arg, format);
+	int done = vsnprintf((*p) + len, add_len, format, arg);
+
+	va_end(arg);
+
+	/* check if that was enouth */
+	if (done > -1 && done < add_len)
+	{
+	    /*printf("GOOD: done : %i, len: %i\n", done, add_len); */
+
+	    /* Ok return happily */
+	    return (done);
+	}
+	/*printf("BAD: done : %i, len: %i\n", done, add_len); */
+
+	/* try increase it a bit. */
+	add_len = (done < 0 ? add_len * 2 : done + 1);
+	/*printf("Changing size to %i\n", len + add_len); */
+	if (!(*p = realloc(*p, ((len + add_len) * sizeof(char)))))
+	    return (-1);
 
     }
 

Modified: initng/trunk/src/initng_struct_data.c
==============================================================================
--- initng/trunk/src/initng_struct_data.c	(original)
+++ initng/trunk/src/initng_struct_data.c	Wed Apr  5 22:57:12 2006
@@ -61,7 +61,7 @@
  * by the adress struct list.
  */
 s_data *d_get_next_var(s_entry * type, const char *vn, data_head * head,
-                       s_data * last)
+		       s_data * last)
 {
     assert(head);
     struct list_head *place = NULL;
@@ -80,70 +80,70 @@
     /* Check that vn is sent, when needed */
     if (!vn && type->opt_type >= 50)
     {
-        F_("The vn variable is missing for a type %i (%s): %s!\n",
-           type->opt_type, type->opt_name);
-        return (NULL);
+	F_("The vn variable is missing for a type %i (%s): %s!\n",
+	   type->opt_type, type->opt_name);
+	return (NULL);
     }
 
     /* check that vn is not set, when not needed */
     if (vn && type->opt_type < 50)
     {
-        F_("The vn %s is set, but not needed for type %i, %s\n", vn,
-           type->opt_type, type->opt_name);
-        return (NULL);
+	F_("The vn %s is set, but not needed for type %i, %s\n", vn,
+	   type->opt_type, type->opt_name);
+	return (NULL);
     }
 #endif
 
     /* Now do the first hook if set */
     if (head->data_request && (*head->data_request) (head) == FALSE)
-        return (NULL);
+	return (NULL);
 
     /* Make sure the list is not empty */
     if (!list_empty(&head->head.list))
-        /* put place on the initial */
-        place = head->head.list.prev;
+	/* put place on the initial */
+	place = head->head.list.prev;
 
     /* as long as we dont stand on the header */
     while (place && place != &head->head.list)
     {
-        /* get the entry */
-        current = list_entry(place, s_data, list);
+	/* get the entry */
+	current = list_entry(place, s_data, list);
 
-        /* if last still set, fast forward */
-        if (last && current != last)
-        {
-            place = place->prev;
-            continue;
-        }
-
-        /* if this is the last entry */
-        if (last == current)
-        {
-            last = NULL;
-            place = place->prev;
-            continue;
-        }
-
-        /* Make sure the string variable name matches if set */
-        if (current->type == type && VN_MATCH(current->vn, vn))
-        {
-            return (current);
-        }
+	/* if last still set, fast forward */
+	if (last && current != last)
+	{
+	    place = place->prev;
+	    continue;
+	}
+
+	/* if this is the last entry */
+	if (last == current)
+	{
+	    last = NULL;
+	    place = place->prev;
+	    continue;
+	}
+
+	/* Make sure the string variable name matches if set */
+	if (current->type == type && VN_MATCH(current->vn, vn))
+	{
+	    return (current);
+	}
 
-        /* try next */
-        place = place->prev;
+	/* try next */
+	place = place->prev;
     }
 
 
     /* This second hook might fill head->res */
     if (head->res_request && (*head->res_request) (head) == FALSE)
-        return (NULL);
+	return (NULL);
 
     /* if there is any resursive next to check, do that. */
     if (head->res)
     {
-        /* ok return with that */
-        return (d_get_next_var(type, vn, head->res, last));
+	/* ok return with that */
+	return (d_get_next_var(type, vn, head->res, last));
     }
 
     /* no luck */
@@ -152,7 +152,7 @@
 
 /* returns a string pointer */
 inline const char *d_get_string_var(s_entry * type, const char *vn,
-                                    data_head * head)
+				    data_head * head)
 {
     s_data *current = d_get_next_var(type, vn, head, NULL);
 
@@ -170,7 +170,7 @@
 
 
 inline const char *d_get_next_string_var(s_entry * type, const char *vn,
-                                         data_head * d, s_data ** cur)
+					 data_head * d, s_data ** cur)
 {
     /* Temporary store string pointer here */
     const char *to_ret;
@@ -200,34 +200,34 @@
 
     if (!type)
     {
-        F_("Type can't be zero!\n");
-        return;
+	F_("Type can't be zero!\n");
+	return;
     }
 
     ALIAS_WALK;
 
     if (!vn && type->opt_type >= 50)
     {
-        F_("The vn variable is missing for a type %i %s, trying to set \"%s\"!\n", type->opt_type, type->opt_name, string);
-        return;
+	F_("The vn variable is missing for a type %i %s, trying to set \"%s\"!\n", type->opt_type, type->opt_name, string);
+	return;
     }
 
 
     if (!IT(STRING))
     {
-        F_(" \"%s\" is not an STRING type, sleeping 1 sec ..\n",
-           type->opt_name);
-        sleep(1);
-        return;
+	F_(" \"%s\" is not an STRING type, sleeping 1 sec ..\n",
+	   type->opt_name);
+	sleep(1);
+	return;
     }
 
     /* check the db, for an current entry to overwrite */
     if ((current = d_get_next_var(type, vn, d, NULL)))
     {
-        if (current->t.s)
-            free(current->t.s);
-        current->t.s = string;
-        return;
+	if (current->t.s)
+	    free(current->t.s);
+	current->t.s = string;
+	return;
     }
 
     current = (s_data *) i_calloc(1, sizeof(s_data));
@@ -244,7 +244,7 @@
 
 /* this is a function to add a string, that it can exist many of */
 void d_set_another_string_var(s_entry * type, char *vn, data_head * d,
-                              char *string)
+			      char *string)
 {
     s_data *current = NULL;
 
@@ -253,22 +253,22 @@
 
     if (!type)
     {
-        F_("Type can't be zero!\n");
-        return;
+	F_("Type can't be zero!\n");
+	return;
     }
 
     ALIAS_WALK;
 
     if (!vn && type->opt_type >= 50)
     {
-        F_("The vn variable is missing for a type %i %s, trying to set string: \"%s\"!\n", type->opt_type, type->opt_name, string);
-        return;
+	F_("The vn variable is missing for a type %i %s, trying to set string: \"%s\"!\n", type->opt_type, type->opt_name, string);
+	return;
     }
 
     if (!IT(STRINGS))
     {
-        F_(" \"%s\" is not an strings type!\n", type->opt_name);
-        return;
+	F_(" \"%s\" is not an strings type!\n", type->opt_name);
+	return;
     }
 
     current = (s_data *) i_calloc(1, sizeof(s_data));
@@ -289,31 +289,31 @@
 
     if (!type)
     {
-        F_("Type can't be zero!\n");
-        return;
+	F_("Type can't be zero!\n");
+	return;
     }
 
     ALIAS_WALK;
 
     if (!vn && type->opt_type >= 50)
     {
-        F_("The vn variable is missing for a type %i %s!\n", type->opt_type,
-           type->opt_name);
-        return;
+	F_("The vn variable is missing for a type %i %s!\n", type->opt_type,
+	   type->opt_name);
+	return;
     }
 
 
     if (!IT(INT))
     {
-        F_(" \"%s\" is not an int type!\n", type->opt_name);
-        return;
+	F_(" \"%s\" is not an int type!\n", type->opt_name);
+	return;
     }
 
     /* check the db, for an current entry to overwrite */
     if ((current = d_get_next_var(type, vn, d, NULL)))
     {
-        current->t.i = value;
-        return;
+	current->t.i = value;
+	return;
     }
 
     /* else create a new one */
@@ -350,8 +350,8 @@
     /* walk through all entries on address */
     list_for_each_entry(current, &d->head.list, list)
     {
-        if (!type || current->type == type)
-            count++;
+	if (!type || current->type == type)
+	    count++;
     }
 
     return (count);
@@ -366,28 +366,28 @@
 
     if (!type)
     {
-        F_("Type can't be zero!\n");
-        return;
+	F_("Type can't be zero!\n");
+	return;
     }
 
     ALIAS_WALK;
 
     if (!vn && type->opt_type >= 50)
     {
-        F_("The vn variable is missing for a type %i %s!\n", type->opt_type,
-           type->opt_name);
-        return;
+	F_("The vn variable is missing for a type %i %s!\n", type->opt_type,
+	   type->opt_name);
+	return;
     }
 
     if (!IT(SET))
     {
-        F_("It has to be an SET type to d_set!\n");
-        return;
+	F_("It has to be an SET type to d_set!\n");
+	return;
     }
 
     /* check if its set already */
     if (d_is_var(type, vn, d))
-        return;
+	return;
 
     /* allocate the entry */
     current = (s_data *) i_calloc(1, sizeof(s_data));
@@ -410,21 +410,21 @@
     /* free variable data */
     switch (current->type->opt_type)
     {
-        case STRING:
-        case STRINGS:
-        case VARIABLE_STRING:
-        case VARIABLE_STRINGS:
-            if (current->t.s)
-                free(current->t.s);
-            current->t.s = NULL;
-            break;
-        default:
-            break;
+	case STRING:
+	case STRINGS:
+	case VARIABLE_STRING:
+	case VARIABLE_STRINGS:
+	    if (current->t.s)
+		free(current->t.s);
+	    current->t.s = NULL;
+	    break;
+	default:
+	    break;
     }
 
     /* free variable name, if set */
     if (current->vn)
-        free(current->vn);
+	free(current->vn);
     current->vn = NULL;
 
     /* ok, free the struct */
@@ -442,14 +442,14 @@
 
     if (!type)
     {
-        F_("Type can't be zero!\n");
-        return;
+	F_("Type can't be zero!\n");
+	return;
     }
 
     while ((current = d_get_next_var(type, vn, d, s)))
     {
-        s = current;
-        d_dfree(current);
+	s = current;
+	d_dfree(current);
     }
 }
 
@@ -465,10 +465,10 @@
     /* walk through all entries on address */
     list_for_each_entry_safe(current, s, &d->head.list, list)
     {
-        /* walk, and remove all */
-        list_del(&current->list);
-        d_dfree(current);
-        current = NULL;
+	/* walk, and remove all */
+	list_del(&current->list);
+	d_dfree(current);
+	current = NULL;
     }
 
     /* make sure its cleared */
@@ -486,38 +486,38 @@
 
     list_for_each_entry(current, &from->head.list, list)
     {
-        /* make sure type is set
-           TODO, should this be an assert(current->type) ??? */
-        if (!current->type)
-            continue;
-
-        /* allocate the new one */
-        tmp = (s_data *) i_calloc(1, sizeof(s_data));
-
-        /* copy */
-        memcpy(tmp, current, sizeof(s_data));
-
-        /* copy the data */
-        switch (current->type->opt_type)
-        {
-            case STRING:
-            case STRINGS:
-            case VARIABLE_STRING:
-            case VARIABLE_STRINGS:
-                if (current->t.s)
-                    tmp->t.s = i_strdup(current->t.s);
-                break;
-            default:
-                break;
-        }
-
-        /* copy variable name */
-        if (current->vn)
-            tmp->vn = i_strdup(current->vn);
-        else
-            tmp->vn = NULL;
+	/* make sure type is set
+	   TODO, should this be an assert(current->type) ??? */
+	if (!current->type)
+	    continue;
+
+	/* allocate the new one */
+	tmp = (s_data *) i_calloc(1, sizeof(s_data));
+
+	/* copy */
+	memcpy(tmp, current, sizeof(s_data));
+
+	/* copy the data */
+	switch (current->type->opt_type)
+	{
+	    case STRING:
+	    case STRINGS:
+	    case VARIABLE_STRING:
+	    case VARIABLE_STRINGS:
+		if (current->t.s)
+		    tmp->t.s = i_strdup(current->t.s);
+		break;
+	    default:
+		break;
+	}
+
+	/* copy variable name */
+	if (current->vn)
+	    tmp->vn = i_strdup(current->vn);
+	else
+	    tmp->vn = NULL;
 
-        /* add to list */
-        list_add(&tmp->list, &to->head.list);
+	/* add to list */
+	list_add(&tmp->list, &to->head.list);
     }
 }

Modified: initng/trunk/src/initng_struct_data.h
==============================================================================
--- initng/trunk/src/initng_struct_data.h	(original)
+++ initng/trunk/src/initng_struct_data.h	Wed Apr  5 22:57:12 2006
@@ -35,15 +35,15 @@
     /* and the data that it contains */
     union
     {
-        /* by a char string */
-        char *s;
-        char *ss;
-        /* or a int value */
-        int i;
-        /* or a long value */
-        long l;
-        /* or a pointer */
-        void *p;
+	/* by a char string */
+	char *s;
+	char *ss;
+	/* or a int value */
+	int i;
+	/* or a long value */
+	long l;
+	/* or a pointer */
+	void *p;
     } t;
 
     /* the type of the data */
@@ -60,8 +60,8 @@
 
 struct s_data_head
 {
-    s_data head;                /* This is the header */
-    data_head *res;             /* When no data is found, go look in this s_data */
+    s_data head;		/* This is the header */
+    data_head *res;		/* When no data is found, go look in this s_data */
 
     /*
      * function pointers, if set this will be called first before
@@ -77,7 +77,7 @@
 
 /* data walkers */
 s_data *d_get_next_var(s_entry * type, const char *vn, data_head * head,
-                       s_data * last);
+		       s_data * last);
 #define d_get_next(type, head, last) d_get_next_var(type, NULL, head, last)
 #define get_next_var(type, vn, head, last) d_get_next_var(type, vn, &(head)->data, last)
 #define get_next(type, head, last) get_next_var(type, NULL, head, last)
@@ -136,7 +136,7 @@
  * function.
  */
 const char *d_get_next_string_var(s_entry * type, const char *vn,
-                                  data_head * d, s_data ** cur);
+				  data_head * d, s_data ** cur);
 #define get_next_string_var(type, vn, point, cur) d_get_next_string_var(type, vn, &(point)->data, cur)
 #define get_next_string(type, point, cur) get_next_string_var(type, NULL, point, cur)
 
@@ -153,7 +153,7 @@
  * set_another_string, for use with get_next_string, with entrys containing lots of strings.
  */
 void d_set_another_string_var(s_entry * type, char *vn, data_head * d,
-                              char *string);
+			      char *string);
 #define set_another_string_var(type, vn, point, string) d_set_another_string_var(type, vn, &(point)->data, string)
 #define set_another_string(type, point, string) set_another_string_var(type, NULL, point, string)
 

Modified: initng/trunk/src/initng_system_states.h
==============================================================================
--- initng/trunk/src/initng_system_states.h	(original)
+++ initng/trunk/src/initng_system_states.h	Wed Apr  5 22:57:12 2006
@@ -27,8 +27,8 @@
     STATE_STARTING = 1,
     STATE_UP = 2,
     STATE_STOPPING = 3,
-    STATE_ASE = 4,                          /* All Services Exited */
-    STATE_SERVICES_LOADED = 5,              /* This should only be changed by sys_state_services_loaded, that resets sysstate to last service afterwards. */
+    STATE_ASE = 4,			    /* All Services Exited */
+    STATE_SERVICES_LOADED = 5,		    /* This should only be changed by sys_state_services_loaded, that resets sysstate to last service afterwards. */
     STATE_EXIT = 6,
     STATE_RESTART = 7,
     STATE_SULOGIN = 8,

Modified: initng/trunk/src/initng_toolbox.c
==============================================================================
--- initng/trunk/src/initng_toolbox.c	(original)
+++ initng/trunk/src/initng_toolbox.c	Wed Apr  5 22:57:12 2006
@@ -21,11 +21,11 @@
 #include "initng.h"
 
 #define _GNU_SOURCE
-#include <stdlib.h>                         /* free() exit() */
+#include <stdlib.h>			    /* free() exit() */
 #include <stdio.h>
 #include <unistd.h>
 #include <string.h>
-#include <stdarg.h>                         /* vastart() vaend() */
+#include <stdarg.h>			    /* vastart() vaend() */
 
 #include "initng_toolbox.h"
 #include "initng_global.h"
@@ -40,8 +40,8 @@
        nmemb * size); */
     while ((alloced = calloc(nmemb, size)) == NULL)
     {
-        F_("Out of memory, trying again in 1 second\n");
-        sleep(1);
+	F_("Out of memory, trying again in 1 second\n");
+	sleep(1);
     }
     return alloced;
 }
@@ -53,9 +53,9 @@
 
     while ((alloced = realloc(ptr, size)) == NULL)
     {
-        F_("%s(): line %i Out of memory, trying again in 1 second\n",
-           func, line);
-        sleep(1);
+	F_("%s(): line %i Out of memory, trying again in 1 second\n",
+	   func, line);
+	sleep(1);
     }
     return alloced;
 }
@@ -67,9 +67,9 @@
 
     while ((alloced = strdup(s)) == NULL)
     {
-        F_("%s(): line %i Out of memory, trying again in 1 second\n",
-           func, line);
-        sleep(1);
+	F_("%s(): line %i Out of memory, trying again in 1 second\n",
+	   func, line);
+	sleep(1);
     }
     return alloced;
 }
@@ -81,9 +81,9 @@
 
     while ((alloced = strndup(s, n)) == NULL)
     {
-        F_("%s(): line %i Out of memory, trying again in 1 second\n",
-           func, line);
-        sleep(1);
+	F_("%s(): line %i Out of memory, trying again in 1 second\n",
+	   func, line);
+	sleep(1);
     }
     return alloced;
 }
@@ -116,14 +116,14 @@
     /* we can only set our name as big as the space available */
     if (g.maxproclen > len)
     {
-        memset(g.Argv0, 0, g.maxproclen);   /* clear */
-        strcpy(g.Argv0, buf);               /* copy */
-        D_("g.Argv0: %s\n", g.Argv0);
+	memset(g.Argv0, 0, g.maxproclen);   /* clear */
+	strcpy(g.Argv0, buf);		    /* copy */
+	D_("g.Argv0: %s\n", g.Argv0);
     }
     else
     {
-        len = 0;
-        D_("Cant reset own argv[0].\n");
+	len = 0;
+	D_("Cant reset own argv[0].\n");
     }
 
     free(buf);

Modified: initng/trunk/src/main.c
==============================================================================
--- initng/trunk/src/main.c	(original)
+++ initng/trunk/src/main.c	Wed Apr  5 22:57:12 2006
@@ -20,14 +20,14 @@
 
 #include "initng.h"
 
-#include <time.h>                           /* time() */
-#include <fcntl.h>                          /* fcntl() */
-#include <sys/un.h>                         /* memmove() strcmp() */
-#include <sys/wait.h>                       /* waitpid() sa */
-#include <linux/kd.h>                       /* KDSIGACCEPT */
-#include <sys/ioctl.h>                      /* ioctl() */
-#include <stdlib.h>                         /* free() exit() */
-#include <sys/reboot.h>                     /* reboot() RB_DISABLE_CAD */
+#include <time.h>			    /* time() */
+#include <fcntl.h>			    /* fcntl() */
+#include <sys/un.h>			    /* memmove() strcmp() */
+#include <sys/wait.h>			    /* waitpid() sa */
+#include <linux/kd.h>			    /* KDSIGACCEPT */
+#include <sys/ioctl.h>			    /* ioctl() */
+#include <stdlib.h>			    /* free() exit() */
+#include <sys/reboot.h>			    /* reboot() RB_DISABLE_CAD */
 #include <termios.h>
 #include <stdio.h>
 #include <sys/klog.h>
@@ -48,7 +48,7 @@
 #include "main.h"
 #include "initng_signal.h"
 #include "initng_handler.h"
-#include "initng_execute.h"                 /* new_environ() */
+#include "initng_execute.h"		    /* new_environ() */
 #include "initng_active_db.h"
 #include "initng_load_module.h"
 #include "initng_plugin_callers.h"
@@ -76,7 +76,7 @@
     FILE *cfg;
     char buf[4096];
     int seconfig = -2;
-    char *nonconst;             //Ugly hack!
+    char *nonconst;		//Ugly hack!
 
     selinux_getenforcemode(&seconfig);
 
@@ -84,143 +84,143 @@
     cfg = fopen("/proc/cmdline", "r");
     if (cfg)
     {
-        char *tmp;
+	char *tmp;
 
-        if (fgets(buf, 4096, cfg) && (tmp = strstr(buf, "enforcing=")))
-        {
-            if (tmp == buf || isspace(*(tmp - 1)))
-            {
-                enforcing = atoi(tmp + 10);
-            }
-        }
-        fclose(cfg);
+	if (fgets(buf, 4096, cfg) && (tmp = strstr(buf, "enforcing=")))
+	{
+	    if (tmp == buf || isspace(*(tmp - 1)))
+	    {
+		enforcing = atoi(tmp + 10);
+	    }
+	}
+	fclose(cfg);
     }
 #define MNT_DETACH 2
     umount2("/proc", MNT_DETACH);
 
     if (enforcing >= 0)
-        *enforce = enforcing;
+	*enforce = enforcing;
     else if (seconfig == 1)
-        *enforce = 1;
+	*enforce = 1;
 
     if (mount("none", SELINUXMNT, "selinuxfs", 0, 0) < 0)
     {
-        if (errno == ENODEV)
-        {
-            fprintf(stderr, "SELinux not supported by kernel: %s\n",
-                    strerror(errno));
-            *enforce = 0;
-        }
-        else
-        {
-            fprintf(stderr, "Failed to mount %s: %s\n", SELINUXMNT,
-                    strerror(errno));
-        }
-        return ret;
+	if (errno == ENODEV)
+	{
+	    fprintf(stderr, "SELinux not supported by kernel: %s\n",
+		    strerror(errno));
+	    *enforce = 0;
+	}
+	else
+	{
+	    fprintf(stderr, "Failed to mount %s: %s\n", SELINUXMNT,
+		    strerror(errno));
+	}
+	return ret;
     }
 
     nonconst = malloc(sizeof(SELINUXMNT));
     strcpy(nonconst, SELINUXMNT);
-    set_selinuxmnt(nonconst);               /* set manually since we mounted it */
+    set_selinuxmnt(nonconst);		    /* set manually since we mounted it */
     free(nonconst);
 
     policy_version = security_policyvers();
     if (policy_version < 0)
     {
-        fprintf(stderr, "Can't get policy version: %s\n", strerror(errno));
-        goto UMOUNT;
+	fprintf(stderr, "Can't get policy version: %s\n", strerror(errno));
+	goto UMOUNT;
     }
 
     orig_enforce = rc = security_getenforce();
     if (rc < 0)
     {
-        fprintf(stderr, "Can't get SELinux enforcement flag: %s\n",
-                strerror(errno));
-        goto UMOUNT;
+	fprintf(stderr, "Can't get SELinux enforcement flag: %s\n",
+		strerror(errno));
+	goto UMOUNT;
     }
     if (enforcing >= 0)
     {
-        *enforce = enforcing;
+	*enforce = enforcing;
     }
     else if (seconfig == -1)
     {
-        *enforce = 0;
-        rc = security_disable();
-        if (rc == 0)
-            umount(SELINUXMNT);
-        if (rc < 0)
-        {
-            rc = security_setenforce(0);
-            if (rc < 0)
-            {
-                fprintf(stderr, "Can't disable SELinux: %s\n",
-                        strerror(errno));
-                goto UMOUNT;
-            }
-        }
-        ret = 0;
-        goto UMOUNT;
+	*enforce = 0;
+	rc = security_disable();
+	if (rc == 0)
+	    umount(SELINUXMNT);
+	if (rc < 0)
+	{
+	    rc = security_setenforce(0);
+	    if (rc < 0)
+	    {
+		fprintf(stderr, "Can't disable SELinux: %s\n",
+			strerror(errno));
+		goto UMOUNT;
+	    }
+	}
+	ret = 0;
+	goto UMOUNT;
     }
     else if (seconfig >= 0)
     {
-        *enforce = seconfig;
-        if (orig_enforce != *enforce)
-        {
-            rc = security_setenforce(seconfig);
-            if (rc < 0)
-            {
-                fprintf(stderr, "Can't set SELinux enforcement flag: %s\n",
-                        strerror(errno));
-                goto UMOUNT;
-            }
-        }
+	*enforce = seconfig;
+	if (orig_enforce != *enforce)
+	{
+	    rc = security_setenforce(seconfig);
+	    if (rc < 0)
+	    {
+		fprintf(stderr, "Can't set SELinux enforcement flag: %s\n",
+			strerror(errno));
+		goto UMOUNT;
+	    }
+	}
     }
 
     snprintf(policy_file, sizeof(policy_file), "%s.%d",
-             selinux_binary_policy_path(), policy_version);
+	     selinux_binary_policy_path(), policy_version);
     fd = open(policy_file, O_RDONLY);
     if (fd < 0)
     {
-        /* Check previous version to see if old policy is available
-         */
-        snprintf(policy_file, sizeof(policy_file), "%s.%d",
-                 selinux_binary_policy_path(), policy_version - 1);
-        fd = open(policy_file, O_RDONLY);
-        if (fd < 0)
-        {
-            fprintf(stderr, "Can't open '%s.%d':  %s\n",
-                    selinux_binary_policy_path(), policy_version,
-                    strerror(errno));
-            goto UMOUNT;
-        }
+	/* Check previous version to see if old policy is available
+	 */
+	snprintf(policy_file, sizeof(policy_file), "%s.%d",
+		 selinux_binary_policy_path(), policy_version - 1);
+	fd = open(policy_file, O_RDONLY);
+	if (fd < 0)
+	{
+	    fprintf(stderr, "Can't open '%s.%d':  %s\n",
+		    selinux_binary_policy_path(), policy_version,
+		    strerror(errno));
+	    goto UMOUNT;
+	}
     }
 
     if (fstat(fd, &sb) < 0)
     {
-        fprintf(stderr, "Can't stat '%s':  %s\n",
-                policy_file, strerror(errno));
-        goto UMOUNT;
+	fprintf(stderr, "Can't stat '%s':  %s\n",
+		policy_file, strerror(errno));
+	goto UMOUNT;
     }
 
     map = mmap(NULL, sb.st_size, PROT_READ | PROT_WRITE, MAP_PRIVATE, fd, 0);
     if (map == MAP_FAILED)
     {
-        fprintf(stderr, "Can't map '%s':  %s\n",
-                policy_file, strerror(errno));
-        goto UMOUNT;
+	fprintf(stderr, "Can't map '%s':  %s\n",
+		policy_file, strerror(errno));
+	goto UMOUNT;
     }
 
 
     /* Set SELinux users based on a local.users configuration file. */
     ret = sepol_genusers(map, sb.st_size, selinux_users_path(), &data,
-                         &data_size);
+			 &data_size);
     if (ret < 0)
     {
-        fprintf(stderr,
-                "Warning!  Error while reading user configuration from %s/{local.users,system.users}:  %s\n",
-                selinux_users_path(), strerror(errno));
-        data = map;
-        data_size = sb.st_size;
+	fprintf(stderr,
+		"Warning!  Error while reading user configuration from %s/{local.users,system.users}:  %s\n",
+		selinux_users_path(), strerror(errno));
+	data = map;
+	data_size = sb.st_size;
     }
 
     /* Set booleans based on a booleans configuration file. */
@@ -230,31 +230,31 @@
     free(nonconst);
     if (ret < 0)
     {
-        if (errno == ENOENT || errno == EINVAL)
-        {
-            /* No booleans file or stale booleans in the file; non-fatal. */
-            fprintf(stderr, "Warning!  Error while setting booleans:  %s\n",
-                    strerror(errno));
-        }
-        else
-        {
-            fprintf(stderr, "Error while setting booleans:  %s\n",
-                    strerror(errno));
-            goto UMOUNT;
-        }
+	if (errno == ENOENT || errno == EINVAL)
+	{
+	    /* No booleans file or stale booleans in the file; non-fatal. */
+	    fprintf(stderr, "Warning!  Error while setting booleans:  %s\n",
+		    strerror(errno));
+	}
+	else
+	{
+	    fprintf(stderr, "Error while setting booleans:  %s\n",
+		    strerror(errno));
+	    goto UMOUNT;
+	}
     }
     fprintf(stderr, "Loading security policy\n");
     ret = security_load_policy(data, data_size);
     if (ret < 0)
     {
-        fprintf(stderr, "security_load_policy failed\n");
+	fprintf(stderr, "security_load_policy failed\n");
     }
 
   UMOUNT:
     /*umount(SELINUXMNT); */
     if (fd >= 0)
     {
-        close(fd);
+	close(fd);
     }
     return (ret);
 }
@@ -263,7 +263,7 @@
 
 static void setup_console(void)
 {
-    int fd;                     /* /dev/console */
+    int fd;			/* /dev/console */
     struct termios tty;
 
     D_("MAIN_SET_I_AM_INIT_STUFF\n");
@@ -271,8 +271,8 @@
     /* change dir to / */
     while (chdir("/") < 0)
     {
-        F_("Cant chdir to \"/\"\n");
-        initng_main_su_login();
+	F_("Cant chdir to \"/\"\n");
+	initng_main_su_login();
     }
 
     /* set console loglevel */
@@ -281,33 +281,33 @@
 
     /* enable generation of core files */
     {
-        struct rlimit c = { 1000000, 1000000 };
-        setrlimit(RLIMIT_CORE, &c);
+	struct rlimit c = { 1000000, 1000000 };
+	setrlimit(RLIMIT_CORE, &c);
     }
 
-    reboot(RB_DISABLE_CAD);                 /* Disable Ctrl + Alt + Delete */
+    reboot(RB_DISABLE_CAD);		    /* Disable Ctrl + Alt + Delete */
 
     /* open the console */
     if (g.dev_console)
     {
-        fd = open(g.dev_console, O_RDWR | O_NOCTTY);
+	fd = open(g.dev_console, O_RDWR | O_NOCTTY);
     }
     else
     {
-        fd = open(INITNG_CONSOLE, O_RDWR | O_NOCTTY);
+	fd = open(INITNG_CONSOLE, O_RDWR | O_NOCTTY);
     }
 
     /* Try to open the console, but don't control it */
     if (fd > 0)
     {
-        D_("Opened " INITNG_CONSOLE ". Setting terminal options.\n");
-        ioctl(fd, KDSIGACCEPT, SIGWINCH);   /* Accept signals from 'kbd' */
-        close(fd);                          /* Like Ctrl + Alt + Delete signal? */
+	D_("Opened " INITNG_CONSOLE ". Setting terminal options.\n");
+	ioctl(fd, KDSIGACCEPT, SIGWINCH);   /* Accept signals from 'kbd' */
+	close(fd);			    /* Like Ctrl + Alt + Delete signal? */
     }
     else
     {
-        D_("Failed to open " INITNG_CONSOLE ". Setting options anyway.\n");
-        ioctl(0, KDSIGACCEPT, SIGWINCH);    /* Accept signals from 'kbd' */
+	D_("Failed to open " INITNG_CONSOLE ". Setting options anyway.\n");
+	ioctl(0, KDSIGACCEPT, SIGWINCH);    /* Accept signals from 'kbd' */
     }
 
     /* TODO: this block may be incorrect or incomplete */
@@ -319,7 +319,7 @@
      */
     if ((fd = open("/dev/console", O_RDWR | O_NOCTTY)) < 0)
     {
-        F_("main(): can't open /dev/console.\n");
+	F_("main(): can't open /dev/console.\n");
     }
 
     (void) tcgetattr(fd, &tty);
@@ -327,16 +327,16 @@
     tty.c_cflag &= CBAUD | CBAUDEX | CSIZE | CSTOPB | PARENB | PARODD;
     tty.c_cflag |= HUPCL | CLOCAL | CREAD;
 
-    tty.c_cc[VINTR] = 3;                    /* ctrl('c') */
-    tty.c_cc[VQUIT] = 28;                   /* ctrl('\\') */
+    tty.c_cc[VINTR] = 3;		    /* ctrl('c') */
+    tty.c_cc[VQUIT] = 28;		    /* ctrl('\\') */
     tty.c_cc[VERASE] = 127;
-    tty.c_cc[VKILL] = 24;                   /* ctrl('x') */
-    tty.c_cc[VEOF] = 4;                     /* ctrl('d') */
+    tty.c_cc[VKILL] = 24;		    /* ctrl('x') */
+    tty.c_cc[VEOF] = 4;			    /* ctrl('d') */
     tty.c_cc[VTIME] = 0;
     tty.c_cc[VMIN] = 1;
-    tty.c_cc[VSTART] = 17;                  /* ctrl('q') */
-    tty.c_cc[VSTOP] = 19;                   /* ctrl('s') */
-    tty.c_cc[VSUSP] = 26;                   /* ctrl('z') */
+    tty.c_cc[VSTART] = 17;		    /* ctrl('q') */
+    tty.c_cc[VSTOP] = 19;		    /* ctrl('s') */
+    tty.c_cc[VSUSP] = 26;		    /* ctrl('z') */
 
     /*
      *      Set pre and post processing
@@ -367,39 +367,39 @@
 int main(int argc, char *argv[], char *env[])
 {
 #endif
-    struct timeval last;        /* save the time here */
+    struct timeval last;	/* save the time here */
     int retval;
 
 #ifdef DEBUG
-    int loop_counter = 0;       /* counts how many times the main_loop has run */
+    int loop_counter = 0;	/* counts how many times the main_loop has run */
 #endif
 #ifdef SELINUX
     if ((fopen("/selinux/enforce", "r")) != NULL)
-        goto BOOT;
+	goto BOOT;
     int enforce = -1;
     char *nonconst;
 
     if (getenv("SELINUX_INIT") == NULL)
     {
-        nonconst = malloc(sizeof("SELINUX_INIT=YES"));
-        strcpy(nonconst, "SELINUX_INIT=YES");
-        putenv(nonconst);
-        free(nonconst);
-        if (load_policy(&enforce) == 0)
-        {
-            execv(argv[0], argv);
-        }
-        else
-        {
-            if (enforce > 0)
-            {
-                /* SELinux in enforcing mode but load_policy failed */
-                /* At this point, we probably can't open /dev/console, so log() won't work */
-                fprintf(stderr,
-                        "Enforcing mode requested but no policy loaded. Halting now.\n");
-                exit(1);
-            }
-        }
+	nonconst = malloc(sizeof("SELINUX_INIT=YES"));
+	strcpy(nonconst, "SELINUX_INIT=YES");
+	putenv(nonconst);
+	free(nonconst);
+	if (load_policy(&enforce) == 0)
+	{
+	    execv(argv[0], argv);
+	}
+	else
+	{
+	    if (enforce > 0)
+	    {
+		/* SELinux in enforcing mode but load_policy failed */
+		/* At this point, we probably can't open /dev/console, so log() won't work */
+		fprintf(stderr,
+			"Enforcing mode requested but no policy loaded. Halting now.\n");
+		exit(1);
+	    }
+	}
     }
 
   BOOT:
@@ -410,9 +410,9 @@
     /* maby initng is launched only for getting the version */
     if (argv[1] && strcmp(argv[1], "--version") == 0)
     {
-        printf("This is initng version \"" INITNG_VERSION "\", created by "
-               INITNG_CREATOR "\n");
-        exit(0);
+	printf("This is initng version \"" INITNG_VERSION "\", created by "
+	       INITNG_CREATOR "\n");
+	exit(0);
     }
 
     /* get the time */
@@ -424,62 +424,62 @@
 
     /* set i_am_init if pid == 1 */
     if (getpid() == 1)
-        g.i_am_init = TRUE;
+	g.i_am_init = TRUE;
     else
     {
-        W_("Initng is running in fake-mode, fake-default runlevel will be started instead.\n");
+	W_("Initng is running in fake-mode, fake-default runlevel will be started instead.\n");
     }
 
     if (getuid() != 0)
     {
-        W_("Initng is designed to run as root user, a lot of functionality will not work correctly.\n");
+	W_("Initng is designed to run as root user, a lot of functionality will not work correctly.\n");
     }
 
     /* if this is real init */
     if (g.i_am_init)
     {
-        /* when last service stopped, offer a sulogin */
-        g.when_out = THEN_SULOGIN;
-        if (!g.runlevel)
-            initng_main_set_runlevel("default");
-
-        if (!g.hot_reload)
-        {
-            /* static function above, initialize the system */
-            setup_console();
-        }
+	/* when last service stopped, offer a sulogin */
+	g.when_out = THEN_SULOGIN;
+	if (!g.runlevel)
+	    initng_main_set_runlevel("default");
+
+	if (!g.hot_reload)
+	{
+	    /* static function above, initialize the system */
+	    setup_console();
+	}
 
     }
     else
     {
-        /* when last service stopped, quit initng */
-        g.when_out = THEN_QUIT;
-        initng_main_set_runlevel("fake-default");
+	/* when last service stopped, quit initng */
+	g.when_out = THEN_QUIT;
+	initng_main_set_runlevel("fake-default");
     }
 
     D_("MAIN_LOAD_MODULES\n");
     /* Load modules, if fails - launch sulogin and then try again */
     if (!initng_load_module_load_all())
     {
-        /* if we can't load modules, revert to single-user login */
-        initng_main_su_login();
+	/* if we can't load modules, revert to single-user login */
+	initng_main_su_login();
     }
 
     if (g.hot_reload)
     {
-        /* Mark service as up */
-        retval = initng_plugin_callers_reload_active_db();
-        if (retval != TRUE)
-        {
-            if (retval == FALSE)
-                F_("No plugin handled hot_reload!\n");
-            else
-                F_("Hot reload failed!\n");
-
-            /* if the hot reload failed, we're probably in big trouble */
-            initng_main_su_login();
-        }
-        initng_main_set_sys_state(STATE_UP);
+	/* Mark service as up */
+	retval = initng_plugin_callers_reload_active_db();
+	if (retval != TRUE)
+	{
+	    if (retval == FALSE)
+		F_("No plugin handled hot_reload!\n");
+	    else
+		F_("Hot reload failed!\n");
+
+	    /* if the hot reload failed, we're probably in big trouble */
+	    initng_main_su_login();
+	}
+	initng_main_set_sys_state(STATE_UP);
     }
 
     /* set title of initng, can be watched in ps -ax */
@@ -492,204 +492,204 @@
     /* make sure this is not a hot reload */
     if (!g.hot_reload)
     {
-        /* change system state */
-        initng_main_set_sys_state(STATE_STARTING);
+	/* change system state */
+	initng_main_set_sys_state(STATE_STARTING);
 
-        /* first start all services, prompted at boot with +daemon/test */
-        initng_main_start_extra_services();
+	/* first start all services, prompted at boot with +daemon/test */
+	initng_main_start_extra_services();
 
-        /* try load the default service, if it fails - launch sulogin and try again */
-        if (!initng_handler_start_new_service_named(g.runlevel))
-        {
-            F_("Failed to load runlevel (%s)!\n", g.runlevel);
-            initng_main_su_login();
-        }
+	/* try load the default service, if it fails - launch sulogin and try again */
+	if (!initng_handler_start_new_service_named(g.runlevel))
+	{
+	    F_("Failed to load runlevel (%s)!\n", g.runlevel);
+	    initng_main_su_login();
+	}
     }
 
     D_("MAIN_GOING_MAIN_LOOP\n");
     /* %%%%%%%%%%%%%%%   MAIN LOOP   %%%%%%%%%%%%%%% */
     for (;;)
     {
-        D_("MAIN_LOOP: %i\n", loop_counter++);
+	D_("MAIN_LOOP: %i\n", loop_counter++);
 
-        /* Update current time, save this in global so we don't need to call time() that often. */
-        gettimeofday(&g.now, NULL);
+	/* Update current time, save this in global so we don't need to call time() that often. */
+	gettimeofday(&g.now, NULL);
 
-        /*
-         * If it has gone more then 1h since last
-         * main loop, or if clock has gone backwards,
-         * reset it.
-         */
-        if ((g.now.tv_sec - last.tv_sec) >= 3600
-            || (g.now.tv_sec - last.tv_sec) < 0)
-        {
-            D_(" Clock skew, time have changed over one hour, in one mainloop, compensating 3600 seconds.\n");
-            initng_active_db_compensate_time(g.now.tv_sec - last.tv_sec);
-            initng_plugin_callers_compensate_time(g.now.tv_sec - last.tv_sec);
-            last.tv_sec += (g.now.tv_sec - last.tv_sec);
-        }
-        /* put last time, to current time last = g.now; */
-        memcpy(&last, &g.now, sizeof(struct timeval));
-
-
-        /* if a sleep is set */
-        if (g.sleep_seconds != 0)
-        {
-            /* Reset the sleep counter, to sleep forever. */
-            g.sleep_seconds = 0;
-
-            /* Set g.interrupt because the timeout was
-             * limited bu initng_global_set_sleep()
-             */
-            /* should only be set when a service changes its state
-               initng_global_set_interrupt(); */
-
-        }
-
-        /* run state alarm if timeout */
-        /*
-         * Run all alarm state callers.
-         * If there is more later alarms, this will set new ones.
-         */
-        if (g.next_alarm && g.next_alarm <= g.now.tv_sec)
-            initng_handler_run_alarm();
-
-        /* handle signals */
-        {
-            int i;
-
-            for (i = 0; i < SIGNAL_STACK; i++)
-            {
-                if (signals_got[i] == -1)
-                    continue;
-
-                initng_plugin_callers_signal(signals_got[i]);
-
-                switch (signals_got[i])
-                {
-                        /* dead children */
-                    case SIGCHLD:
-                        initng_signal_handle_sigchild();
-                        break;
-                    case SIGALRM:
-                        /*initng_plugin_callers_alarm(); */
-                        initng_handler_run_alarm();
-                        break;
-                    case SIGHUP:
-                        /* Check timers plug-ins */
-                        /*initng_plugin_callers_hup(); */
-                        break;
-                    case SIGPIPE:
-                        /*initng_plugin_callers_pipe(); */
-                        break;
-                    case SIGINT:
-                        /* call hook */
-                        /* initng_plugin_callers_ctrlaltdel(); */
-                        break;
-                    case SIGWINCH:
-                        D_("I got a keyboard request!\n");
-                        if (!initng_handler_start_new_service_named("kbreq"))
-                            F_("keyboard requires service \"kbreq\", could not be launched.\n");
-                        break;
-                }
-                /* reset the signal */
-                signals_got[i] = -1;
-            }
-
-        }
-
-
-        /* 
-         * g.interrupt is set when a service changes its state.
-         *
-         * When g.interrupt is set, we are going to launch all handlers,
-         * for all services, its in here there is actually happen
-         * something.
-         *
-         * It is a while loop, because it will probably reset g.interrupt
-         * many times, so this would be like a mini main-loop.
-         */
-        while (g.interrupt == TRUE)
-        {
-            D_("Resetting g.interrupt = FALSE\n");
-            g.interrupt = FALSE;
-            initng_handler_run_interrupt_handlers();
-            D_("mini loop (will continue as long as interrupt is set)\n");
-        }
-
-        /* If there is modules to unload, handle this */
-        if (g.modules_to_unload == TRUE)
-        {
-            g.modules_to_unload = FALSE;
-            D_("There is modules to unload!\n");
-            initng_unload_module_unload_marked();
-        }
-
-
-        /*
-         * After here i put things that should be done every main
-         * loop, g.interrupt or not ...
-         */
-
-        /*
-         * call the main_hooks in all plug-ins.
-         * OBS! This part in mainloop is expensive.
-         */
-        {
-            s_call *current, *q = NULL;
-
-            while_list_safe(current, &g.MAIN, q)
-            {
-                (*current->c.main) ();
-            }
-        }
-
-
-        /*
-         * Check if there are any running processes left, otherwise quit, when_out try to do something when this happens.
-         *
-         * This check is also expensive.
-         */
-        if (initng_main_ready_to_quit() == TRUE)
-        {
-            initng_main_set_sys_state(STATE_ASE);
-            P_(" *** Last service has quit. ***\n");
-            initng_main_when_out();
-            continue;
-        }
-
-        /*
-         * Run this to clean the active_db out from down services.
-         */
-        initng_active_db_clean_down();
-
-        /* figure out how long we can sleep */
-        {
-            /* set it to default */
-            int closest_timeout = TIMEOUT;
-
-            /* if sleepseconds are set */
-            if (g.sleep_seconds && g.sleep_seconds < closest_timeout)
-                closest_timeout = g.sleep_seconds;
-
-            /* Check how many seconds there are to the state alarm */
-            if (g.next_alarm && g.next_alarm > g.now.tv_sec)
-            {
-                int time_to_next = g.next_alarm - g.now.tv_sec;
-
-                D_("g.next_alarm is set!, will trigger in %i sec.\n",
-                   time_to_next);
-                if (time_to_next < closest_timeout)
-                    closest_timeout = time_to_next;
-            }
-
-            /* if we got some seconds */
-            if (closest_timeout > 0 && g.interrupt == FALSE)
-            {
-                /* do a poll == the same as sleep but also watch fds */
-                D_("Will sleep for %i seconds.\n", closest_timeout);
-                initng_fd_plugin_poll(closest_timeout);
-            }
-        }
-    }                                       /* End main loop */
+	/*
+	 * If it has gone more then 1h since last
+	 * main loop, or if clock has gone backwards,
+	 * reset it.
+	 */
+	if ((g.now.tv_sec - last.tv_sec) >= 3600
+	    || (g.now.tv_sec - last.tv_sec) < 0)
+	{
+	    D_(" Clock skew, time have changed over one hour, in one mainloop, compensating 3600 seconds.\n");
+	    initng_active_db_compensate_time(g.now.tv_sec - last.tv_sec);
+	    initng_plugin_callers_compensate_time(g.now.tv_sec - last.tv_sec);
+	    last.tv_sec += (g.now.tv_sec - last.tv_sec);
+	}
+	/* put last time, to current time last = g.now; */
+	memcpy(&last, &g.now, sizeof(struct timeval));
+
+
+	/* if a sleep is set */
+	if (g.sleep_seconds != 0)
+	{
+	    /* Reset the sleep counter, to sleep forever. */
+	    g.sleep_seconds = 0;
+
+	    /* Set g.interrupt because the timeout was
+	     * limited bu initng_global_set_sleep()
+	     */
+	    /* should only be set when a service changes its state
+	       initng_global_set_interrupt(); */
+
+	}
+
+	/* run state alarm if timeout */
+	/*
+	 * Run all alarm state callers.
+	 * If there is more later alarms, this will set new ones.
+	 */
+	if (g.next_alarm && g.next_alarm <= g.now.tv_sec)
+	    initng_handler_run_alarm();
+
+	/* handle signals */
+	{
+	    int i;
+
+	    for (i = 0; i < SIGNAL_STACK; i++)
+	    {
+		if (signals_got[i] == -1)
+		    continue;
+
+		initng_plugin_callers_signal(signals_got[i]);
+
+		switch (signals_got[i])
+		{
+			/* dead children */
+		    case SIGCHLD:
+			initng_signal_handle_sigchild();
+			break;
+		    case SIGALRM:
+			/*initng_plugin_callers_alarm(); */
+			initng_handler_run_alarm();
+			break;
+		    case SIGHUP:
+			/* Check timers plug-ins */
+			/*initng_plugin_callers_hup(); */
+			break;
+		    case SIGPIPE:
+			/*initng_plugin_callers_pipe(); */
+			break;
+		    case SIGINT:
+			/* call hook */
+			/* initng_plugin_callers_ctrlaltdel(); */
+			break;
+		    case SIGWINCH:
+			D_("I got a keyboard request!\n");
+			if (!initng_handler_start_new_service_named("kbreq"))
+			    F_("keyboard requires service \"kbreq\", could not be launched.\n");
+			break;
+		}
+		/* reset the signal */
+		signals_got[i] = -1;
+	    }
+
+	}
+
+
+	/* 
+	 * g.interrupt is set when a service changes its state.
+	 *
+	 * When g.interrupt is set, we are going to launch all handlers,
+	 * for all services, its in here there is actually happen
+	 * something.
+	 *
+	 * It is a while loop, because it will probably reset g.interrupt
+	 * many times, so this would be like a mini main-loop.
+	 */
+	while (g.interrupt == TRUE)
+	{
+	    D_("Resetting g.interrupt = FALSE\n");
+	    g.interrupt = FALSE;
+	    initng_handler_run_interrupt_handlers();
+	    D_("mini loop (will continue as long as interrupt is set)\n");
+	}
+
+	/* If there is modules to unload, handle this */
+	if (g.modules_to_unload == TRUE)
+	{
+	    g.modules_to_unload = FALSE;
+	    D_("There is modules to unload!\n");
+	    initng_unload_module_unload_marked();
+	}
+
+
+	/*
+	 * After here i put things that should be done every main
+	 * loop, g.interrupt or not ...
+	 */
+
+	/*
+	 * call the main_hooks in all plug-ins.
+	 * OBS! This part in mainloop is expensive.
+	 */
+	{
+	    s_call *current, *q = NULL;
+
+	    while_list_safe(current, &g.MAIN, q)
+	    {
+		(*current->c.main) ();
+	    }
+	}
+
+
+	/*
+	 * Check if there are any running processes left, otherwise quit, when_out try to do something when this happens.
+	 *
+	 * This check is also expensive.
+	 */
+	if (initng_main_ready_to_quit() == TRUE)
+	{
+	    initng_main_set_sys_state(STATE_ASE);
+	    P_(" *** Last service has quit. ***\n");
+	    initng_main_when_out();
+	    continue;
+	}
+
+	/*
+	 * Run this to clean the active_db out from down services.
+	 */
+	initng_active_db_clean_down();
+
+	/* figure out how long we can sleep */
+	{
+	    /* set it to default */
+	    int closest_timeout = TIMEOUT;
+
+	    /* if sleepseconds are set */
+	    if (g.sleep_seconds && g.sleep_seconds < closest_timeout)
+		closest_timeout = g.sleep_seconds;
+
+	    /* Check how many seconds there are to the state alarm */
+	    if (g.next_alarm && g.next_alarm > g.now.tv_sec)
+	    {
+		int time_to_next = g.next_alarm - g.now.tv_sec;
+
+		D_("g.next_alarm is set!, will trigger in %i sec.\n",
+		   time_to_next);
+		if (time_to_next < closest_timeout)
+		    closest_timeout = time_to_next;
+	    }
+
+	    /* if we got some seconds */
+	    if (closest_timeout > 0 && g.interrupt == FALSE)
+	    {
+		/* do a poll == the same as sleep but also watch fds */
+		D_("Will sleep for %i seconds.\n", closest_timeout);
+		initng_fd_plugin_poll(closest_timeout);
+	    }
+	}
+    }					    /* End main loop */
 }

Modified: initng/trunk/tools/killall5.c
==============================================================================
--- initng/trunk/tools/killall5.c	(original)
+++ initng/trunk/tools/killall5.c	Wed Apr  5 22:57:12 2006
@@ -50,17 +50,17 @@
 /* Info about a process. */
 typedef struct proc
 {
-    char *argv0;                /* Name as found out from argv[0] */
-    char *argv0base;            /* `basename argv[1]`             */
-    char *argv1;                /* Name as found out from argv[1] */
-    char *argv1base;            /* `basename argv[1]`             */
-    char *statname;             /* the statname without braces    */
-    ino_t ino;                  /* Inode number                   */
-    dev_t dev;                  /* Device it is on                */
-    pid_t pid;                  /* Process ID.                    */
-    int sid;                    /* Session ID.                    */
-    int kernel;                 /* Kernel thread or zombie.       */
-    struct proc *next;          /* Pointer to next struct.        */
+    char *argv0;		/* Name as found out from argv[0] */
+    char *argv0base;		/* `basename argv[1]`             */
+    char *argv1;		/* Name as found out from argv[1] */
+    char *argv1base;		/* `basename argv[1]`             */
+    char *statname;		/* the statname without braces    */
+    ino_t ino;			/* Inode number                   */
+    dev_t dev;			/* Device it is on                */
+    pid_t pid;			/* Process ID.                    */
+    int sid;			/* Session ID.                    */
+    int kernel;			/* Kernel thread or zombie.       */
+    struct proc *next;		/* Pointer to next struct.        */
 } PROC;
 
 /* pid queue */
@@ -86,7 +86,7 @@
 
 int scripts_too = 0;
 
-char *progname;                 /* the name of the running program */
+char *progname;			/* the name of the running program */
 
 #ifdef __GNUC__
 __attribute__ ((format(printf, 2, 3)))
@@ -105,10 +105,10 @@
 
     if ((p = malloc(bytes)) == NULL)
     {
-        if (sent_sigstop)
-            kill(-1, SIGCONT);
-        nsyslog(LOG_ERR, "out of memory");
-        exit(1);
+	if (sent_sigstop)
+	    kill(-1, SIGCONT);
+	nsyslog(LOG_ERR, "out of memory");
+	exit(1);
     }
     return p;
 }
@@ -134,40 +134,40 @@
     if (stat("/proc/version", &st) < 0 && errno == ENOENT)
     {
 
-        /* It's not there, so mount it. */
-        if ((pid = fork()) < 0)
-        {
-            nsyslog(LOG_ERR, "cannot fork");
-            exit(1);
-        }
-        if (pid == 0)
-        {
-            /* Try a few mount binaries. */
-            execv("/sbin/mount", args);
-            execv("/bin/mount", args);
-
-            /* Okay, I give up. */
-            nsyslog(LOG_ERR, "cannot execute mount");
-            exit(1);
-        }
-        /* Wait for child. */
-        while ((rc = wait(&wst)) != pid)
-            if (rc < 0 && errno == ECHILD)
-                break;
-        if (rc != pid || WEXITSTATUS(wst) != 0)
-            nsyslog(LOG_ERR, "mount returned non-zero exit status");
+	/* It's not there, so mount it. */
+	if ((pid = fork()) < 0)
+	{
+	    nsyslog(LOG_ERR, "cannot fork");
+	    exit(1);
+	}
+	if (pid == 0)
+	{
+	    /* Try a few mount binaries. */
+	    execv("/sbin/mount", args);
+	    execv("/bin/mount", args);
+
+	    /* Okay, I give up. */
+	    nsyslog(LOG_ERR, "cannot execute mount");
+	    exit(1);
+	}
+	/* Wait for child. */
+	while ((rc = wait(&wst)) != pid)
+	    if (rc < 0 && errno == ECHILD)
+		break;
+	if (rc != pid || WEXITSTATUS(wst) != 0)
+	    nsyslog(LOG_ERR, "mount returned non-zero exit status");
 
-        did_mount = 1;
+	did_mount = 1;
     }
 
     /* See if mount succeeded. */
     if (stat("/proc/version", &st) < 0)
     {
-        if (errno == ENOENT)
-            nsyslog(LOG_ERR, "/proc not mounted, failed to mount.");
-        else
-            nsyslog(LOG_ERR, "/proc unavailable.");
-        exit(1);
+	if (errno == ENOENT)
+	    nsyslog(LOG_ERR, "/proc not mounted, failed to mount.");
+	else
+	    nsyslog(LOG_ERR, "/proc unavailable.");
+	exit(1);
     }
 
     return did_mount;
@@ -178,7 +178,7 @@
     int c = 0, f = 0;
 
     while (f < (sz - 1) && (c = fgetc(fp)) != EOF && c)
-        buf[f++] = c;
+	buf[f++] = c;
     buf[f] = 0;
 
     return (c == EOF && f == 0) ? c : f;
@@ -203,20 +203,20 @@
     /* Open the /proc directory. */
     if ((dir = opendir("/proc")) == NULL)
     {
-        nsyslog(LOG_ERR, "cannot opendir(/proc)");
-        return -1;
+	nsyslog(LOG_ERR, "cannot opendir(/proc)");
+	return -1;
     }
 
     /* Free the already existing process list. */
     n = plist;
     for (p = plist; n; p = n)
     {
-        n = p->next;
-        if (p->argv0)
-            free(p->argv0);
-        if (p->argv1)
-            free(p->argv1);
-        free(p);
+	n = p->next;
+	if (p->argv0)
+	    free(p->argv0);
+	if (p->argv1)
+	    free(p->argv1);
+	free(p);
     }
     plist = NULL;
 
@@ -224,139 +224,139 @@
     while ((d = readdir(dir)) != NULL)
     {
 
-        /* See if this is a process */
-        if ((pid = atoi(d->d_name)) == 0)
-            continue;
-
-        /* Get a PROC struct . */
-        p = (PROC *) xmalloc(sizeof(PROC));
-        memset(p, 0, sizeof(PROC));
-
-        /* Open the status file. */
-        snprintf(path, sizeof(path), "/proc/%s/stat", d->d_name);
-
-        /* Read SID & statname from it. */
-        if ((fp = fopen(path, "r")) != NULL &&
-            fgets(buf, sizeof buf, fp) != NULL)
-        {
-            /* See if name starts with '(' */
-            s = buf;
-            while (*s != ' ')
-                s++;
-            s++;
-            if (*s == '(')
-            {
-                /* Read program name. */
-                q = strrchr(buf, ')');
-                if (q == NULL)
-                {
-                    p->sid = 0;
-                    nsyslog(LOG_ERR,
-                            "can't get program name from %s\n", path);
-                    free(p);
-                    continue;
-                }
-                s++;
-            }
-            else
-            {
-                q = s;
-                while (*q != ' ')
-                    q++;
-            }
-            *q++ = 0;
-            while (*q == ' ')
-                q++;
-            p->statname = (char *) xmalloc(strlen(s) + 1);
-            strcpy(p->statname, s);
-
-            /* Get session, startcode, endcode. */
-            startcode = endcode = 0;
-            if (sscanf(q, "%*c %*d %*d %d %*d %*d %*u %*u "
-                       "%*u %*u %*u %*u %*u %*d %*d "
-                       "%*d %*d %*d %*d %*u %*u %*d "
-                       "%*u %lu %lu", &p->sid, &startcode, &endcode) != 3)
-            {
-                p->sid = 0;
-                nsyslog(LOG_ERR, "can't read sid from %s\n", path);
-                free(p);
-                continue;
-            }
-            if (startcode == 0 && endcode == 0)
-                p->kernel = 1;
-            fclose(fp);
-        }
-        else
-        {
-            if (fp != NULL)
-                fclose(fp);
-            /* Process disappeared.. */
-            free(p);
-            continue;
-        }
-
-        snprintf(path, sizeof(path), "/proc/%s/cmdline", d->d_name);
-        if ((fp = fopen(path, "r")) != NULL)
-        {
-
-            /* Now read argv[0] */
-            f = readarg(fp, buf, sizeof(buf));
-
-            if (buf[0])
-            {
-                /* Store the name into malloced memory. */
-                p->argv0 = (char *) xmalloc(f + 1);
-                strcpy(p->argv0, buf);
-
-                /* Get a pointer to the basename. */
-                p->argv0base = strrchr(p->argv0, '/');
-                if (p->argv0base != NULL)
-                    p->argv0base++;
-                else
-                    p->argv0base = p->argv0;
-            }
-
-            /* And read argv[1] */
-            while ((f = readarg(fp, buf, sizeof(buf))) != EOF)
-                if (buf[0] != '-')
-                    break;
-
-            if (buf[0])
-            {
-                /* Store the name into malloced memory. */
-                p->argv1 = (char *) xmalloc(f + 1);
-                strcpy(p->argv1, buf);
-
-                /* Get a pointer to the basename. */
-                p->argv1base = strrchr(p->argv1, '/');
-                if (p->argv1base != NULL)
-                    p->argv1base++;
-                else
-                    p->argv1base = p->argv1;
-            }
-
-            fclose(fp);
-
-        }
-        else
-        {
-            /* Process disappeared.. */
-            free(p);
-            continue;
-        }
-
-        /* Try to stat the executable. */
-        snprintf(path, sizeof(path), "/proc/%s/exe", d->d_name);
-        if (stat(path, &st) == 0)
-        {
-            p->dev = st.st_dev;
-            p->ino = st.st_ino;
-        }
-
-        /* Link it into the list. */
-        p->next = plist;
-        plist = p;
-        p->pid = pid;
+	/* See if this is a process */
+	if ((pid = atoi(d->d_name)) == 0)
+	    continue;
+
+	/* Get a PROC struct . */
+	p = (PROC *) xmalloc(sizeof(PROC));
+	memset(p, 0, sizeof(PROC));
+
+	/* Open the status file. */
+	snprintf(path, sizeof(path), "/proc/%s/stat", d->d_name);
+
+	/* Read SID & statname from it. */
+	if ((fp = fopen(path, "r")) != NULL &&
+	    fgets(buf, sizeof buf, fp) != NULL)
+	{
+	    /* See if name starts with '(' */
+	    s = buf;
+	    while (*s != ' ')
+		s++;
+	    s++;
+	    if (*s == '(')
+	    {
+		/* Read program name. */
+		q = strrchr(buf, ')');
+		if (q == NULL)
+		{
+		    p->sid = 0;
+		    nsyslog(LOG_ERR,
+			    "can't get program name from %s\n", path);
+		    free(p);
+		    continue;
+		}
+		s++;
+	    }
+	    else
+	    {
+		q = s;
+		while (*q != ' ')
+		    q++;
+	    }
+	    *q++ = 0;
+	    while (*q == ' ')
+		q++;
+	    p->statname = (char *) xmalloc(strlen(s) + 1);
+	    strcpy(p->statname, s);
+
+	    /* Get session, startcode, endcode. */
+	    startcode = endcode = 0;
+	    if (sscanf(q, "%*c %*d %*d %d %*d %*d %*u %*u "
+		       "%*u %*u %*u %*u %*u %*d %*d "
+		       "%*d %*d %*d %*d %*u %*u %*d "
+		       "%*u %lu %lu", &p->sid, &startcode, &endcode) != 3)
+	    {
+		p->sid = 0;
+		nsyslog(LOG_ERR, "can't read sid from %s\n", path);
+		free(p);
+		continue;
+	    }
+	    if (startcode == 0 && endcode == 0)
+		p->kernel = 1;
+	    fclose(fp);
+	}
+	else
+	{
+	    if (fp != NULL)
+		fclose(fp);
+	    /* Process disappeared.. */
+	    free(p);
+	    continue;
+	}
+
+	snprintf(path, sizeof(path), "/proc/%s/cmdline", d->d_name);
+	if ((fp = fopen(path, "r")) != NULL)
+	{
+
+	    /* Now read argv[0] */
+	    f = readarg(fp, buf, sizeof(buf));
+
+	    if (buf[0])
+	    {
+		/* Store the name into malloced memory. */
+		p->argv0 = (char *) xmalloc(f + 1);
+		strcpy(p->argv0, buf);
+
+		/* Get a pointer to the basename. */
+		p->argv0base = strrchr(p->argv0, '/');
+		if (p->argv0base != NULL)
+		    p->argv0base++;
+		else
+		    p->argv0base = p->argv0;
+	    }
+
+	    /* And read argv[1] */
+	    while ((f = readarg(fp, buf, sizeof(buf))) != EOF)
+		if (buf[0] != '-')
+		    break;
+
+	    if (buf[0])
+	    {
+		/* Store the name into malloced memory. */
+		p->argv1 = (char *) xmalloc(f + 1);
+		strcpy(p->argv1, buf);
+
+		/* Get a pointer to the basename. */
+		p->argv1base = strrchr(p->argv1, '/');
+		if (p->argv1base != NULL)
+		    p->argv1base++;
+		else
+		    p->argv1base = p->argv1;
+	    }
+
+	    fclose(fp);
+
+	}
+	else
+	{
+	    /* Process disappeared.. */
+	    free(p);
+	    continue;
+	}
+
+	/* Try to stat the executable. */
+	snprintf(path, sizeof(path), "/proc/%s/exe", d->d_name);
+	if (stat(path, &st) == 0)
+	{
+	    p->dev = st.st_dev;
+	    p->ino = st.st_ino;
+	}
+
+	/* Link it into the list. */
+	p->next = plist;
+	plist = p;
+	p->pid = pid;
     }
     closedir(dir);
 
@@ -386,13 +386,13 @@
 
     if (empty_q(q))
     {
-        q->head = tmp;
-        q->tail = tmp;
+	q->head = tmp;
+	q->tail = tmp;
     }
     else
     {
-        q->tail->next = tmp;
-        q->tail = tmp;
+	q->tail->next = tmp;
+	q->tail = tmp;
     }
     return 0;
 }
@@ -404,10 +404,10 @@
 
     if (!empty_q(q))
     {
-        p = q->head->proc;
-        q->head = tmp->next;
-        free(tmp);
-        return p;
+	p = q->head->proc;
+	q->head = tmp->next;
+	free(tmp);
+	return p;
     }
 
     return NULL;
@@ -426,13 +426,13 @@
 
     /* Try to stat the executable. */
     if (prog[0] == '/' && stat(prog, &st) == 0)
-        dostat++;
+	dostat++;
 
     /* Get basename of program. */
     if ((s = strrchr(prog, '/')) == NULL)
-        s = prog;
+	s = prog;
     else
-        s++;
+	s++;
 
     q = (PIDQ_HEAD *) xmalloc(sizeof(PIDQ_HEAD));
     q = init_pid_q(q);
@@ -440,47 +440,47 @@
     /* First try to find a match based on dev/ino pair. */
     if (dostat)
     {
-        for (p = plist; p; p = p->next)
-        {
-            if (p->dev == st.st_dev && p->ino == st.st_ino)
-            {
-                add_pid_to_q(q, p);
-                foundone++;
-            }
-        }
+	for (p = plist; p; p = p->next)
+	{
+	    if (p->dev == st.st_dev && p->ino == st.st_ino)
+	    {
+		add_pid_to_q(q, p);
+		foundone++;
+	    }
+	}
     }
 
     /* If we didn't find a match based on dev/ino, try the name. */
     if (!foundone)
-        for (p = plist; p; p = p->next)
-        {
-            ok = 0;
-
-            /* Compare name (both basename and full path) */
-            ok += (p->argv0 && strcmp(p->argv0, prog) == 0);
-            ok += (p->argv0 && strcmp(p->argv0base, s) == 0);
-
-            /* For scripts, compare argv[1] as well. */
-            if (scripts_too && p->argv1 &&
-                !strncmp(p->statname, p->argv1base, STATNAMELEN))
-            {
-                ok += (strcmp(p->argv1, prog) == 0);
-                ok += (strcmp(p->argv1base, s) == 0);
-            }
-
-            /*
-             *      if we have a space in argv0, process probably
-             *      used setproctitle so try statname.
-             */
-            if (strlen(s) <= STATNAMELEN &&
-                (p->argv0 == NULL ||
-                 p->argv0[0] == 0 || strchr(p->argv0, ' ')))
-            {
-                ok += (strcmp(p->statname, s) == 0);
-            }
-            if (ok)
-                add_pid_to_q(q, p);
-        }
+	for (p = plist; p; p = p->next)
+	{
+	    ok = 0;
+
+	    /* Compare name (both basename and full path) */
+	    ok += (p->argv0 && strcmp(p->argv0, prog) == 0);
+	    ok += (p->argv0 && strcmp(p->argv0base, s) == 0);
+
+	    /* For scripts, compare argv[1] as well. */
+	    if (scripts_too && p->argv1 &&
+		!strncmp(p->statname, p->argv1base, STATNAMELEN))
+	    {
+		ok += (strcmp(p->argv1, prog) == 0);
+		ok += (strcmp(p->argv1base, s) == 0);
+	    }
+
+	    /*
+	     *      if we have a space in argv0, process probably
+	     *      used setproctitle so try statname.
+	     */
+	    if (strlen(s) <= STATNAMELEN &&
+		(p->argv0 == NULL ||
+		 p->argv0[0] == 0 || strchr(p->argv0, ' ')))
+	    {
+		ok += (strcmp(p->statname, s) == 0);
+	    }
+	    if (ok)
+		add_pid_to_q(q, p);
+	}
 
     return q;
 }
@@ -505,13 +505,13 @@
 
     if (ttyname(0) == NULL)
     {
-        vsyslog(pri, fmt, args);
+	vsyslog(pri, fmt, args);
     }
     else
     {
-        fprintf(stderr, "%s: ", progname);
-        vfprintf(stderr, fmt, args);
-        fprintf(stderr, "\n");
+	fprintf(stderr, "%s: ", progname);
+	vfprintf(stderr, fmt, args);
+	fprintf(stderr, "\n");
     }
 
     va_end(args);
@@ -535,46 +535,46 @@
     int i, oind, opt, flags = 0;
 
     for (oind = PIDOF_OMITSZ - 1; oind > 0; oind--)
-        opid[oind] = 0;
+	opid[oind] = 0;
     opterr = 0;
 
     while ((opt = getopt(argc, argv, "ho:sx")) != EOF)
-        switch (opt)
-        {
-            case '?':
-                nsyslog(LOG_ERR, "invalid options on command line!\n");
-                closelog();
-                exit(1);
-            case 'o':
-                if (oind >= PIDOF_OMITSZ - 1)
-                {
-                    nsyslog(LOG_ERR, "omit pid buffer size %d "
-                            "exceeded!\n", PIDOF_OMITSZ);
-                    closelog();
-                    exit(1);
-                }
-                if (strcmp("%PPID", optarg) == 0)
-                    opid[oind] = getppid();
-                else if ((opid[oind] = atoi(optarg)) < 1)
-                {
-                    nsyslog(LOG_ERR,
-                            "illegal omit pid value (%s)!\n", optarg);
-                    closelog();
-                    exit(1);
-                }
-                oind++;
-                flags |= PIDOF_OMIT;
-                break;
-            case 's':
-                flags |= PIDOF_SINGLE;
-                break;
-            case 'x':
-                scripts_too++;
-                break;
-            default:
-                /* Nothing */
-                break;
-        }
+	switch (opt)
+	{
+	    case '?':
+		nsyslog(LOG_ERR, "invalid options on command line!\n");
+		closelog();
+		exit(1);
+	    case 'o':
+		if (oind >= PIDOF_OMITSZ - 1)
+		{
+		    nsyslog(LOG_ERR, "omit pid buffer size %d "
+			    "exceeded!\n", PIDOF_OMITSZ);
+		    closelog();
+		    exit(1);
+		}
+		if (strcmp("%PPID", optarg) == 0)
+		    opid[oind] = getppid();
+		else if ((opid[oind] = atoi(optarg)) < 1)
+		{
+		    nsyslog(LOG_ERR,
+			    "illegal omit pid value (%s)!\n", optarg);
+		    closelog();
+		    exit(1);
+		}
+		oind++;
+		flags |= PIDOF_OMIT;
+		break;
+	    case 's':
+		flags |= PIDOF_SINGLE;
+		break;
+	    case 'x':
+		scripts_too++;
+		break;
+	    default:
+		/* Nothing */
+		break;
+	}
     argc -= optind;
     argv += optind;
 
@@ -582,36 +582,36 @@
     readproc();
     for (f = 0; f < argc; f++)
     {
-        if ((q = pidof(argv[f])) != NULL)
-        {
-            spid = 0;
-            while ((p = get_next_from_pid_q(q)))
-            {
-                if (flags & PIDOF_OMIT)
-                {
-                    for (i = 0; i < oind; i++)
-                        if (opid[i] == p->pid)
-                            break;
-                    /*
-                     *      On a match, continue with
-                     *      the for loop above.
-                     */
-                    if (i < oind)
-                        continue;
-                }
-                if (flags & PIDOF_SINGLE)
-                {
-                    if (spid)
-                        continue;
-                    else
-                        spid = 1;
-                }
-                if (!first)
-                    printf(" ");
-                printf("%d", p->pid);
-                first = 0;
-            }
-        }
+	if ((q = pidof(argv[f])) != NULL)
+	{
+	    spid = 0;
+	    while ((p = get_next_from_pid_q(q)))
+	    {
+		if (flags & PIDOF_OMIT)
+		{
+		    for (i = 0; i < oind; i++)
+			if (opid[i] == p->pid)
+			    break;
+		    /*
+		     *      On a match, continue with
+		     *      the for loop above.
+		     */
+		    if (i < oind)
+			continue;
+		}
+		if (flags & PIDOF_SINGLE)
+		{
+		    if (spid)
+			continue;
+		    else
+			spid = 1;
+		}
+		if (!first)
+		    printf(" ");
+		printf("%d", p->pid);
+		first = 0;
+	    }
+	}
     }
     printf("\n");
     closelog();
@@ -629,26 +629,26 @@
 
     /* Get program name. */
     if ((progname = strrchr(argv[0], '/')) == NULL)
-        progname = argv[0];
+	progname = argv[0];
     else
-        progname++;
+	progname++;
 
     /* Now connect to syslog. */
     openlog(progname, LOG_CONS | LOG_PID, LOG_DAEMON);
 
     /* Were we called as 'pidof' ? */
     if (strcmp(progname, "pidof") == 0)
-        return main_pidof(argc, argv);
+	return main_pidof(argc, argv);
 
     /* Right, so we are "killall". */
     if (argc > 1)
     {
-        if (argc != 2)
-            usage();
-        if (argv[1][0] == '-')
-            (argv[1])++;
-        if ((sig = atoi(argv[1])) <= 0 || sig > 31)
-            usage();
+	if (argc != 2)
+	    usage();
+	if (argv[1][0] == '-')
+	    (argv[1])++;
+	if ((sig = atoi(argv[1])) <= 0 || sig > 31)
+	    usage();
     }
 
     /* First get the /proc filesystem online. */
@@ -671,16 +671,16 @@
     /* Read /proc filesystem */
     if (readproc() < 0)
     {
-        kill(-1, SIGCONT);
-        exit(1);
+	kill(-1, SIGCONT);
+	exit(1);
     }
 
     /* Now kill all processes except our session. */
     sid = (int) getsid(0);
     pid = (int) getpid();
     for (p = plist; p; p = p->next)
-        if (p->pid != pid && p->sid != sid && !p->kernel)
-            kill(p->pid, sig);
+	if (p->pid != pid && p->sid != sid && !p->kernel)
+	    kill(p->pid, sig);
 
     /* And let them continue. */
     kill(-1, SIGCONT);

Modified: initng/trunk/tools/mountpoint.c
==============================================================================
--- initng/trunk/tools/mountpoint.c	(original)
+++ initng/trunk/tools/mountpoint.c	Wed Apr  5 22:57:12 2006
@@ -32,15 +32,15 @@
     int n;
 
     if (do_lstat)
-        n = lstat(path, st);
+	n = lstat(path, st);
     else
-        n = stat(path, st);
+	n = stat(path, st);
 
     if (n != 0)
     {
-        if (!quiet)
-            fprintf(stderr, "mountpoint: %s: %s\n", path, strerror(errno));
-        return -1;
+	if (!quiet)
+	    fprintf(stderr, "mountpoint: %s: %s\n", path, strerror(errno));
+	return -1;
     }
     return 0;
 }
@@ -62,66 +62,66 @@
     int c, r;
 
     while ((c = getopt(argc, argv, "dqx")) != EOF)
-        switch (c)
-        {
-            case 'd':
-                showdev = 1;
-                break;
-            case 'q':
-                quiet = 1;
-                break;
-            case 'x':
-                xdev = 1;
-                break;
-            default:
-                usage();
-                break;
-        }
+	switch (c)
+	{
+	    case 'd':
+		showdev = 1;
+		break;
+	    case 'q':
+		quiet = 1;
+		break;
+	    case 'x':
+		xdev = 1;
+		break;
+	    default:
+		usage();
+		break;
+	}
     if (optind != argc - 1)
-        usage();
+	usage();
     path = argv[optind];
 
     if (dostat(path, &st, !xdev, quiet) < 0)
-        return 1;
+	return 1;
 
     if (xdev)
     {
 #ifdef __linux__
-        if (!S_ISBLK(st.st_mode))
+	if (!S_ISBLK(st.st_mode))
 #else
-        if (!S_ISBLK(st.st_mode) && !S_ISCHR(st.st_mode))
+	if (!S_ISBLK(st.st_mode) && !S_ISCHR(st.st_mode))
 #endif
-        {
-            if (quiet)
-                printf("\n");
-            else
-                fprintf(stderr, "mountpoint: %s: not a block device\n", path);
-            return 1;
-        }
-        printf("%u:%u\n", major(st.st_rdev), minor(st.st_rdev));
-        return 0;
+	{
+	    if (quiet)
+		printf("\n");
+	    else
+		fprintf(stderr, "mountpoint: %s: not a block device\n", path);
+	    return 1;
+	}
+	printf("%u:%u\n", major(st.st_rdev), minor(st.st_rdev));
+	return 0;
     }
 
     if (!S_ISDIR(st.st_mode))
     {
-        if (!quiet)
-            fprintf(stderr, "mountpoint: %s: not a directory\n", path);
-        return 1;
+	if (!quiet)
+	    fprintf(stderr, "mountpoint: %s: not a directory\n", path);
+	return 1;
     }
 
     memset(buf, 0, sizeof(buf));
     strncpy(buf, path, sizeof(buf) - 4);
     strcat(buf, "/..");
     if (dostat(buf, &st2, 0, quiet) < 0)
-        return 1;
+	return 1;
 
     r = (st.st_dev != st2.st_dev) || (st.st_dev == st2.st_dev
-                                      && st.st_ino == st2.st_ino);
+				      && st.st_ino == st2.st_ino);
 
     if (!quiet && !showdev)
-        printf("%s is %sa mountpoint\n", path, r ? "" : "not ");
+	printf("%s is %sa mountpoint\n", path, r ? "" : "not ");
     if (showdev)
-        printf("%u:%u\n", major(st.st_dev), minor(st.st_dev));
+	printf("%u:%u\n", major(st.st_dev), minor(st.st_dev));
 
     return r ? 0 : 1;
 }

Modified: initng/trunk/tools/sulogin.c
==============================================================================
--- initng/trunk/tools/sulogin.c	(original)
+++ initng/trunk/tools/sulogin.c	Wed Apr  5 22:57:12 2006
@@ -111,7 +111,7 @@
     int len;
 
     if (pass[0] == 0)
-        return 1;
+	return 1;
 #if CHECK_MD5
     /*
      *      3 bytes for the signature $1$
@@ -121,26 +121,26 @@
      */
     if (strncmp(pass, "$1$", 3) == 0)
     {
-        for (s = pass + 3; *s && *s != '$'; s++)
-            ;
-        if (*s++ != '$')
-            return 0;
-        len = strlen(s);
-        if (len < 22 || len > 24)
-            return 0;
+	for (s = pass + 3; *s && *s != '$'; s++)
+	    ;
+	if (*s++ != '$')
+	    return 0;
+	len = strlen(s);
+	if (len < 22 || len > 24)
+	    return 0;
 
-        return 1;
+	return 1;
     }
 #endif
 #if CHECK_DES
     if (strlen(pass) != 13)
-        return 0;
+	return 0;
     for (s = pass; *s; s++)
     {
-        if ((*s < '0' || *s > '9') &&
-            (*s < 'a' || *s > 'z') &&
-            (*s < 'A' || *s > 'Z') && *s != '.' && *s != '/')
-            return 0;
+	if ((*s < '0' || *s > '9') &&
+	    (*s < 'a' || *s > 'z') &&
+	    (*s < 'A' || *s > 'Z') && *s != '.' && *s != '/')
+	    return 0;
     }
 #endif
     return 1;
@@ -152,7 +152,7 @@
 void set(char **var, char *val)
 {
     if (val)
-        *var = val;
+	*var = val;
 }
 
 /*
@@ -173,10 +173,10 @@
      *      way using normal library calls.
      */
     if ((pw = getpwnam("root")) &&
-        !strcmp(pw->pw_passwd, "x") && (spw = getspnam("root")))
-        pw->pw_passwd = spw->sp_pwdp;
+	!strcmp(pw->pw_passwd, "x") && (spw = getspnam("root")))
+	pw->pw_passwd = spw->sp_pwdp;
     if (pw || !try_manually)
-        return pw;
+	return pw;
 
     /*
      *      If we come here, we could not retrieve the root
@@ -193,8 +193,8 @@
 
     if ((fp = fopen(F_PASSWD, "r")) == NULL)
     {
-        perror(F_PASSWD);
-        return &pwd;
+	perror(F_PASSWD);
+	return &pwd;
     }
 
     /*
@@ -202,17 +202,17 @@
      */
     while ((p = fgets(line, 256, fp)) != NULL)
     {
-        if (strncmp(line, "root:", 5) != 0)
-            continue;
-        p += 5;
-        set(&pwd.pw_passwd, strsep(&p, ":"));
-        (void) strsep(&p, ":");
-        (void) strsep(&p, ":");
-        set(&pwd.pw_gecos, strsep(&p, ":"));
-        set(&pwd.pw_dir, strsep(&p, ":"));
-        set(&pwd.pw_shell, strsep(&p, "\n"));
-        p = line;
-        break;
+	if (strncmp(line, "root:", 5) != 0)
+	    continue;
+	p += 5;
+	set(&pwd.pw_passwd, strsep(&p, ":"));
+	(void) strsep(&p, ":");
+	(void) strsep(&p, ":");
+	set(&pwd.pw_gecos, strsep(&p, ":"));
+	set(&pwd.pw_dir, strsep(&p, ":"));
+	set(&pwd.pw_shell, strsep(&p, "\n"));
+	p = line;
+	break;
     }
     fclose(fp);
 
@@ -222,11 +222,11 @@
      */
     if (p == NULL)
     {
-        fprintf(stderr, "%s: no entry for root\n", F_PASSWD);
-        return &pwd;
+	fprintf(stderr, "%s: no entry for root\n", F_PASSWD);
+	return &pwd;
     }
     if (valid(pwd.pw_passwd))
-        return &pwd;
+	return &pwd;
 
     /*
      *      The password is invalid. If there is a
@@ -235,16 +235,16 @@
     strcpy(pwd.pw_passwd, "");
     if ((fp = fopen(F_SHADOW, "r")) == NULL)
     {
-        fprintf(stderr, "%s: root password garbled\n", F_PASSWD);
-        return &pwd;
+	fprintf(stderr, "%s: root password garbled\n", F_PASSWD);
+	return &pwd;
     }
     while ((p = fgets(sline, 256, fp)) != NULL)
     {
-        if (strncmp(sline, "root:", 5) != 0)
-            continue;
-        p += 5;
-        set(&pwd.pw_passwd, strsep(&p, ":"));
-        break;
+	if (strncmp(sline, "root:", 5) != 0)
+	    continue;
+	p += 5;
+	set(&pwd.pw_passwd, strsep(&p, ":"));
+	break;
     }
     fclose(fp);
 
@@ -254,13 +254,13 @@
      */
     if (p == NULL)
     {
-        fprintf(stderr, "%s: no entry for root\n", F_SHADOW);
-        strcpy(pwd.pw_passwd, "");
+	fprintf(stderr, "%s: no entry for root\n", F_SHADOW);
+	strcpy(pwd.pw_passwd, "");
     }
     if (!valid(pwd.pw_passwd))
     {
-        fprintf(stderr, "%s: root password garbled\n", F_SHADOW);
-        strcpy(pwd.pw_passwd, "");
+	fprintf(stderr, "%s: root password garbled\n", F_SHADOW);
+	strcpy(pwd.pw_passwd, "");
     }
     return &pwd;
 }
@@ -278,9 +278,9 @@
     unsigned int i;
 
     if (crypted[0])
-        printf("Give root password for maintenance\n");
+	printf("Give root password for maintenance\n");
     else
-        printf("Press enter for maintenance\n");
+	printf("Press enter for maintenance\n");
     printf("(or type Control-D to continue): ");
     fflush(stdout);
 
@@ -296,18 +296,18 @@
     sa.sa_flags = 0;
     sigaction(SIGALRM, &sa, NULL);
     if (timeout)
-        alarm(timeout);
+	alarm(timeout);
 
     if (read(0, pass, sizeof(pass) - 1) <= 0)
-        ret = NULL;
+	ret = NULL;
     else
     {
-        for (i = 0; i < sizeof(pass) && pass[i]; i++)
-            if (pass[i] == '\r' || pass[i] == '\n')
-            {
-                pass[i] = 0;
-                break;
-            }
+	for (i = 0; i < sizeof(pass) && pass[i]; i++)
+	    if (pass[i] == '\r' || pass[i] == '\n')
+	    {
+		pass[i] = 0;
+		break;
+	    }
     }
     alarm(0);
     tcsetattr(0, TCSANOW, &old);
@@ -331,20 +331,20 @@
      */
     (void) chdir(pwd->pw_dir);
     if ((p = getenv("SUSHELL")) != NULL)
-        sushell = p;
+	sushell = p;
     else if ((p = getenv("sushell")) != NULL)
-        sushell = p;
+	sushell = p;
     else
     {
-        if (pwd->pw_shell[0])
-            sushell = pwd->pw_shell;
-        else
-            sushell = strdup(BINSH);
+	if (pwd->pw_shell[0])
+	    sushell = pwd->pw_shell;
+	else
+	    sushell = strdup(BINSH);
     }
     if ((p = strrchr(sushell, '/')) == NULL)
-        p = sushell;
+	p = sushell;
     else
-        p++;
+	p++;
     snprintf(shell, sizeof(shell), profile ? "-%s" : "%s", p);
 
     /*
@@ -355,7 +355,7 @@
     setenv("LOGNAME", "root", 1);
     setenv("USER", "root", 1);
     if (!profile)
-        setenv("SHLVL", "0", 1);
+	setenv("SHLVL", "0", 1);
 
     /*
      *      Try to execute a shell.
@@ -391,27 +391,27 @@
      */
     opterr = 0;
     while ((c = getopt(argc, argv, "ept:")) != EOF)
-        switch (c)
-        {
-            case 't':
-                timeout = atoi(optarg);
-                break;
-            case 'p':
-                profile = 1;
-                break;
-            case 'e':
-                opt_e = 1;
-                break;
-            default:
-                usage();
-                /* Do not exit! */
-                break;
-        }
+	switch (c)
+	{
+	    case 't':
+		timeout = atoi(optarg);
+		break;
+	    case 'p':
+		profile = 1;
+		break;
+	    case 'e':
+		opt_e = 1;
+		break;
+	    default:
+		usage();
+		/* Do not exit! */
+		break;
+	}
 
     if (geteuid() != 0)
     {
-        fprintf(stderr, "sulogin: only root can run sulogin.\n");
-        exit(1);
+	fprintf(stderr, "sulogin: only root can run sulogin.\n");
+	exit(1);
     }
 
     /*
@@ -421,54 +421,54 @@
     signal(SIGQUIT, SIG_IGN);
     signal(SIGTSTP, SIG_IGN);
     if (optind < argc)
-        tty = argv[optind];
+	tty = argv[optind];
     if (tty)
     {
-        if ((fd = open(tty, O_RDWR)) < 0)
-        {
-            perror(tty);
-        }
-        else if (!isatty(fd))
-        {
-            fprintf(stderr, "%s: not a tty\n", tty);
-            close(fd);
-        }
-        else
-        {
-
-            /*
-             *      Only go through this trouble if the new
-             *      tty doesn't fall in this process group.
-             */
-            pid = getpid();
-            pgrp = getpgid(0);
-            ppgrp = getpgid(getppid());
-            ioctl(fd, TIOCGPGRP, &ttypgrp);
-
-            if (pgrp != ttypgrp && ppgrp != ttypgrp)
-            {
-                if (pid != getsid(0))
-                {
-                    if (pid == getpgid(0))
-                        setpgid(0, getpgid(getppid()));
-                    setsid();
-                }
-
-                signal(SIGHUP, SIG_IGN);
-                ioctl(0, TIOCNOTTY, (char *) 1);
-                signal(SIGHUP, SIG_DFL);
-                close(0);
-                close(1);
-                close(2);
-                close(fd);
-                fd = open(tty, O_RDWR);
-                ioctl(0, TIOCSCTTY, (char *) 1);
-                dup(fd);
-                dup(fd);
-            }
-            else
-                close(fd);
-        }
+	if ((fd = open(tty, O_RDWR)) < 0)
+	{
+	    perror(tty);
+	}
+	else if (!isatty(fd))
+	{
+	    fprintf(stderr, "%s: not a tty\n", tty);
+	    close(fd);
+	}
+	else
+	{
+
+	    /*
+	     *      Only go through this trouble if the new
+	     *      tty doesn't fall in this process group.
+	     */
+	    pid = getpid();
+	    pgrp = getpgid(0);
+	    ppgrp = getpgid(getppid());
+	    ioctl(fd, TIOCGPGRP, &ttypgrp);
+
+	    if (pgrp != ttypgrp && ppgrp != ttypgrp)
+	    {
+		if (pid != getsid(0))
+		{
+		    if (pid == getpgid(0))
+			setpgid(0, getpgid(getppid()));
+		    setsid();
+		}
+
+		signal(SIGHUP, SIG_IGN);
+		ioctl(0, TIOCNOTTY, (char *) 1);
+		signal(SIGHUP, SIG_DFL);
+		close(0);
+		close(1);
+		close(2);
+		close(fd);
+		fd = open(tty, O_RDWR);
+		ioctl(0, TIOCSCTTY, (char *) 1);
+		dup(fd);
+		dup(fd);
+	    }
+	    else
+		close(fd);
+	}
     }
 
     /*
@@ -476,8 +476,8 @@
      */
     if ((pwd = getrootpwent(opt_e)) == NULL)
     {
-        fprintf(stderr, "sulogin: cannot open password database!\n");
-        sleep(2);
+	fprintf(stderr, "sulogin: cannot open password database!\n");
+	sleep(2);
     }
 
     /*
@@ -485,12 +485,12 @@
      */
     while (pwd)
     {
-        if ((p = getpasswd(pwd->pw_passwd)) == NULL)
-            break;
-        if (pwd->pw_passwd[0] == 0 ||
-            strcmp(crypt(p, pwd->pw_passwd), pwd->pw_passwd) == 0)
-            sushell(pwd);
-        printf("Login incorrect.\n");
+	if ((p = getpasswd(pwd->pw_passwd)) == NULL)
+	    break;
+	if (pwd->pw_passwd[0] == 0 ||
+	    strcmp(crypt(p, pwd->pw_passwd), pwd->pw_passwd) == 0)
+	    sushell(pwd);
+	printf("Login incorrect.\n");
     }
 
     /*


More information about the Initng-svn mailing list