summaryrefslogtreecommitdiff
path: root/runit
diff options
context:
space:
mode:
Diffstat (limited to 'runit')
-rw-r--r--runit/runsv.c16
-rw-r--r--runit/runsvdir.c14
-rw-r--r--runit/svlogd.c18
3 files changed, 24 insertions, 24 deletions
diff --git a/runit/runsv.c b/runit/runsv.c
index 018a80e..03187a8 100644
--- a/runit/runsv.c
+++ b/runit/runsv.c
@@ -42,26 +42,26 @@ static char *dir;
#define usage() bb_show_usage()
-static void fatal2_cannot(char *m1, char *m2)
+static void fatal2_cannot(const char *m1, const char *m2)
{
bb_perror_msg_and_die("%s: fatal: cannot %s%s", dir, m1, m2);
/* was exiting 111 */
}
-static void fatal_cannot(char *m)
+static void fatal_cannot(const char *m)
{
fatal2_cannot(m, "");
/* was exiting 111 */
}
-static void fatal2x_cannot(char *m1, char *m2)
+static void fatal2x_cannot(const char *m1, const char *m2)
{
bb_error_msg_and_die("%s: fatal: cannot %s%s", dir, m1, m2);
/* was exiting 111 */
}
-static void warn_cannot(char *m)
+static void warn_cannot(const char *m)
{
bb_perror_msg("%s: warning: cannot %s", dir, m);
}
-static void warnx_cannot(char *m)
+static void warnx_cannot(const char *m)
{
bb_error_msg("%s: warning: cannot %s", dir, m);
}
@@ -280,12 +280,12 @@ static void startservice(struct svdir *s)
char *run[2];
if (s->state == S_FINISH)
- run[0] = "./finish";
+ run[0] = (char*)"./finish";
else {
- run[0] = "./run";
+ run[0] = (char*)"./run";
custom(s, 'u');
}
- run[1] = 0;
+ run[1] = NULL;
if (s->pid != 0) stopservice(s); /* should never happen */
while ((p = fork()) == -1) {
diff --git a/runit/runsvdir.c b/runit/runsvdir.c
index 22f2a05..7e1dd6c 100644
--- a/runit/runsvdir.c
+++ b/runit/runsvdir.c
@@ -28,20 +28,20 @@ static int exitsoon;
static int pgrp;
#define usage() bb_show_usage()
-static void fatal2_cannot(char *m1, char *m2)
+static void fatal2_cannot(const char *m1, const char *m2)
{
bb_perror_msg_and_die("%s: fatal: cannot %s%s", svdir, m1, m2);
/* was exiting 100 */
}
-static void warn3x(char *m1, char *m2, char *m3)
+static void warn3x(const char *m1, const char *m2, const char *m3)
{
bb_error_msg("%s: warning: %s%s%s", svdir, m1, m2, m3);
}
-static void warn2_cannot(char *m1, char *m2)
+static void warn2_cannot(const char *m1, const char *m2)
{
warn3x("cannot ", m1, m2);
}
-static void warnx(char *m1)
+static void warnx(const char *m1)
{
warn3x(m1, "", "");
}
@@ -55,7 +55,7 @@ static void s_hangup(int sig_no)
exitsoon = 2;
}
-static void runsv(int no, char *name)
+static void runsv(int no, const char *name)
{
int pid = fork();
@@ -67,8 +67,8 @@ static void runsv(int no, char *name)
/* child */
char *prog[3];
- prog[0] = "runsv";
- prog[1] = name;
+ prog[0] = (char*)"runsv";
+ prog[1] = (char*)name;
prog[2] = NULL;
sig_uncatch(SIGHUP);
sig_uncatch(SIGTERM);
diff --git a/runit/svlogd.c b/runit/svlogd.c
index 41a7c86..59b1e57 100644
--- a/runit/svlogd.c
+++ b/runit/svlogd.c
@@ -75,7 +75,7 @@ static struct logdir {
char match;
char matcherr;
} *dir;
-static unsigned dirn = 0;
+static unsigned dirn;
#define FATAL "fatal: "
#define WARNING "warning: "
@@ -83,18 +83,18 @@ static unsigned dirn = 0;
#define INFO "info: "
#define usage() bb_show_usage()
-static void fatalx(char *m0)
+static void fatalx(const char *m0)
{
bb_error_msg_and_die(FATAL"%s", m0);
}
-static void warn(char *m0) {
+static void warn(const char *m0) {
bb_perror_msg(WARNING"%s", m0);
}
-static void warn2(char *m0, char *m1)
+static void warn2(const char *m0, const char *m1)
{
bb_perror_msg(WARNING"%s: %s", m0, m1);
}
-static void warnx(char *m0, char *m1)
+static void warnx(const char *m0, const char *m1)
{
bb_error_msg(WARNING"%s: %s", m0, m1);
}
@@ -103,12 +103,12 @@ static void pause_nomem(void)
bb_error_msg(PAUSE"out of memory");
sleep(3);
}
-static void pause1cannot(char *m0)
+static void pause1cannot(const char *m0)
{
bb_perror_msg(PAUSE"cannot %s", m0);
sleep(3);
}
-static void pause2cannot(char *m0, char *m1)
+static void pause2cannot(const char *m0, const char *m1)
{
bb_perror_msg(PAUSE"cannot %s %s", m0, m1);
sleep(3);
@@ -168,8 +168,8 @@ static unsigned processorstart(struct logdir *ld)
bb_perror_msg_and_die(FATAL"cannot %s processor %s", "move filedescriptor for", ld->name);
// getenv("SHELL")?
- prog[0] = "sh";
- prog[1] = "-c";
+ prog[0] = (char*)"sh";
+ prog[1] = (char*)"-c";
prog[2] = ld->processor;
prog[3] = '\0';
execve("/bin/sh", prog, environ);