]> Shamusworld >> Repos - init-ng/blobdiff - init-ng.c
Added version which conforms to openrc coding guidelines.
[init-ng] / init-ng.c
index cc517777e68bc35c48546063338984709477bdd3..7dba91aeb3aa375fcbad2410753ba6928d9733c1 100644 (file)
--- a/init-ng.c
+++ b/init-ng.c
@@ -38,7 +38,7 @@ static char * args[256];      // 256 arguments ought to be enough for anybody ;-)
 // Find a process in the monitored process list (MPL) by PID. Returns the index
 // of the entry in the MPL.
 //
-int FindMonitoredPID(pid_t pid)
+static int FindMonitoredPID(pid_t pid)
 {
        for(int i=0; i<freeProcessSlot; i++)
        {
@@ -67,7 +67,7 @@ static void RemoveEntry(int entry)
 //
 // Add a process to the MPL
 //
-static void AddEntry(pid_t pid, char * name, char * command)
+static void AddEntry(pid_t pid, const char * name, const char * command)
 {
        int i;
 
@@ -90,7 +90,7 @@ static void AddEntry(pid_t pid, char * name, char * command)
 // Take a given space delimited string and turn it into an array of strings
 // suitable for execv().
 //
-static void MakeArgumentList(char * s)
+static void MakeArgumentList(const char * s)
 {
        char buf[4096];
        char * tokSave;
@@ -119,7 +119,7 @@ static void MakeArgumentList(char * s)
 // monitor: Tells Launch whether or not this process should be monitored
 //          and respawned if it goes away (0 = no, 1 = yes)
 //
-static pid_t Launch(char * name, char * command, int monitor)
+static pid_t Launch(const char * name, const char * command, int monitor)
 {
        if (verbose)
                printf("Starting %s (%smonitored)...\n", name, (monitor ? "" : "un"));
@@ -228,7 +228,7 @@ static void ShutDown(int cmd)
 //
 // Connect to PID 1's FIFO to send a command
 //
-static void DoCmd(char * cmd)
+static void DoCmd(const char * cmd)
 {
        FILE * file = fopen(fifoPath, "w");