[Initng-svn] r3178 - in initng/trunk: plugins/daemon plugins/find
plugins/service src
svn at initng.thinktux.net
svn at initng.thinktux.net
Fri Mar 3 12:35:03 CET 2006
Author: deac
Date: Fri Mar 3 12:35:03 2006
New Revision: 3178
Modified:
initng/trunk/plugins/daemon/initng_daemon.c
initng/trunk/plugins/find/initng_find.c
initng/trunk/plugins/service/initng_service.c
initng/trunk/src/initng_active_db.c
initng/trunk/src/initng_common.c
Log:
indent
Modified: initng/trunk/plugins/daemon/initng_daemon.c
==============================================================================
--- initng/trunk/plugins/daemon/initng_daemon.c (original)
+++ initng/trunk/plugins/daemon/initng_daemon.c Fri Mar 3 12:35:03 2006
@@ -1021,15 +1021,15 @@
return (-1);
}
- for (i = 0; i < len && ! isdigit( buf[i]); i++);
+ for (i = 0; i < len && !isdigit(buf[i]); i++) ;
for (; i < len && isdigit(buf[i]); i++)
ret = ret * 10 - '0' + buf[i];
- if( !ret && i >= len)
- F_( "bufferoverrun: no pid fetched from '%s'.", name);
- else if( ret && i >= len)
- F_( "bufferoverrun: i hope, the fetched from '%s' digits are the pid (%i).", name, ret);
+ if (!ret && i >= len)
+ F_("bufferoverrun: no pid fetched from '%s'.", name);
+ else if (ret && i >= len)
+ F_("bufferoverrun: i hope, the fetched from '%s' digits are the pid (%i).", name, ret);
return ret;
}
Modified: initng/trunk/plugins/find/initng_find.c
==============================================================================
--- initng/trunk/plugins/find/initng_find.c (original)
+++ initng/trunk/plugins/find/initng_find.c Fri Mar 3 12:35:03 2006
@@ -29,7 +29,7 @@
#include <assert.h>
#include <sys/types.h>
#include <dirent.h>
- /*#include <dirent.h> *//* opendir() closedir() */
+ /*#include <dirent.h> *//* opendir() closedir() */
#include "../../src/initng_global.h"
#include "../../src/initng_string_tools.h"
Modified: initng/trunk/plugins/service/initng_service.c
==============================================================================
--- initng/trunk/plugins/service/initng_service.c (original)
+++ initng/trunk/plugins/service/initng_service.c Fri Mar 3 12:35:03 2006
@@ -108,7 +108,9 @@
s_entry STOP_TIMEOUT = { "stop_timeout", INT, &TYPE_SERVICE,
"Let the stop process run maximum this time."
};
-s_entry NEVER_KILL = { "never_kill", SET, &TYPE_SERVICE, "This service is to important to be killed by any timeout!" };
+s_entry NEVER_KILL =
+ { "never_kill", SET, &TYPE_SERVICE,
+"This service is to important to be killed by any timeout!" };
/*
* ############################################################################
@@ -467,8 +469,8 @@
D_("Service %s, run init_SERVICE_START_RUN\n", service->name);
/* if NEVER_KILL is set, dont bother */
- if(initng_active_db_is(&NEVER_KILL, service))
- return;
+ if (initng_active_db_is(&NEVER_KILL, service))
+ return;
/* get the timeout */
timeout = initng_active_db_get_int(&START_TIMEOUT, service);
@@ -493,8 +495,8 @@
D_("Service %s, run init_SERVICE_STOP_RUN\n", service->name);
/* if NEVER_KILL is set, dont bother */
- if(initng_active_db_is(&NEVER_KILL, service))
- return;
+ if (initng_active_db_is(&NEVER_KILL, service))
+ return;
/* get the timeout */
timeout = initng_active_db_get_int(&STOP_TIMEOUT, service);
@@ -561,7 +563,7 @@
/* send the process the SIGKILL signal */
kill(process->pid, SIGKILL);
-
+
/* set service state, to a failure state */
initng_common_mark_service(service, &SERVICE_STOP_FAILED_TIMEOUT);
}
@@ -609,12 +611,12 @@
/*
* If this exited after a timeout, stay failed
*/
- if(IS_MARK(service, &SERVICE_START_FAILED_TIMEOUT))
+ if (IS_MARK(service, &SERVICE_START_FAILED_TIMEOUT))
{
list_del(&process->list);
initng_process_db_free(process);
return;
- }
+ }
/*
* If service is stopping, ignore this signal
@@ -663,12 +665,12 @@
/*
* If this exited after a timeout, stay failed
*/
- if(IS_MARK(service, &SERVICE_STOP_FAILED_TIMEOUT))
+ if (IS_MARK(service, &SERVICE_STOP_FAILED_TIMEOUT))
{
list_del(&process->list);
initng_process_db_free(process);
return;
- }
+ }
/* make sure its a STOP_RUN state */
if (!IS_MARK(service, &SERVICE_STOP_RUN))
Modified: initng/trunk/src/initng_active_db.c
==============================================================================
--- initng/trunk/src/initng_active_db.c (original)
+++ initng/trunk/src/initng_active_db.c Fri Mar 3 12:35:03 2006
@@ -342,7 +342,7 @@
current->time_current_state.tv_sec += skew;
current->time_last_state.tv_sec += skew;
current->last_rought_time.tv_sec += skew;
- current->alarm += skew;
+ current->alarm += skew;
}
}
Modified: initng/trunk/src/initng_common.c
==============================================================================
--- initng/trunk/src/initng_common.c (original)
+++ initng/trunk/src/initng_common.c Fri Mar 3 12:35:03 2006
@@ -440,40 +440,39 @@
}
}
- /* This checks if all services on a runlevel is up, then set STATE_UP */
- if (IS_UP(service))
- check_sys_state_up();
+ /* 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();
- }
+ /* 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(initng_active_db_is(&RESTARTING, service))
- {
- initng_active_db_remove(&RESTARTING, service);
- initng_handler_start_service(service);
- }
- }
- /* this will make all services, that depend of this to stop, DEP_FAILED_TO_STOP */
- /*
- if (IS_MARK(service, &FAIL_STOPPING))
- {
- #ifdef DEP_FAIL_TO_STOP
- dep_failed_to_stop(service);
- #endif
- check_sys_state_up();
- }
- */
+ /* if this service is marked restarting, please restart it if its set to STOPPED */
+ if (IS_DOWN(service))
+ {
+ if (initng_active_db_is(&RESTARTING, service))
+ {
+ initng_active_db_remove(&RESTARTING, service);
+ initng_handler_start_service(service);
+ }
+ }
+ /* this will make all services, that depend of this to stop, DEP_FAILED_TO_STOP */
+ /*
+ if (IS_MARK(service, &FAIL_STOPPING))
+ {
+ #ifdef DEP_FAIL_TO_STOP
+ dep_failed_to_stop(service);
+ #endif
+ check_sys_state_up();
+ }
+ */
}
D_("service %s is now %s.\n", service->name,
service->current_state->state_name);
return (TRUE);
}
-
More information about the Initng-svn
mailing list