aboutsummaryrefslogtreecommitdiff
path: root/runit
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-01-29 22:51:58 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-01-29 22:51:58 +0000
commitfc6a03ef2fa63dcecef603d178139a779b9e7081 (patch)
tree443636e12ffb52db95168013bbda80f78ed49fe6 /runit
parent0c7ca1fafeb5f23776ba7e1624636ad1698b6536 (diff)
downloadbusybox-w32-fc6a03ef2fa63dcecef603d178139a779b9e7081.tar.gz
busybox-w32-fc6a03ef2fa63dcecef603d178139a779b9e7081.tar.bz2
busybox-w32-fc6a03ef2fa63dcecef603d178139a779b9e7081.zip
preparatory patch for -Wwrite-strings #4
git-svn-id: svn://busybox.net/trunk/busybox@17656 69ca8d6d-28ef-0310-b511-8ec308f3f277
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 018a80eeb..03187a8b7 100644
--- a/runit/runsv.c
+++ b/runit/runsv.c
@@ -42,26 +42,26 @@ static char *dir;
42 42
43#define usage() bb_show_usage() 43#define usage() bb_show_usage()
44 44
45static void fatal2_cannot(char *m1, char *m2) 45static void fatal2_cannot(const char *m1, const char *m2)
46{ 46{
47 bb_perror_msg_and_die("%s: fatal: cannot %s%s", dir, m1, m2); 47 bb_perror_msg_and_die("%s: fatal: cannot %s%s", dir, m1, m2);
48 /* was exiting 111 */ 48 /* was exiting 111 */
49} 49}
50static void fatal_cannot(char *m) 50static void fatal_cannot(const char *m)
51{ 51{
52 fatal2_cannot(m, ""); 52 fatal2_cannot(m, "");
53 /* was exiting 111 */ 53 /* was exiting 111 */
54} 54}
55static void fatal2x_cannot(char *m1, char *m2) 55static void fatal2x_cannot(const char *m1, const char *m2)
56{ 56{
57 bb_error_msg_and_die("%s: fatal: cannot %s%s", dir, m1, m2); 57 bb_error_msg_and_die("%s: fatal: cannot %s%s", dir, m1, m2);
58 /* was exiting 111 */ 58 /* was exiting 111 */
59} 59}
60static void warn_cannot(char *m) 60static void warn_cannot(const char *m)
61{ 61{
62 bb_perror_msg("%s: warning: cannot %s", dir, m); 62 bb_perror_msg("%s: warning: cannot %s", dir, m);
63} 63}
64static void warnx_cannot(char *m) 64static void warnx_cannot(const char *m)
65{ 65{
66 bb_error_msg("%s: warning: cannot %s", dir, m); 66 bb_error_msg("%s: warning: cannot %s", dir, m);
67} 67}
@@ -280,12 +280,12 @@ static void startservice(struct svdir *s)
280 char *run[2]; 280 char *run[2];
281 281
282 if (s->state == S_FINISH) 282 if (s->state == S_FINISH)
283 run[0] = "./finish"; 283 run[0] = (char*)"./finish";
284 else { 284 else {
285 run[0] = "./run"; 285 run[0] = (char*)"./run";
286 custom(s, 'u'); 286 custom(s, 'u');
287 } 287 }
288 run[1] = 0; 288 run[1] = NULL;
289 289
290 if (s->pid != 0) stopservice(s); /* should never happen */ 290 if (s->pid != 0) stopservice(s); /* should never happen */
291 while ((p = fork()) == -1) { 291 while ((p = fork()) == -1) {
diff --git a/runit/runsvdir.c b/runit/runsvdir.c
index 22f2a0505..7e1dd6c30 100644
--- a/runit/runsvdir.c
+++ b/runit/runsvdir.c
@@ -28,20 +28,20 @@ static int exitsoon;
28static int pgrp; 28static int pgrp;
29 29
30#define usage() bb_show_usage() 30#define usage() bb_show_usage()
31static void fatal2_cannot(char *m1, char *m2) 31static void fatal2_cannot(const char *m1, const char *m2)
32{ 32{
33 bb_perror_msg_and_die("%s: fatal: cannot %s%s", svdir, m1, m2); 33 bb_perror_msg_and_die("%s: fatal: cannot %s%s", svdir, m1, m2);
34 /* was exiting 100 */ 34 /* was exiting 100 */
35} 35}
36static void warn3x(char *m1, char *m2, char *m3) 36static void warn3x(const char *m1, const char *m2, const char *m3)
37{ 37{
38 bb_error_msg("%s: warning: %s%s%s", svdir, m1, m2, m3); 38 bb_error_msg("%s: warning: %s%s%s", svdir, m1, m2, m3);
39} 39}
40static void warn2_cannot(char *m1, char *m2) 40static void warn2_cannot(const char *m1, const char *m2)
41{ 41{
42 warn3x("cannot ", m1, m2); 42 warn3x("cannot ", m1, m2);
43} 43}
44static void warnx(char *m1) 44static void warnx(const char *m1)
45{ 45{
46 warn3x(m1, "", ""); 46 warn3x(m1, "", "");
47} 47}
@@ -55,7 +55,7 @@ static void s_hangup(int sig_no)
55 exitsoon = 2; 55 exitsoon = 2;
56} 56}
57 57
58static void runsv(int no, char *name) 58static void runsv(int no, const char *name)
59{ 59{
60 int pid = fork(); 60 int pid = fork();
61 61
@@ -67,8 +67,8 @@ static void runsv(int no, char *name)
67 /* child */ 67 /* child */
68 char *prog[3]; 68 char *prog[3];
69 69
70 prog[0] = "runsv"; 70 prog[0] = (char*)"runsv";
71 prog[1] = name; 71 prog[1] = (char*)name;
72 prog[2] = NULL; 72 prog[2] = NULL;
73 sig_uncatch(SIGHUP); 73 sig_uncatch(SIGHUP);
74 sig_uncatch(SIGTERM); 74 sig_uncatch(SIGTERM);
diff --git a/runit/svlogd.c b/runit/svlogd.c
index 41a7c860e..59b1e5721 100644
--- a/runit/svlogd.c
+++ b/runit/svlogd.c
@@ -75,7 +75,7 @@ static struct logdir {
75 char match; 75 char match;
76 char matcherr; 76 char matcherr;
77} *dir; 77} *dir;
78static unsigned dirn = 0; 78static unsigned dirn;
79 79
80#define FATAL "fatal: " 80#define FATAL "fatal: "
81#define WARNING "warning: " 81#define WARNING "warning: "
@@ -83,18 +83,18 @@ static unsigned dirn = 0;
83#define INFO "info: " 83#define INFO "info: "
84 84
85#define usage() bb_show_usage() 85#define usage() bb_show_usage()
86static void fatalx(char *m0) 86static void fatalx(const char *m0)
87{ 87{
88 bb_error_msg_and_die(FATAL"%s", m0); 88 bb_error_msg_and_die(FATAL"%s", m0);
89} 89}
90static void warn(char *m0) { 90static void warn(const char *m0) {
91 bb_perror_msg(WARNING"%s", m0); 91 bb_perror_msg(WARNING"%s", m0);
92} 92}
93static void warn2(char *m0, char *m1) 93static void warn2(const char *m0, const char *m1)
94{ 94{
95 bb_perror_msg(WARNING"%s: %s", m0, m1); 95 bb_perror_msg(WARNING"%s: %s", m0, m1);
96} 96}
97static void warnx(char *m0, char *m1) 97static void warnx(const char *m0, const char *m1)
98{ 98{
99 bb_error_msg(WARNING"%s: %s", m0, m1); 99 bb_error_msg(WARNING"%s: %s", m0, m1);
100} 100}
@@ -103,12 +103,12 @@ static void pause_nomem(void)
103 bb_error_msg(PAUSE"out of memory"); 103 bb_error_msg(PAUSE"out of memory");
104 sleep(3); 104 sleep(3);
105} 105}
106static void pause1cannot(char *m0) 106static void pause1cannot(const char *m0)
107{ 107{
108 bb_perror_msg(PAUSE"cannot %s", m0); 108 bb_perror_msg(PAUSE"cannot %s", m0);
109 sleep(3); 109 sleep(3);
110} 110}
111static void pause2cannot(char *m0, char *m1) 111static void pause2cannot(const char *m0, const char *m1)
112{ 112{
113 bb_perror_msg(PAUSE"cannot %s %s", m0, m1); 113 bb_perror_msg(PAUSE"cannot %s %s", m0, m1);
114 sleep(3); 114 sleep(3);
@@ -168,8 +168,8 @@ static unsigned processorstart(struct logdir *ld)
168 bb_perror_msg_and_die(FATAL"cannot %s processor %s", "move filedescriptor for", ld->name); 168 bb_perror_msg_and_die(FATAL"cannot %s processor %s", "move filedescriptor for", ld->name);
169 169
170// getenv("SHELL")? 170// getenv("SHELL")?
171 prog[0] = "sh"; 171 prog[0] = (char*)"sh";
172 prog[1] = "-c"; 172 prog[1] = (char*)"-c";
173 prog[2] = ld->processor; 173 prog[2] = ld->processor;
174 prog[3] = '\0'; 174 prog[3] = '\0';
175 execve("/bin/sh", prog, environ); 175 execve("/bin/sh", prog, environ);