|
|
|
|
@ -40,9 +40,6 @@ int active_children; |
|
|
|
|
void execute( const char *type, const char *text, const struct optstruct *opts ) |
|
|
|
|
{ |
|
|
|
|
int ret; |
|
|
|
|
#ifndef C_WINDOWS |
|
|
|
|
pid_t pid; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
if(!optget(opts, "daemon")->enabled) { |
|
|
|
|
if(sscanf(text, "EXIT_%d", &ret) == 1) { |
|
|
|
|
@ -65,7 +62,8 @@ void execute( const char *type, const char *text, const struct optstruct *opts ) |
|
|
|
|
} else |
|
|
|
|
logg("^%s: already %d processes active.\n", type, active_children); |
|
|
|
|
#else |
|
|
|
|
if ( active_children<MAX_CHILDREN ) |
|
|
|
|
if ( active_children<MAX_CHILDREN ) { |
|
|
|
|
pid_t pid; |
|
|
|
|
switch( pid=fork() ) { |
|
|
|
|
case 0: |
|
|
|
|
if ( -1==system(text) ) |
|
|
|
|
@ -79,9 +77,8 @@ void execute( const char *type, const char *text, const struct optstruct *opts ) |
|
|
|
|
default: |
|
|
|
|
active_children++; |
|
|
|
|
} |
|
|
|
|
else |
|
|
|
|
{ |
|
|
|
|
} else { |
|
|
|
|
logg("^%s: already %d processes active.\n", type, active_children); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
} |
|
|
|
|
|