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
23
software/cinit/browse_source/cinit-0.0.4/serv/chk_svc.c
Normal file
23
software/cinit/browse_source/cinit-0.0.4/serv/chk_svc.c
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/*
|
||||
* (c) 2005 Nico Schottelius (nico-linux at schottelius.org)
|
||||
* chk_svc: check whether service exists
|
||||
* part of cinit
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include "cinit.h"
|
||||
|
||||
/* we are called from sigio */
|
||||
/* return SID, if service exists, else -1 */
|
||||
int chk_svc(char *svc)
|
||||
{
|
||||
int tmp = 0;
|
||||
|
||||
while(tmp < svc_list.process) {
|
||||
if( ! strcmp(svc,svc_list.svca[tmp].abs_path) ) {
|
||||
return tmp;
|
||||
}
|
||||
tmp++;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue