aboutsummaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-01-29 22:51:44 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2007-01-29 22:51:44 +0000
commit0c7ca1fafeb5f23776ba7e1624636ad1698b6536 (patch)
treedf385c84041f3fd8328e7a50caef4495ef2734a8 /init
parent2f2ce3c4222378da84c9f5f555c32409566579d8 (diff)
downloadbusybox-w32-0c7ca1fafeb5f23776ba7e1624636ad1698b6536.tar.gz
busybox-w32-0c7ca1fafeb5f23776ba7e1624636ad1698b6536.tar.bz2
busybox-w32-0c7ca1fafeb5f23776ba7e1624636ad1698b6536.zip
preparatory patch for -Wwrite-strings #3
git-svn-id: svn://busybox.net/trunk/busybox@17655 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'init')
-rw-r--r--init/init.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/init/init.c b/init/init.c
index 7694b4448..cb314003e 100644
--- a/init/init.c
+++ b/init/init.c
@@ -326,27 +326,26 @@ static void console_init(void)
326 /* Force the TERM setting to vt102 for serial console -- 326 /* Force the TERM setting to vt102 for serial console --
327 * if TERM is set to linux (the default) */ 327 * if TERM is set to linux (the default) */
328 if (s == NULL || strcmp(s, "linux") == 0) 328 if (s == NULL || strcmp(s, "linux") == 0)
329 putenv("TERM=vt102"); 329 putenv((char*)"TERM=vt102");
330#if !ENABLE_SYSLOGD 330#if !ENABLE_SYSLOGD
331 log_console = console; 331 log_console = console;
332#endif 332#endif
333 } else { 333 } else {
334 if (s == NULL) 334 if (s == NULL)
335 putenv("TERM=linux"); 335 putenv((char*)"TERM=linux");
336 } 336 }
337 close(fd); 337 close(fd);
338 } 338 }
339 messageD(LOG, "console=%s", console); 339 messageD(LOG, "console=%s", console);
340} 340}
341 341
342static void fixup_argv(int argc, char **argv, char *new_argv0) 342static void fixup_argv(int argc, char **argv, const char *new_argv0)
343{ 343{
344 int len; 344 int len;
345 345
346 /* Fix up argv[0] to be certain we claim to be init */ 346 /* Fix up argv[0] to be certain we claim to be init */
347 len = strlen(argv[0]); 347 len = strlen(argv[0]);
348 memset(argv[0], 0, len); 348 strncpy(argv[0], new_argv0, len);
349 safe_strncpy(argv[0], new_argv0, len + 1);
350 349
351 /* Wipe argv[1]-argv[N] so they don't clutter the ps listing */ 350 /* Wipe argv[1]-argv[N] so they don't clutter the ps listing */
352 len = 1; 351 len = 1;
@@ -381,7 +380,8 @@ static pid_t run(const struct init_action *a)
381{ 380{
382 int i; 381 int i;
383 pid_t pid; 382 pid_t pid;
384 char *s, *tmpCmd, *cmd[INIT_BUFFS_SIZE], *cmdpath; 383 char *s, *tmpCmd, *cmdpath;
384 char *cmd[INIT_BUFFS_SIZE];
385 char buf[INIT_BUFFS_SIZE + 6]; /* INIT_BUFFS_SIZE+strlen("exec ")+1 */ 385 char buf[INIT_BUFFS_SIZE + 6]; /* INIT_BUFFS_SIZE+strlen("exec ")+1 */
386 sigset_t nmask, omask; 386 sigset_t nmask, omask;
387 static const char press_enter[] = 387 static const char press_enter[] =
@@ -389,7 +389,7 @@ static pid_t run(const struct init_action *a)
389#include CUSTOMIZED_BANNER 389#include CUSTOMIZED_BANNER
390#endif 390#endif
391 "\nPlease press Enter to activate this console. "; 391 "\nPlease press Enter to activate this console. ";
392 char *prog; 392 const char *prog;
393 393
394 /* Block sigchild while forking. */ 394 /* Block sigchild while forking. */
395 sigemptyset(&nmask); 395 sigemptyset(&nmask);
@@ -472,7 +472,7 @@ static pid_t run(const struct init_action *a)
472 /* See if any special /bin/sh requiring characters are present */ 472 /* See if any special /bin/sh requiring characters are present */
473 if (strpbrk(a->command, "~`!$^&*()=|\\{}[];\"'<>?") != NULL) { 473 if (strpbrk(a->command, "~`!$^&*()=|\\{}[];\"'<>?") != NULL) {
474 cmd[0] = (char *)DEFAULT_SHELL; 474 cmd[0] = (char *)DEFAULT_SHELL;
475 cmd[1] = "-c"; 475 cmd[1] = (char*)"-c";
476 cmd[2] = strcat(strcpy(buf, "exec "), a->command); 476 cmd[2] = strcat(strcpy(buf, "exec "), a->command);
477 cmd[3] = NULL; 477 cmd[3] = NULL;
478 } else { 478 } else {