diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2007-01-29 22:51:58 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2007-01-29 22:51:58 +0000 |
commit | ab2aea44479fd6f519bccd651a37f30e792b7593 (patch) | |
tree | 443636e12ffb52db95168013bbda80f78ed49fe6 | |
parent | 06c0a71d2315756db874e98bc4f760ca3283b6a6 (diff) | |
download | busybox-w32-ab2aea44479fd6f519bccd651a37f30e792b7593.tar.gz busybox-w32-ab2aea44479fd6f519bccd651a37f30e792b7593.tar.bz2 busybox-w32-ab2aea44479fd6f519bccd651a37f30e792b7593.zip |
preparatory patch for -Wwrite-strings #4
-rw-r--r-- | findutils/find.c | 8 | ||||
-rw-r--r-- | libbb/lineedit.c | 8 | ||||
-rw-r--r-- | modutils/insmod.c | 2 | ||||
-rw-r--r-- | networking/arp.c | 6 | ||||
-rw-r--r-- | networking/httpd.c | 13 | ||||
-rw-r--r-- | networking/ifupdown.c | 2 | ||||
-rw-r--r-- | networking/libiproute/iptunnel.c | 6 | ||||
-rw-r--r-- | networking/libiproute/rt_names.c | 11 | ||||
-rw-r--r-- | networking/libiproute/utils.c | 20 | ||||
-rw-r--r-- | networking/libiproute/utils.h | 6 | ||||
-rw-r--r-- | runit/runsv.c | 16 | ||||
-rw-r--r-- | runit/runsvdir.c | 14 | ||||
-rw-r--r-- | runit/svlogd.c | 18 | ||||
-rw-r--r-- | sysklogd/syslogd.c | 9 |
14 files changed, 68 insertions, 71 deletions
diff --git a/findutils/find.c b/findutils/find.c index 42cee87e1..0c22ee6d1 100644 --- a/findutils/find.c +++ b/findutils/find.c | |||
@@ -497,7 +497,7 @@ static action*** parse_params(char **argv) | |||
497 | } | 497 | } |
498 | ap = ALLOC_ACTION(paren); | 498 | ap = ALLOC_ACTION(paren); |
499 | ap->subexpr = parse_params(argv + 1); | 499 | ap->subexpr = parse_params(argv + 1); |
500 | *endarg = ")"; /* restore NULLed parameter */ | 500 | *endarg = (char*) ")"; /* restore NULLed parameter */ |
501 | argv = endarg; | 501 | argv = endarg; |
502 | } | 502 | } |
503 | else if (strcmp(arg, "-prune") == 0) { | 503 | else if (strcmp(arg, "-prune") == 0) { |
@@ -537,7 +537,7 @@ int find_main(int argc, char **argv) | |||
537 | #endif | 537 | #endif |
538 | } | 538 | } |
539 | if (firstopt == 1) { | 539 | if (firstopt == 1) { |
540 | argv[0] = "."; | 540 | argv[0] = (char*)"."; |
541 | argv--; | 541 | argv--; |
542 | firstopt++; | 542 | firstopt++; |
543 | } | 543 | } |
@@ -553,7 +553,7 @@ int find_main(int argc, char **argv) | |||
553 | while ((arg = argp[0])) { | 553 | while ((arg = argp[0])) { |
554 | if (strcmp(arg, "-follow") == 0) { | 554 | if (strcmp(arg, "-follow") == 0) { |
555 | dereference = TRUE; | 555 | dereference = TRUE; |
556 | argp[0] = "-a"; | 556 | argp[0] = (char*)"-a"; |
557 | } | 557 | } |
558 | #if ENABLE_FEATURE_FIND_XDEV | 558 | #if ENABLE_FEATURE_FIND_XDEV |
559 | else if (strcmp(arg, "-xdev") == 0) { | 559 | else if (strcmp(arg, "-xdev") == 0) { |
@@ -569,7 +569,7 @@ int find_main(int argc, char **argv) | |||
569 | xdev_dev[i-1] = stbuf.st_dev; | 569 | xdev_dev[i-1] = stbuf.st_dev; |
570 | } | 570 | } |
571 | } | 571 | } |
572 | argp[0] = "-a"; | 572 | argp[0] = (char*)"-a"; |
573 | } | 573 | } |
574 | #endif | 574 | #endif |
575 | argp++; | 575 | argp++; |
diff --git a/libbb/lineedit.c b/libbb/lineedit.c index bce06843b..343890868 100644 --- a/libbb/lineedit.c +++ b/libbb/lineedit.c | |||
@@ -81,8 +81,8 @@ static int num_ok_lines = 1; | |||
81 | #endif | 81 | #endif |
82 | 82 | ||
83 | #if ENABLE_FEATURE_GETUSERNAME_AND_HOMEDIR | 83 | #if ENABLE_FEATURE_GETUSERNAME_AND_HOMEDIR |
84 | static char *user_buf = ""; | 84 | static char *user_buf = (char*)""; |
85 | static char *home_pwd_buf = ""; | 85 | static char *home_pwd_buf = (char*)""; |
86 | #endif | 86 | #endif |
87 | 87 | ||
88 | #if ENABLE_FEATURE_TAB_COMPLETION | 88 | #if ENABLE_FEATURE_TAB_COMPLETION |
@@ -422,7 +422,7 @@ static void exe_n_cwd_tab_completion(char *command, int type) | |||
422 | char *pfind = strrchr(command, '/'); | 422 | char *pfind = strrchr(command, '/'); |
423 | 423 | ||
424 | npaths = 1; | 424 | npaths = 1; |
425 | path1[0] = "."; | 425 | path1[0] = (char*)"."; |
426 | 426 | ||
427 | if (pfind == NULL) { | 427 | if (pfind == NULL) { |
428 | /* no dir, if flags==EXE_ONLY - get paths, else "." */ | 428 | /* no dir, if flags==EXE_ONLY - get paths, else "." */ |
@@ -447,7 +447,7 @@ static void exe_n_cwd_tab_completion(char *command, int type) | |||
447 | 447 | ||
448 | while ((next = readdir(dir)) != NULL) { | 448 | while ((next = readdir(dir)) != NULL) { |
449 | int len1; | 449 | int len1; |
450 | char *str_found = next->d_name; | 450 | const char *str_found = next->d_name; |
451 | 451 | ||
452 | /* matched? */ | 452 | /* matched? */ |
453 | if (strncmp(str_found, pfind, strlen(pfind))) | 453 | if (strncmp(str_found, pfind, strlen(pfind))) |
diff --git a/modutils/insmod.c b/modutils/insmod.c index 241db45e8..edbdfab0e 100644 --- a/modutils/insmod.c +++ b/modutils/insmod.c | |||
@@ -2540,7 +2540,7 @@ new_process_module_arguments(struct obj_file *f, int argc, char **argv) | |||
2540 | } else { | 2540 | } else { |
2541 | /* last string */ | 2541 | /* last string */ |
2542 | str = q; | 2542 | str = q; |
2543 | q = ""; | 2543 | q = (char*)""; |
2544 | } | 2544 | } |
2545 | } | 2545 | } |
2546 | 2546 | ||
diff --git a/networking/arp.c b/networking/arp.c index 6bd12656a..33191d89b 100644 --- a/networking/arp.c +++ b/networking/arp.c | |||
@@ -46,7 +46,7 @@ static const struct aftype *ap; /* current address family */ | |||
46 | static const struct hwtype *hw; /* current hardware type */ | 46 | static const struct hwtype *hw; /* current hardware type */ |
47 | static int sockfd; /* active socket descriptor */ | 47 | static int sockfd; /* active socket descriptor */ |
48 | static smallint hw_set; /* flag if hw-type was set (-H) */ | 48 | static smallint hw_set; /* flag if hw-type was set (-H) */ |
49 | static char *device = ""; /* current device */ | 49 | static const char *device = ""; /* current device */ |
50 | 50 | ||
51 | static const char *const options[] = { | 51 | static const char *const options[] = { |
52 | "pub", | 52 | "pub", |
@@ -317,7 +317,7 @@ static int arp_set(char **args) | |||
317 | 317 | ||
318 | /* Print the contents of an ARP request block. */ | 318 | /* Print the contents of an ARP request block. */ |
319 | static void | 319 | static void |
320 | arp_disp(char *name, char *ip, int type, int arp_flags, | 320 | arp_disp(const char *name, char *ip, int type, int arp_flags, |
321 | char *hwa, char *mask, char *dev) | 321 | char *hwa, char *mask, char *dev) |
322 | { | 322 | { |
323 | const struct hwtype *xhw; | 323 | const struct hwtype *xhw; |
@@ -371,7 +371,7 @@ static int arp_show(char *name) | |||
371 | char dev[100]; | 371 | char dev[100]; |
372 | int type, flags; | 372 | int type, flags; |
373 | FILE *fp; | 373 | FILE *fp; |
374 | char *hostname; | 374 | const char *hostname; |
375 | int num; | 375 | int num; |
376 | unsigned entries = 0, shown = 0; | 376 | unsigned entries = 0, shown = 0; |
377 | 377 | ||
diff --git a/networking/httpd.c b/networking/httpd.c index ea9fe0974..e3f798c4c 100644 --- a/networking/httpd.c +++ b/networking/httpd.c | |||
@@ -653,17 +653,16 @@ static char *encodeString(const char *string) | |||
653 | /* take the simple route and encode everything */ | 653 | /* take the simple route and encode everything */ |
654 | /* could possibly scan once to get length. */ | 654 | /* could possibly scan once to get length. */ |
655 | int len = strlen(string); | 655 | int len = strlen(string); |
656 | char *out = malloc(len * 6 + 1); | 656 | char *out = xmalloc(len * 6 + 1); |
657 | char *p = out; | 657 | char *p = out; |
658 | char ch; | 658 | char ch; |
659 | 659 | ||
660 | if (!out) return ""; | ||
661 | while ((ch = *string++)) { | 660 | while ((ch = *string++)) { |
662 | // very simple check for what to encode | 661 | // very simple check for what to encode |
663 | if (isalnum(ch)) *p++ = ch; | 662 | if (isalnum(ch)) *p++ = ch; |
664 | else p += sprintf(p, "&#%d;", (unsigned char) ch); | 663 | else p += sprintf(p, "&#%d;", (unsigned char) ch); |
665 | } | 664 | } |
666 | *p = 0; | 665 | *p = '\0'; |
667 | return out; | 666 | return out; |
668 | } | 667 | } |
669 | #endif /* FEATURE_HTTPD_ENCODE_URL_STR */ | 668 | #endif /* FEATURE_HTTPD_ENCODE_URL_STR */ |
@@ -1051,15 +1050,15 @@ static int sendCgi(const char *url, | |||
1051 | /* (Older versions of bbox seem to do some decoding) */ | 1050 | /* (Older versions of bbox seem to do some decoding) */ |
1052 | setenv1("QUERY_STRING", config->query); | 1051 | setenv1("QUERY_STRING", config->query); |
1053 | setenv1("SERVER_SOFTWARE", httpdVersion); | 1052 | setenv1("SERVER_SOFTWARE", httpdVersion); |
1054 | putenv("SERVER_PROTOCOL=HTTP/1.0"); | 1053 | putenv((char*)"SERVER_PROTOCOL=HTTP/1.0"); |
1055 | putenv("GATEWAY_INTERFACE=CGI/1.1"); | 1054 | putenv((char*)"GATEWAY_INTERFACE=CGI/1.1"); |
1056 | /* Having _separate_ variables for IP and port defeats | 1055 | /* Having _separate_ variables for IP and port defeats |
1057 | * the purpose of having socket abstraction. Which "port" | 1056 | * the purpose of having socket abstraction. Which "port" |
1058 | * are you using on Unix domain socket? | 1057 | * are you using on Unix domain socket? |
1059 | * IOW - REMOTE_PEER="1.2.3.4:56" makes much more sense. | 1058 | * IOW - REMOTE_PEER="1.2.3.4:56" makes much more sense. |
1060 | * Oh well... */ | 1059 | * Oh well... */ |
1061 | { | 1060 | { |
1062 | char *p = config->rmt_ip_str ? : ""; | 1061 | char *p = config->rmt_ip_str ? : (char*)""; |
1063 | char *cp = strrchr(p, ':'); | 1062 | char *cp = strrchr(p, ':'); |
1064 | if (ENABLE_FEATURE_IPV6 && cp && strchr(cp, ']')) | 1063 | if (ENABLE_FEATURE_IPV6 && cp && strchr(cp, ']')) |
1065 | cp = NULL; | 1064 | cp = NULL; |
@@ -1078,7 +1077,7 @@ static int sendCgi(const char *url, | |||
1078 | #if ENABLE_FEATURE_HTTPD_BASIC_AUTH | 1077 | #if ENABLE_FEATURE_HTTPD_BASIC_AUTH |
1079 | if (config->remoteuser) { | 1078 | if (config->remoteuser) { |
1080 | setenv1("REMOTE_USER", config->remoteuser); | 1079 | setenv1("REMOTE_USER", config->remoteuser); |
1081 | putenv("AUTH_TYPE=Basic"); | 1080 | putenv((char*)"AUTH_TYPE=Basic"); |
1082 | } | 1081 | } |
1083 | #endif | 1082 | #endif |
1084 | if (config->referer) | 1083 | if (config->referer) |
diff --git a/networking/ifupdown.c b/networking/ifupdown.c index adbc37e43..4ec3d37a8 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c | |||
@@ -842,7 +842,7 @@ static struct interfaces_file_t *read_interfaces(const char *filename) | |||
842 | return defn; | 842 | return defn; |
843 | } | 843 | } |
844 | 844 | ||
845 | static char *setlocalenv(char *format, const char *name, const char *value) | 845 | static char *setlocalenv(const char *format, const char *name, const char *value) |
846 | { | 846 | { |
847 | char *result; | 847 | char *result; |
848 | char *here; | 848 | char *here; |
diff --git a/networking/libiproute/iptunnel.c b/networking/libiproute/iptunnel.c index a67803ff4..e2e75fce0 100644 --- a/networking/libiproute/iptunnel.c +++ b/networking/libiproute/iptunnel.c | |||
@@ -85,7 +85,7 @@ static char *do_ioctl_get_ifname(int idx) | |||
85 | 85 | ||
86 | 86 | ||
87 | 87 | ||
88 | static int do_get_ioctl(char *basedev, struct ip_tunnel_parm *p) | 88 | static int do_get_ioctl(const char *basedev, struct ip_tunnel_parm *p) |
89 | { | 89 | { |
90 | struct ifreq ifr; | 90 | struct ifreq ifr; |
91 | int fd; | 91 | int fd; |
@@ -102,7 +102,7 @@ static int do_get_ioctl(char *basedev, struct ip_tunnel_parm *p) | |||
102 | return err; | 102 | return err; |
103 | } | 103 | } |
104 | 104 | ||
105 | static int do_add_ioctl(int cmd, char *basedev, struct ip_tunnel_parm *p) | 105 | static int do_add_ioctl(int cmd, const char *basedev, struct ip_tunnel_parm *p) |
106 | { | 106 | { |
107 | struct ifreq ifr; | 107 | struct ifreq ifr; |
108 | int fd; | 108 | int fd; |
@@ -123,7 +123,7 @@ static int do_add_ioctl(int cmd, char *basedev, struct ip_tunnel_parm *p) | |||
123 | return err; | 123 | return err; |
124 | } | 124 | } |
125 | 125 | ||
126 | static int do_del_ioctl(char *basedev, struct ip_tunnel_parm *p) | 126 | static int do_del_ioctl(const char *basedev, struct ip_tunnel_parm *p) |
127 | { | 127 | { |
128 | struct ifreq ifr; | 128 | struct ifreq ifr; |
129 | int fd; | 129 | int fd; |
diff --git a/networking/libiproute/rt_names.c b/networking/libiproute/rt_names.c index 686326ff9..797c83b4e 100644 --- a/networking/libiproute/rt_names.c +++ b/networking/libiproute/rt_names.c | |||
@@ -13,7 +13,7 @@ | |||
13 | #include "libbb.h" | 13 | #include "libbb.h" |
14 | #include "rt_names.h" | 14 | #include "rt_names.h" |
15 | 15 | ||
16 | static void rtnl_tab_initialize(char *file, const char **tab, int size) | 16 | static void rtnl_tab_initialize(const char *file, const char **tab, int size) |
17 | { | 17 | { |
18 | char buf[512]; | 18 | char buf[512]; |
19 | FILE *fp; | 19 | FILE *fp; |
@@ -30,10 +30,11 @@ static void rtnl_tab_initialize(char *file, const char **tab, int size) | |||
30 | p++; | 30 | p++; |
31 | if (*p == '#' || *p == '\n' || *p == 0) | 31 | if (*p == '#' || *p == '\n' || *p == 0) |
32 | continue; | 32 | continue; |
33 | if (sscanf(p, "0x%x %s\n", &id, namebuf) != 2 && | 33 | if (sscanf(p, "0x%x %s\n", &id, namebuf) != 2 |
34 | sscanf(p, "0x%x %s #", &id, namebuf) != 2 && | 34 | && sscanf(p, "0x%x %s #", &id, namebuf) != 2 |
35 | sscanf(p, "%d %s\n", &id, namebuf) != 2 && | 35 | && sscanf(p, "%d %s\n", &id, namebuf) != 2 |
36 | sscanf(p, "%d %s #", &id, namebuf) != 2) { | 36 | && sscanf(p, "%d %s #", &id, namebuf) != 2 |
37 | ) { | ||
37 | bb_error_msg("database %s is corrupted at %s", | 38 | bb_error_msg("database %s is corrupted at %s", |
38 | file, p); | 39 | file, p); |
39 | return; | 40 | return; |
diff --git a/networking/libiproute/utils.c b/networking/libiproute/utils.c index 5e06656f6..591c8933a 100644 --- a/networking/libiproute/utils.c +++ b/networking/libiproute/utils.c | |||
@@ -178,7 +178,7 @@ int get_prefix_1(inet_prefix * dst, char *arg, int family) | |||
178 | 178 | ||
179 | slash = strchr(arg, '/'); | 179 | slash = strchr(arg, '/'); |
180 | if (slash) | 180 | if (slash) |
181 | *slash = 0; | 181 | *slash = '\0'; |
182 | err = get_addr_1(dst, arg, family); | 182 | err = get_addr_1(dst, arg, family); |
183 | if (err == 0) { | 183 | if (err == 0) { |
184 | switch (dst->family) { | 184 | switch (dst->family) { |
@@ -237,26 +237,22 @@ uint32_t get_addr32(char *name) | |||
237 | 237 | ||
238 | void incomplete_command(void) | 238 | void incomplete_command(void) |
239 | { | 239 | { |
240 | bb_error_msg("command line is not complete, try option \"help\""); | 240 | bb_error_msg_and_die("command line is not complete, try option \"help\""); |
241 | exit(-1); | ||
242 | } | 241 | } |
243 | 242 | ||
244 | void invarg(const char * const arg, const char * const opt) | 243 | void invarg(const char *arg, const char *opt) |
245 | { | 244 | { |
246 | bb_error_msg(bb_msg_invalid_arg, arg, opt); | 245 | bb_error_msg_and_die(bb_msg_invalid_arg, arg, opt); |
247 | exit(-1); | ||
248 | } | 246 | } |
249 | 247 | ||
250 | void duparg(char *key, char *arg) | 248 | void duparg(const char *key, const char *arg) |
251 | { | 249 | { |
252 | bb_error_msg("duplicate \"%s\": \"%s\" is the second value", key, arg); | 250 | bb_error_msg_and_die("duplicate \"%s\": \"%s\" is the second value", key, arg); |
253 | exit(-1); | ||
254 | } | 251 | } |
255 | 252 | ||
256 | void duparg2(char *key, char *arg) | 253 | void duparg2(const char *key, const char *arg) |
257 | { | 254 | { |
258 | bb_error_msg("either \"%s\" is duplicate, or \"%s\" is garbage", key, arg); | 255 | bb_error_msg_and_die("either \"%s\" is duplicate, or \"%s\" is garbage", key, arg); |
259 | exit(-1); | ||
260 | } | 256 | } |
261 | 257 | ||
262 | int matches(const char *cmd, const char *pattern) | 258 | int matches(const char *cmd, const char *pattern) |
diff --git a/networking/libiproute/utils.h b/networking/libiproute/utils.h index 5af8ba744..ebf2af194 100644 --- a/networking/libiproute/utils.h +++ b/networking/libiproute/utils.h | |||
@@ -75,9 +75,9 @@ extern int get_s8(int8_t *val, char *arg, int base); | |||
75 | extern const char *format_host(int af, int len, void *addr, char *buf, int buflen); | 75 | extern const char *format_host(int af, int len, void *addr, char *buf, int buflen); |
76 | extern const char *rt_addr_n2a(int af, int len, void *addr, char *buf, int buflen); | 76 | extern const char *rt_addr_n2a(int af, int len, void *addr, char *buf, int buflen); |
77 | 77 | ||
78 | void invarg(const char * const, const char * const) ATTRIBUTE_NORETURN; | 78 | void invarg(const char *, const char *) ATTRIBUTE_NORETURN; |
79 | void duparg(char *, char *) ATTRIBUTE_NORETURN; | 79 | void duparg(const char *, const char *) ATTRIBUTE_NORETURN; |
80 | void duparg2(char *, char *) ATTRIBUTE_NORETURN; | 80 | void duparg2(const char *, const char *) ATTRIBUTE_NORETURN; |
81 | int matches(const char *arg, const char *pattern); | 81 | int matches(const char *arg, const char *pattern); |
82 | extern int inet_addr_match(inet_prefix *a, inet_prefix *b, int bits); | 82 | extern int inet_addr_match(inet_prefix *a, inet_prefix *b, int bits); |
83 | 83 | ||
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 | ||
45 | static void fatal2_cannot(char *m1, char *m2) | 45 | static 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 | } |
50 | static void fatal_cannot(char *m) | 50 | static 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 | } |
55 | static void fatal2x_cannot(char *m1, char *m2) | 55 | static 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 | } |
60 | static void warn_cannot(char *m) | 60 | static 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 | } |
64 | static void warnx_cannot(char *m) | 64 | static 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; | |||
28 | static int pgrp; | 28 | static int pgrp; |
29 | 29 | ||
30 | #define usage() bb_show_usage() | 30 | #define usage() bb_show_usage() |
31 | static void fatal2_cannot(char *m1, char *m2) | 31 | static 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 | } |
36 | static void warn3x(char *m1, char *m2, char *m3) | 36 | static 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 | } |
40 | static void warn2_cannot(char *m1, char *m2) | 40 | static void warn2_cannot(const char *m1, const char *m2) |
41 | { | 41 | { |
42 | warn3x("cannot ", m1, m2); | 42 | warn3x("cannot ", m1, m2); |
43 | } | 43 | } |
44 | static void warnx(char *m1) | 44 | static 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 | ||
58 | static void runsv(int no, char *name) | 58 | static 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; |
78 | static unsigned dirn = 0; | 78 | static 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() |
86 | static void fatalx(char *m0) | 86 | static 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 | } |
90 | static void warn(char *m0) { | 90 | static void warn(const char *m0) { |
91 | bb_perror_msg(WARNING"%s", m0); | 91 | bb_perror_msg(WARNING"%s", m0); |
92 | } | 92 | } |
93 | static void warn2(char *m0, char *m1) | 93 | static 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 | } |
97 | static void warnx(char *m0, char *m1) | 97 | static 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 | } |
106 | static void pause1cannot(char *m0) | 106 | static 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 | } |
111 | static void pause2cannot(char *m0, char *m1) | 111 | static 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); |
diff --git a/sysklogd/syslogd.c b/sysklogd/syslogd.c index dca488ec3..bfa9a446c 100644 --- a/sysklogd/syslogd.c +++ b/sysklogd/syslogd.c | |||
@@ -25,7 +25,7 @@ | |||
25 | #define DEBUG 0 | 25 | #define DEBUG 0 |
26 | 26 | ||
27 | /* Path to the unix socket */ | 27 | /* Path to the unix socket */ |
28 | static char *dev_log_name; | 28 | static const char *dev_log_name; |
29 | 29 | ||
30 | /* Path for the file where all log messages are written */ | 30 | /* Path for the file where all log messages are written */ |
31 | static const char *logFilePath = "/var/log/messages"; | 31 | static const char *logFilePath = "/var/log/messages"; |
@@ -444,7 +444,7 @@ static void split_escape_and_log(char *tmpbuf, int len) | |||
444 | 444 | ||
445 | static void quit_signal(int sig) | 445 | static void quit_signal(int sig) |
446 | { | 446 | { |
447 | timestamp_and_log(LOG_SYSLOG | LOG_INFO, "syslogd exiting", 0); | 447 | timestamp_and_log(LOG_SYSLOG | LOG_INFO, (char*)"syslogd exiting", 0); |
448 | puts("syslogd exiting"); | 448 | puts("syslogd exiting"); |
449 | unlink(dev_log_name); | 449 | unlink(dev_log_name); |
450 | if (ENABLE_FEATURE_IPC_SYSLOG) | 450 | if (ENABLE_FEATURE_IPC_SYSLOG) |
@@ -455,7 +455,7 @@ static void quit_signal(int sig) | |||
455 | static void do_mark(int sig) | 455 | static void do_mark(int sig) |
456 | { | 456 | { |
457 | if (markInterval) { | 457 | if (markInterval) { |
458 | timestamp_and_log(LOG_SYSLOG | LOG_INFO, "-- MARK --", 0); | 458 | timestamp_and_log(LOG_SYSLOG | LOG_INFO, (char*)"-- MARK --", 0); |
459 | alarm(markInterval); | 459 | alarm(markInterval); |
460 | } | 460 | } |
461 | } | 461 | } |
@@ -501,7 +501,8 @@ static void do_syslogd(void) | |||
501 | ipcsyslog_init(); | 501 | ipcsyslog_init(); |
502 | } | 502 | } |
503 | 503 | ||
504 | timestamp_and_log(LOG_SYSLOG | LOG_INFO, "syslogd started: BusyBox v" BB_VER, 0); | 504 | timestamp_and_log(LOG_SYSLOG | LOG_INFO, |
505 | (char*)"syslogd started: BusyBox v" BB_VER, 0); | ||
505 | 506 | ||
506 | for (;;) { | 507 | for (;;) { |
507 | FD_ZERO(&fds); | 508 | FD_ZERO(&fds); |