diff options
Diffstat (limited to '4init')
| -rw-r--r-- | 4init/4init.c | 9 | ||||
| -rw-r--r-- | 4init/Makefile | 21 | ||||
| -rw-r--r-- | 4init/build.ninja | 41 | ||||
| -rw-r--r-- | 4init/config.h | 11 |
4 files changed, 48 insertions, 34 deletions
diff --git a/4init/4init.c b/4init/4init.c index 50807b6..14cfbba 100644 --- a/4init/4init.c +++ b/4init/4init.c @@ -8,14 +8,13 @@ #include "config.h" -static void reap(void) -{ +static void reap(void) { int status; - while (waitpid(-1, &status, WNOHANG) > 0) {} + while (waitpid(-1, &status, WNOHANG) > 0) { + } } -int main(void) -{ +int main(void) { int sigfd = -1; pid_t pid = -1; sigset_t set; diff --git a/4init/Makefile b/4init/Makefile deleted file mode 100644 index e56e105..0000000 --- a/4init/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -include config.mk - -BIN = 4init -OBJ = 4init.o - -all: $(BIN) - -$(BIN): $(OBJ) - $(CC) $(LDFLAGS) -o $@ $(OBJ) - -$(OBJ): config.h - -install: all - mkdir -pv $(DESTDIR)$(PREFIX)/bin - cp -fv $(BIN) $(DESTDIR)$(PREFIX)/bin - -uninstall: all - rm -f $(DESTDIR)$(PREFIX)/bin/$(BIN) - -clean: all - rm -f 4init.o 4init diff --git a/4init/build.ninja b/4init/build.ninja new file mode 100644 index 0000000..41f1d7d --- /dev/null +++ b/4init/build.ninja @@ -0,0 +1,41 @@ +# this file was generated from a makefile by shinobi +build __shin_always_build__: phony + +build all: phony 4init + +rule r1 + command = musl-gcc -s -static -o 4init 4init.o + generator = 1 + +build 4init: r1 4init.o + description = build 4init + +rule r2 + command = musl-gcc -std=c99 -Wextra -Wall -Os -fhardened -c 4init.c + generator = 1 + +build 4init.o: r2 4init.c config.h + description = build 4init.o + +rule r3 + command = sh -c 'mkdir -pv /usr/local/bin' && sh -c 'cp -fv 4init /usr/local/bin' + generator = 1 + +build install: r3 + description = build install + +rule r4 + command = rm -f /usr/local/bin/4init + generator = 1 + +build uninstall: r4 + description = build uninstall + +rule r5 + command = rm -f 4init.o 4init + generator = 1 + +build clean: r5 + description = build clean + +default all diff --git a/4init/config.h b/4init/config.h index 6c36ccf..3798447 100644 --- a/4init/config.h +++ b/4init/config.h @@ -3,15 +3,10 @@ static const char *rc_path = "/usr/bin/4rc"; -static char *const rc_argv[] = { - "4rc", - NULL -}; +static char *const rc_argv[] = {"4rc", NULL}; static char *const rc_envp[] = { - "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/sbin", - "TERM=linux", - NULL -}; + "PATH=/usr/local/sbin:/usr/local/bin:/usr/bin:/bin:/sbin", "TERM=linux", + NULL}; #endif // CONFIG_H |
