fiss-minit

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

commit 6791f905f333b038e244e20414d41d84f8ceead9
parent 33382d1b11b1a426dd5a08324012a699a283c447
Author: Friedel Schön <[email protected]>
Date:   Tue, 14 May 2024 16:52:13 +0200

static methods

Diffstat:
Mminit.c | 2+-
Mmsvc.c | 22+++++++++++-----------
2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/minit.c b/minit.c @@ -307,7 +307,7 @@ static int startnodep(int service, int pause) { return root[service].pid; } -int startservice(int service, int pause, int father) { +static int startservice(int service, int pause, int father) { int dir = -1; unsigned long len; char* s = 0; diff --git a/msvc.c b/msvc.c @@ -15,7 +15,7 @@ static char buf[1500]; #define FMT_ULONG 40 -size_t fmt_ulong(char* dest, unsigned long i) { +static size_t fmt_ulong(char* dest, unsigned long i) { register unsigned long len, tmp, len2; /* first count the number of bytes needed */ for (len = 1, tmp = i; tmp > 9; ++len) tmp /= 10; @@ -25,7 +25,7 @@ size_t fmt_ulong(char* dest, unsigned long i) { return len; } -void addservice(char* service) { +static void addservice(char* service) { char* x; if (strncmp(service, MINITROOT "/", strlen(service)) == 0) service += sizeof(MINITROOT "/") - 1; @@ -38,14 +38,14 @@ void addservice(char* service) { buf[1400] = 0; } -int addreadwrite(char* service) { +static int addreadwrite(char* service) { addservice(service); write(infd, buf, strlen(buf)); return read(outfd, buf, 1500); } /* return PID, 0 if error */ -pid_t __readpid(char* service) { +static pid_t __readpid(char* service) { int len; buf[0] = 'p'; len = addreadwrite(service); @@ -55,7 +55,7 @@ pid_t __readpid(char* service) { } /* return nonzero if error */ -int respawn(char* service, int yesno) { +static int respawn(char* service, int yesno) { int len; buf[0] = yesno ? 'R' : 'r'; len = addreadwrite(service); @@ -63,7 +63,7 @@ int respawn(char* service, int yesno) { } /* return nonzero if error */ -int setpid(char* service, pid_t pid) { +static int setpid(char* service, pid_t pid) { char* tmp; int len; buf[0] = 'P'; @@ -76,7 +76,7 @@ int setpid(char* service, pid_t pid) { } /* return nonzero if error */ -int check_remove(char* service) { +static int check_remove(char* service) { int len; buf[0] = 'C'; len = addreadwrite(service); @@ -84,7 +84,7 @@ int check_remove(char* service) { } /* return nonzero if error */ -int startservice(char* service) { +static int startservice(char* service) { int len; buf[0] = 's'; len = addreadwrite(service); @@ -92,7 +92,7 @@ int startservice(char* service) { } /* return uptime, 0 if error */ -unsigned long uptime(char* service) { +static unsigned long uptime(char* service) { int len; buf[0] = 'u'; len = addreadwrite(service); @@ -101,7 +101,7 @@ unsigned long uptime(char* service) { return atoi(buf); } -void dumphistory() { +static void dumphistory() { char tmp[16384]; int i, j; char first, last; @@ -140,7 +140,7 @@ void dumphistory() { } } -void dumpdependencies(char* service) { +static void dumpdependencies(char* service) { char tmp[16384]; int i, j; char first, last;