fiss-minit

A standalone service supervisor based on minit
Log | Files | Refs | README | LICENSE

commit bca056ee652accadcce5d954ba80bcb31fde47d8
parent 303c7709b1d55726024eb450387ee2bf02b4428e
Author: leitner <leitner>
Date:   Fri, 20 Feb 2004 05:10:47 +0000

cosmetics

Diffstat:
Mminit-update.c | 1+
Mminit.c | 11++++++-----
Mmsvc.c | 7+++++--
3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/minit-update.c b/minit-update.c @@ -210,6 +210,7 @@ int main(int argc, char **argv) { } write(infd,"update",6); + sleep(1); for (i=0; i<=maxprocess; i++) { if (verbose) { diff --git a/minit.c b/minit.c @@ -455,9 +455,10 @@ int main(int argc, char *argv[]) { execve("/sbin/minit",argv, environ); } - if (((buf[0]!='U') && buf[0]!='s') && ((idx=findservice(buf+1))<0)) + if (((buf[0]!='U') && buf[0]!='s') && ((idx=findservice(buf+1))<0) + && strcmp(buf,"d-")) #else - if (buf[0]!='s' && ((idx=findservice(buf+1))<0)) + if (buf[0]!='s' && ((idx=findservice(buf+1))<0) && strcmp(buf,"d-") ) #endif error: write(outfd,"0",1); @@ -529,15 +530,15 @@ ok: write(outfd,"1:",2); { int i; -#if 0 +#if 1 printf("looking for father==%d\n",idx); #endif for (i=0; i<=maxprocess; ++i) { -#if 0 +#if 1 printf("pid of %d(%s) is %lu, father is %d\n", i,root[i].name?root[i].name:"[none]",root[i].pid,root[i].father); #endif - if (root[i].pid>1 && root[i].father==idx) + if (root[i].father==idx) write(outfd,root[i].name,str_len(root[i].name)+1); } write(outfd,"\0",2); diff --git a/msvc.c b/msvc.c @@ -112,8 +112,11 @@ void dumpdependencies(char* service) { if (!tmp[0] && last=='\n') break; } prev=i; - for (; i<j; ++i) if (!tmp[i]) tmp[i]='\n'; - if (j>1 && tmp[j-1]=='\n' && tmp[j-2]=='\n') { done=1; --j; } + for (; i<j; ++i) + if (!tmp[i]) { + tmp[i]=done?0:'\n'; + if (i<j && !tmp[i+1]) { done=1; --j; } + } if (first) write(1,tmp+2,j-2); else