simple-init

A set of init binaries for linux
git clone git://depsterr.com/git/simple-init
Log | Files | Refs | README | LICENSE

commit 5d94a0961753cb376e9f4791238197ef4c47cf3a
parent 99f4d01553f7b34240b4f2c7de572bb1c8e12a3d
Author: depsterr <depsterr@protonmail.com>
Date:   Mon,  1 Jun 2020 02:45:54 +0200

documented util.h a bit

Diffstat:
Minitscripts/util.c | 3+--
Minitscripts/util.h | 12++++++++++++
2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/initscripts/util.c b/initscripts/util.c @@ -35,8 +35,7 @@ void wait_for_children() { if (WEXITSTATUS(status) != 0 || !WIFEXITED(status)) { log_message("Child failed, dropping to shell. Exit shell to continue normally."); char* shellcmd[] = { "/bin/sh", 0 }; - int pid; - pid = spawn_process(shellcmd); + int pid = spawn_process(shellcmd); waitpid(pid, &status, 0); break; } diff --git a/initscripts/util.h b/initscripts/util.h @@ -1,17 +1,29 @@ #include <sys/wait.h> +/* Waits for children to exit. If children exit unsuccessfully it + drops the user into an emergency shell */ void wait_for_children(); +/* Runs the given argv as a new process and returns the new + process's pid */ int spawn_process(char** argv); +/* mkdir -p */ void make_path(char* path); +/* Logs message to user and kmsg/dmesg */ void log_message (char* msg); +/* Checks if a mountpoint is mounted, is not perfect and will not + work for all cases (however the uses in the unmodified program + are of course safe. */ int is_mounted(char* path); +/* like mount command */ void mount(char* options, char* type, char* device, char* mountpoint); +/* save a random seed */ void save_random_seed(); +/* load the random seed */ void load_random_seed();