www.nico.schottelius.org/software/cinit/browse_source/cinit-0.0.7/serv/chk_svc.c
Nico Schottelius 423ba10303 import cinit from unix.schottelius.org
Signed-off-by: Nico Schottelius <nico@ikn.schottelius.org>
2009-09-16 12:53:45 +02:00

23 lines
440 B
C

/*
* (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;
}