import cinit from unix.schottelius.org
Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
This commit is contained in:
parent
3729fc68eb
commit
423ba10303
13396 changed files with 269468 additions and 0 deletions
31
software/cinit/browse_source/cinit-0.0.7/old/sig_chld.c
Normal file
31
software/cinit/browse_source/cinit-0.0.7/old/sig_chld.c
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <signal.h>
|
||||
|
||||
#include "cinit.h"
|
||||
|
||||
/* we are called, when a child exited */
|
||||
void sig_chld(int status)
|
||||
{
|
||||
int pstat, i = 0;
|
||||
pid_t pid;
|
||||
|
||||
/* get pid of child and its status */
|
||||
pid = waitpid(chpid,&pstat,0);
|
||||
|
||||
/* the child was either a respawed or once running process */
|
||||
|
||||
while(i < svc_list.process) {
|
||||
if(pid == svc_list.svca[i].pid) { /* found service */
|
||||
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
if( WIFEXITED(pstat) ) printf("Kind gut gestorben\n");
|
||||
|
||||
printf("kind tot %d ...\n", status);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue