aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2008-02-19 14:13:20 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2008-02-19 14:13:20 +0000
commit671ca33aa1804c1c4e26bf83635206dce7ed2623 (patch)
tree4bf32b2810361b905bb7e8e1796b1cc22da0eb81
parenta58a637bed06f6d794fcf822d08df926812ccd23 (diff)
downloadbusybox-w32-671ca33aa1804c1c4e26bf83635206dce7ed2623.tar.gz
busybox-w32-671ca33aa1804c1c4e26bf83635206dce7ed2623.tar.bz2
busybox-w32-671ca33aa1804c1c4e26bf83635206dce7ed2623.zip
init: make it NOMMU-capable
httpd: trivial compile fix
-rw-r--r--TODO_config_nommu87
-rw-r--r--init/init.c50
-rw-r--r--networking/httpd.c2
3 files changed, 104 insertions, 35 deletions
diff --git a/TODO_config_nommu b/TODO_config_nommu
index 81db6db2f..d3deda278 100644
--- a/TODO_config_nommu
+++ b/TODO_config_nommu
@@ -1,7 +1,7 @@
1# 1#
2# Automatically generated make config: don't edit 2# Automatically generated make config: don't edit
3# Busybox version: 1.10.0.svn 3# Busybox version: 1.10.0.svn
4# Tue Jan 8 20:29:22 2008 4# Tue Feb 19 15:07:07 2008
5# 5#
6CONFIG_HAVE_DOT_CONFIG=y 6CONFIG_HAVE_DOT_CONFIG=y
7 7
@@ -49,7 +49,7 @@ CONFIG_LFS=y
49# Debugging Options 49# Debugging Options
50# 50#
51# CONFIG_DEBUG is not set 51# CONFIG_DEBUG is not set
52CONFIG_WERROR=y 52# CONFIG_WERROR is not set
53CONFIG_NO_DEBUG_LIB=y 53CONFIG_NO_DEBUG_LIB=y
54# CONFIG_DMALLOC is not set 54# CONFIG_DMALLOC is not set
55# CONFIG_EFENCE is not set 55# CONFIG_EFENCE is not set
@@ -77,13 +77,13 @@ CONFIG_MD5_SIZE_VS_SPEED=2
77# CONFIG_FEATURE_ETC_NETWORKS is not set 77# CONFIG_FEATURE_ETC_NETWORKS is not set
78CONFIG_FEATURE_EDITING=y 78CONFIG_FEATURE_EDITING=y
79CONFIG_FEATURE_EDITING_MAX_LEN=1024 79CONFIG_FEATURE_EDITING_MAX_LEN=1024
80# CONFIG_FEATURE_EDITING_FANCY_KEYS is not set
81# CONFIG_FEATURE_EDITING_VI is not set 80# CONFIG_FEATURE_EDITING_VI is not set
82CONFIG_FEATURE_EDITING_HISTORY=15 81CONFIG_FEATURE_EDITING_HISTORY=15
83# CONFIG_FEATURE_EDITING_SAVEHISTORY is not set 82# CONFIG_FEATURE_EDITING_SAVEHISTORY is not set
84CONFIG_FEATURE_TAB_COMPLETION=y 83CONFIG_FEATURE_TAB_COMPLETION=y
85CONFIG_FEATURE_USERNAME_COMPLETION=y 84CONFIG_FEATURE_USERNAME_COMPLETION=y
86CONFIG_FEATURE_EDITING_FANCY_PROMPT=y 85CONFIG_FEATURE_EDITING_FANCY_PROMPT=y
86CONFIG_FEATURE_VERBOSE_CP_MESSAGE=y
87CONFIG_FEATURE_COPYBUF_KB=4 87CONFIG_FEATURE_COPYBUF_KB=4
88CONFIG_MONOTONIC_SYSCALL=y 88CONFIG_MONOTONIC_SYSCALL=y
89CONFIG_IOCTL_HEX2STR_ERROR=y 89CONFIG_IOCTL_HEX2STR_ERROR=y
@@ -111,15 +111,17 @@ CONFIG_RPM=y
111CONFIG_FEATURE_RPM_BZ2=y 111CONFIG_FEATURE_RPM_BZ2=y
112CONFIG_TAR=y 112CONFIG_TAR=y
113CONFIG_FEATURE_TAR_CREATE=y 113CONFIG_FEATURE_TAR_CREATE=y
114CONFIG_FEATURE_TAR_GZIP=y
114CONFIG_FEATURE_TAR_BZIP2=y 115CONFIG_FEATURE_TAR_BZIP2=y
115CONFIG_FEATURE_TAR_LZMA=y 116CONFIG_FEATURE_TAR_LZMA=y
116CONFIG_FEATURE_TAR_FROM=y
117CONFIG_FEATURE_TAR_GZIP=y
118CONFIG_FEATURE_TAR_COMPRESS=y 117CONFIG_FEATURE_TAR_COMPRESS=y
118CONFIG_FEATURE_TAR_AUTODETECT=y
119CONFIG_FEATURE_TAR_FROM=y
119CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y 120CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y
120CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY=y 121CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY=y
121CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y 122CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y
122CONFIG_FEATURE_TAR_LONG_OPTIONS=y 123CONFIG_FEATURE_TAR_LONG_OPTIONS=y
124CONFIG_FEATURE_TAR_UNAME_GNAME=y
123CONFIG_UNCOMPRESS=y 125CONFIG_UNCOMPRESS=y
124CONFIG_UNLZMA=y 126CONFIG_UNLZMA=y
125CONFIG_FEATURE_LZMA_FAST=y 127CONFIG_FEATURE_LZMA_FAST=y
@@ -367,16 +369,16 @@ CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y
367# 369#
368# Init Utilities 370# Init Utilities
369# 371#
370# CONFIG_INIT is not set 372CONFIG_INIT=y
371# CONFIG_DEBUG_INIT is not set 373# CONFIG_DEBUG_INIT is not set
372# CONFIG_FEATURE_USE_INITTAB is not set 374CONFIG_FEATURE_USE_INITTAB=y
373# CONFIG_FEATURE_KILL_REMOVED is not set 375CONFIG_FEATURE_KILL_REMOVED=y
374CONFIG_FEATURE_KILL_DELAY=0 376CONFIG_FEATURE_KILL_DELAY=1
375# CONFIG_FEATURE_INIT_SCTTY is not set 377CONFIG_FEATURE_INIT_SCTTY=y
376# CONFIG_FEATURE_INIT_SYSLOG is not set 378CONFIG_FEATURE_INIT_SYSLOG=y
377# CONFIG_FEATURE_EXTRA_QUIET is not set 379CONFIG_FEATURE_EXTRA_QUIET=y
378# CONFIG_FEATURE_INIT_COREDUMPS is not set 380CONFIG_FEATURE_INIT_COREDUMPS=y
379# CONFIG_FEATURE_INITRD is not set 381CONFIG_FEATURE_INITRD=y
380CONFIG_HALT=y 382CONFIG_HALT=y
381CONFIG_MESG=y 383CONFIG_MESG=y
382 384
@@ -391,6 +393,7 @@ CONFIG_FEATURE_ADDUSER_TO_GROUP=y
391CONFIG_DELGROUP=y 393CONFIG_DELGROUP=y
392CONFIG_FEATURE_DEL_USER_FROM_GROUP=y 394CONFIG_FEATURE_DEL_USER_FROM_GROUP=y
393CONFIG_ADDUSER=y 395CONFIG_ADDUSER=y
396CONFIG_FEATURE_ADDUSER_LONG_OPTIONS=y
394CONFIG_DELUSER=y 397CONFIG_DELUSER=y
395CONFIG_GETTY=y 398CONFIG_GETTY=y
396CONFIG_FEATURE_UTMP=y 399CONFIG_FEATURE_UTMP=y
@@ -459,6 +462,7 @@ CONFIG_FEATURE_SGI_LABEL=y
459CONFIG_FEATURE_SUN_LABEL=y 462CONFIG_FEATURE_SUN_LABEL=y
460CONFIG_FEATURE_OSF_LABEL=y 463CONFIG_FEATURE_OSF_LABEL=y
461CONFIG_FEATURE_FDISK_ADVANCED=y 464CONFIG_FEATURE_FDISK_ADVANCED=y
465CONFIG_FINDFS=y
462CONFIG_FREERAMDISK=y 466CONFIG_FREERAMDISK=y
463CONFIG_FSCK_MINIX=y 467CONFIG_FSCK_MINIX=y
464CONFIG_MKFS_MINIX=y 468CONFIG_MKFS_MINIX=y
@@ -479,14 +483,48 @@ CONFIG_IPCS=y
479CONFIG_LOSETUP=y 483CONFIG_LOSETUP=y
480CONFIG_MDEV=y 484CONFIG_MDEV=y
481CONFIG_FEATURE_MDEV_CONF=y 485CONFIG_FEATURE_MDEV_CONF=y
486CONFIG_FEATURE_MDEV_RENAME=y
482CONFIG_FEATURE_MDEV_EXEC=y 487CONFIG_FEATURE_MDEV_EXEC=y
483CONFIG_FEATURE_MDEV_LOAD_FIRMWARE=y 488CONFIG_FEATURE_MDEV_LOAD_FIRMWARE=y
484CONFIG_MKSWAP=y 489CONFIG_MKSWAP=y
485CONFIG_FEATURE_MKSWAP_V0=y 490CONFIG_FEATURE_MKSWAP_V0=y
486CONFIG_MORE=y 491CONFIG_MORE=y
487CONFIG_FEATURE_USE_TERMIOS=y 492CONFIG_FEATURE_USE_TERMIOS=y
493CONFIG_VOLUMEID=y
494CONFIG_FEATURE_VOLUMEID_EXT=y
495CONFIG_FEATURE_VOLUMEID_REISERFS=y
496CONFIG_FEATURE_VOLUMEID_FAT=y
497CONFIG_FEATURE_VOLUMEID_HFS=y
498CONFIG_FEATURE_VOLUMEID_JFS=y
499CONFIG_FEATURE_VOLUMEID_UFS=y
500CONFIG_FEATURE_VOLUMEID_XFS=y
501CONFIG_FEATURE_VOLUMEID_NTFS=y
502CONFIG_FEATURE_VOLUMEID_ISO9660=y
503CONFIG_FEATURE_VOLUMEID_UDF=y
504CONFIG_FEATURE_VOLUMEID_LUKS=y
505CONFIG_FEATURE_VOLUMEID_LINUXSWAP=y
506CONFIG_FEATURE_VOLUMEID_LVM=y
507CONFIG_FEATURE_VOLUMEID_CRAMFS=y
508CONFIG_FEATURE_VOLUMEID_HPFS=y
509CONFIG_FEATURE_VOLUMEID_ROMFS=y
510CONFIG_FEATURE_VOLUMEID_SYSV=y
511CONFIG_FEATURE_VOLUMEID_MINIX=y
512CONFIG_FEATURE_VOLUMEID_MAC=y
513CONFIG_FEATURE_VOLUMEID_MSDOS=y
514CONFIG_FEATURE_VOLUMEID_OCFS2=y
515CONFIG_FEATURE_VOLUMEID_HIGHPOINTRAID=y
516CONFIG_FEATURE_VOLUMEID_ISWRAID=y
517CONFIG_FEATURE_VOLUMEID_LSIRAID=y
518CONFIG_FEATURE_VOLUMEID_VIARAID=y
519CONFIG_FEATURE_VOLUMEID_SILICONRAID=y
520CONFIG_FEATURE_VOLUMEID_NVIDIARAID=y
521CONFIG_FEATURE_VOLUMEID_PROMISERAID=y
522CONFIG_FEATURE_VOLUMEID_LINUXRAID=y
488CONFIG_MOUNT=y 523CONFIG_MOUNT=y
524CONFIG_FEATURE_MOUNT_FAKE=y
525CONFIG_FEATURE_MOUNT_VERBOSE=y
489CONFIG_FEATURE_MOUNT_HELPERS=y 526CONFIG_FEATURE_MOUNT_HELPERS=y
527CONFIG_FEATURE_MOUNT_LABEL=y
490CONFIG_FEATURE_MOUNT_NFS=y 528CONFIG_FEATURE_MOUNT_NFS=y
491CONFIG_FEATURE_MOUNT_CIFS=y 529CONFIG_FEATURE_MOUNT_CIFS=y
492CONFIG_FEATURE_MOUNT_FLAGS=y 530CONFIG_FEATURE_MOUNT_FLAGS=y
@@ -494,6 +532,7 @@ CONFIG_FEATURE_MOUNT_FSTAB=y
494CONFIG_PIVOT_ROOT=y 532CONFIG_PIVOT_ROOT=y
495CONFIG_RDATE=y 533CONFIG_RDATE=y
496CONFIG_READPROFILE=y 534CONFIG_READPROFILE=y
535CONFIG_RTCWAKE=y
497CONFIG_SETARCH=y 536CONFIG_SETARCH=y
498CONFIG_SWAPONOFF=y 537CONFIG_SWAPONOFF=y
499CONFIG_SWITCH_ROOT=y 538CONFIG_SWITCH_ROOT=y
@@ -511,6 +550,14 @@ CONFIG_FEATURE_MOUNT_LOOP=y
511# 550#
512CONFIG_ADJTIMEX=y 551CONFIG_ADJTIMEX=y
513# CONFIG_BBCONFIG is not set 552# CONFIG_BBCONFIG is not set
553CONFIG_CHAT=y
554CONFIG_FEATURE_CHAT_NOFAIL=y
555CONFIG_FEATURE_CHAT_TTY_HIFI=y
556CONFIG_FEATURE_CHAT_IMPLICIT_CR=y
557CONFIG_FEATURE_CHAT_SWALLOW_OPTS=y
558CONFIG_FEATURE_CHAT_SEND_ESCAPES=y
559CONFIG_FEATURE_CHAT_VAR_ABORT_LEN=y
560CONFIG_FEATURE_CHAT_CLR_ABORT=y
514CONFIG_CHRT=y 561CONFIG_CHRT=y
515# CONFIG_CROND is not set 562# CONFIG_CROND is not set
516# CONFIG_DEBUG_CROND_OPTION is not set 563# CONFIG_DEBUG_CROND_OPTION is not set
@@ -523,6 +570,7 @@ CONFIG_DC=y
523# CONFIG_DEVFSD_VERBOSE is not set 570# CONFIG_DEVFSD_VERBOSE is not set
524# CONFIG_FEATURE_DEVFS is not set 571# CONFIG_FEATURE_DEVFS is not set
525CONFIG_EJECT=y 572CONFIG_EJECT=y
573CONFIG_FEATURE_EJECT_SCSI=y
526CONFIG_LAST=y 574CONFIG_LAST=y
527CONFIG_LESS=y 575CONFIG_LESS=y
528CONFIG_FEATURE_LESS_MAXLINES=9999999 576CONFIG_FEATURE_LESS_MAXLINES=9999999
@@ -564,6 +612,8 @@ CONFIG_FEATURE_PREFER_IPV4_ADDRESS=y
564CONFIG_VERBOSE_RESOLUTION_ERRORS=y 612CONFIG_VERBOSE_RESOLUTION_ERRORS=y
565CONFIG_ARP=y 613CONFIG_ARP=y
566CONFIG_ARPING=y 614CONFIG_ARPING=y
615CONFIG_BRCTL=y
616CONFIG_FEATURE_BRCTL_FANCY=y
567CONFIG_DNSD=y 617CONFIG_DNSD=y
568CONFIG_ETHER_WAKE=y 618CONFIG_ETHER_WAKE=y
569CONFIG_FAKEIDENTD=y 619CONFIG_FAKEIDENTD=y
@@ -633,9 +683,15 @@ CONFIG_FEATURE_NETSTAT_WIDE=y
633CONFIG_NSLOOKUP=y 683CONFIG_NSLOOKUP=y
634CONFIG_PING=y 684CONFIG_PING=y
635CONFIG_PING6=y 685CONFIG_PING6=y
636CONFIG_PSCAN=y
637CONFIG_FEATURE_FANCY_PING=y 686CONFIG_FEATURE_FANCY_PING=y
687CONFIG_PSCAN=y
638CONFIG_ROUTE=y 688CONFIG_ROUTE=y
689CONFIG_SENDMAIL=y
690CONFIG_FEATURE_SENDMAIL_EHLO=y
691CONFIG_FEATURE_SENDMAIL_BLOATY=y
692CONFIG_FETCHMAIL=y
693CONFIG_FEATURE_FETCHMAIL_APOP=y
694CONFIG_FEATURE_FETCHMAIL_FILTER=y
639CONFIG_SLATTACH=y 695CONFIG_SLATTACH=y
640CONFIG_TELNET=y 696CONFIG_TELNET=y
641CONFIG_FEATURE_TELNET_TTYPE=y 697CONFIG_FEATURE_TELNET_TTYPE=y
@@ -657,6 +713,7 @@ CONFIG_APP_DUMPLEASES=y
657CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY=y 713CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY=y
658CONFIG_APP_UDHCPC=y 714CONFIG_APP_UDHCPC=y
659CONFIG_FEATURE_UDHCPC_ARPING=y 715CONFIG_FEATURE_UDHCPC_ARPING=y
716CONFIG_FEATURE_UDHCP_PORT=y
660CONFIG_FEATURE_UDHCP_DEBUG=y 717CONFIG_FEATURE_UDHCP_DEBUG=y
661CONFIG_FEATURE_RFC3397=y 718CONFIG_FEATURE_RFC3397=y
662CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80 719CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80
diff --git a/init/init.c b/init/init.c
index a82b45b7c..13410ac39 100644
--- a/init/init.c
+++ b/init/init.c
@@ -117,11 +117,13 @@ static void loop_forever(void)
117} 117}
118 118
119/* Print a message to the specified device. 119/* Print a message to the specified device.
120 * Device may be bitwise-or'd from L_LOG | L_CONSOLE */ 120 * "where" may be bitwise-or'd from L_LOG | L_CONSOLE
121 * NB: careful, we can be called after vfork!
122 */
121#define messageD(...) do { if (ENABLE_DEBUG_INIT) message(__VA_ARGS__); } while (0) 123#define messageD(...) do { if (ENABLE_DEBUG_INIT) message(__VA_ARGS__); } while (0)
122static void message(int device, const char *fmt, ...) 124static void message(int where, const char *fmt, ...)
123 __attribute__ ((format(printf, 2, 3))); 125 __attribute__ ((format(printf, 2, 3)));
124static void message(int device, const char *fmt, ...) 126static void message(int where, const char *fmt, ...)
125{ 127{
126 static int log_fd = -1; 128 static int log_fd = -1;
127 va_list arguments; 129 va_list arguments;
@@ -137,7 +139,7 @@ static void message(int device, const char *fmt, ...)
137 139
138 if (ENABLE_FEATURE_INIT_SYSLOG) { 140 if (ENABLE_FEATURE_INIT_SYSLOG) {
139 /* Log the message to syslogd */ 141 /* Log the message to syslogd */
140 if (device & L_LOG) { 142 if (where & L_LOG) {
141 /* don't out "\r" */ 143 /* don't out "\r" */
142 openlog(applet_name, 0, LOG_DAEMON); 144 openlog(applet_name, 0, LOG_DAEMON);
143 syslog(LOG_INFO, "init: %s", msg + 1); 145 syslog(LOG_INFO, "init: %s", msg + 1);
@@ -157,20 +159,20 @@ static void message(int device, const char *fmt, ...)
157 log_fd = device_open(log_console, O_WRONLY | O_NONBLOCK | O_NOCTTY); 159 log_fd = device_open(log_console, O_WRONLY | O_NONBLOCK | O_NOCTTY);
158 if (log_fd < 0) { 160 if (log_fd < 0) {
159 bb_error_msg("can't log to %s", log_console); 161 bb_error_msg("can't log to %s", log_console);
160 device = L_CONSOLE; 162 where = L_CONSOLE;
161 } else { 163 } else {
162 close_on_exec_on(log_fd); 164 close_on_exec_on(log_fd);
163 } 165 }
164 } 166 }
165 } 167 }
166 if (device & L_LOG) { 168 if (where & L_LOG) {
167 full_write(log_fd, msg, l); 169 full_write(log_fd, msg, l);
168 if (log_fd == 2) 170 if (log_fd == 2)
169 return; /* don't print dup messages */ 171 return; /* don't print dup messages */
170 } 172 }
171 } 173 }
172 174
173 if (device & L_CONSOLE) { 175 if (where & L_CONSOLE) {
174 /* Send console messages to console so people will see them. */ 176 /* Send console messages to console so people will see them. */
175 full_write(2, msg, l); 177 full_write(2, msg, l);
176 } 178 }
@@ -233,7 +235,8 @@ static void console_init(void)
233 putenv((char*)"TERM=linux"); 235 putenv((char*)"TERM=linux");
234} 236}
235 237
236/* Set terminal settings to reasonable defaults */ 238/* Set terminal settings to reasonable defaults.
239 * NB: careful, we can be called after vfork! */
237static void set_sane_term(void) 240static void set_sane_term(void)
238{ 241{
239 struct termios tty; 242 struct termios tty;
@@ -270,7 +273,8 @@ static void set_sane_term(void)
270 tcsetattr(STDIN_FILENO, TCSANOW, &tty); 273 tcsetattr(STDIN_FILENO, TCSANOW, &tty);
271} 274}
272 275
273/* Open the new terminal device */ 276/* Open the new terminal device.
277 * NB: careful, we can be called after vfork! */
274static void open_stdio_to_tty(const char* tty_name, int exit_on_failure) 278static void open_stdio_to_tty(const char* tty_name, int exit_on_failure)
275{ 279{
276 /* empty tty_name means "use init's tty", else... */ 280 /* empty tty_name means "use init's tty", else... */
@@ -286,6 +290,8 @@ static void open_stdio_to_tty(const char* tty_name, int exit_on_failure)
286 _exit(1); 290 _exit(1);
287 if (ENABLE_DEBUG_INIT) 291 if (ENABLE_DEBUG_INIT)
288 _exit(2); 292 _exit(2);
293 /* NB: we don't reach this if we were called after vfork.
294 * Thus halt_reboot_pwoff() itself need not be vfork-safe. */
289 halt_reboot_pwoff(SIGUSR1); /* halt the system */ 295 halt_reboot_pwoff(SIGUSR1); /* halt the system */
290 } 296 }
291 dup2(0, 1); 297 dup2(0, 1);
@@ -294,22 +300,24 @@ static void open_stdio_to_tty(const char* tty_name, int exit_on_failure)
294 set_sane_term(); 300 set_sane_term();
295} 301}
296 302
297/* wrapper around exec: 303/* Wrapper around exec:
298 * takes string (max COMMAND_SIZE chars) 304 * Takes string (max COMMAND_SIZE chars).
299 * runs [-]/bin/sh -c "exec ......." if '>' etc detected. 305 * If chars like '>' detected, execs '[-]/bin/sh -c "exec ......."'.
300 * otherwise splits words on whitespace and deals with leading dash. 306 * Otherwise splits words on whitespace, deals with leading dash,
307 * and uses plain exec().
308 * NB: careful, we can be called after vfork!
301 */ 309 */
302static void init_exec(const char *command) 310static void init_exec(const char *command)
303{ 311{
304 char *cmd[COMMAND_SIZE / 2]; 312 char *cmd[COMMAND_SIZE / 2];
305 char buf[COMMAND_SIZE + 6]; /* COMMAND_SIZE+strlen("exec ")+1 */ 313 char buf[COMMAND_SIZE + 6]; /* COMMAND_SIZE+strlen("exec ")+1 */
306 int dash = (command[0] == '-'); 314 int dash = (command[0] == '-' /* maybe? && command[1] == '/' */);
307 315
308 /* See if any special /bin/sh requiring characters are present */ 316 /* See if any special /bin/sh requiring characters are present */
309 if (strpbrk(command, "~`!$^&*()=|\\{}[];\"'<>?") != NULL) { 317 if (strpbrk(command, "~`!$^&*()=|\\{}[];\"'<>?") != NULL) {
310 strcpy(buf, "exec "); 318 strcpy(buf, "exec ");
311 strcpy(buf + 5, command + dash); /* excluding "-" */ 319 strcpy(buf + 5, command + dash); /* excluding "-" */
312 /* LIBBB_DEFAULT_LOGIN_SHELL has leading dash */ 320 /* NB: LIBBB_DEFAULT_LOGIN_SHELL define has leading dash */
313 cmd[0] = (char*)(LIBBB_DEFAULT_LOGIN_SHELL + !dash); 321 cmd[0] = (char*)(LIBBB_DEFAULT_LOGIN_SHELL + !dash);
314 cmd[1] = (char*)"-c"; 322 cmd[1] = (char*)"-c";
315 cmd[2] = buf; 323 cmd[2] = buf;
@@ -351,7 +359,7 @@ static pid_t run(const struct init_action *a)
351 sigemptyset(&nmask); 359 sigemptyset(&nmask);
352 sigaddset(&nmask, SIGCHLD); 360 sigaddset(&nmask, SIGCHLD);
353 sigprocmask(SIG_BLOCK, &nmask, &omask); 361 sigprocmask(SIG_BLOCK, &nmask, &omask);
354 pid = fork(); 362 pid = vfork();
355 sigprocmask(SIG_SETMASK, &omask, NULL); 363 sigprocmask(SIG_SETMASK, &omask, NULL);
356 364
357 if (pid < 0) 365 if (pid < 0)
@@ -379,8 +387,9 @@ static pid_t run(const struct init_action *a)
379 setsid(); 387 setsid();
380 388
381 /* Open the new terminal device */ 389 /* Open the new terminal device */
382 open_stdio_to_tty(a->terminal, 1 /* - exit if open fails*/); 390 open_stdio_to_tty(a->terminal, 1 /* - exit if open fails */);
383 391
392// NB: do not enable unless you change vfork to fork above
384#ifdef BUT_RUN_ACTIONS_ALREADY_DOES_WAITING 393#ifdef BUT_RUN_ACTIONS_ALREADY_DOES_WAITING
385 /* If the init Action requires us to wait, then force the 394 /* If the init Action requires us to wait, then force the
386 * supplied terminal to be the controlling tty. */ 395 * supplied terminal to be the controlling tty. */
@@ -424,7 +433,9 @@ static pid_t run(const struct init_action *a)
424 /* Child - fall though to actually execute things */ 433 /* Child - fall though to actually execute things */
425 } 434 }
426#endif 435#endif
427 if (a->action_type & ASKFIRST) { 436
437 /* NB: on NOMMU we can't wait for input in child */
438 if (BB_MMU && (a->action_type & ASKFIRST)) {
428 static const char press_enter[] ALIGN1 = 439 static const char press_enter[] ALIGN1 =
429#ifdef CUSTOMIZED_BANNER 440#ifdef CUSTOMIZED_BANNER
430#include CUSTOMIZED_BANNER 441#include CUSTOMIZED_BANNER
@@ -809,7 +820,8 @@ static void reload_signal(int sig ATTRIBUTE_UNUSED)
809 } 820 }
810 } 821 }
811#if CONFIG_FEATURE_KILL_DELAY 822#if CONFIG_FEATURE_KILL_DELAY
812 if (fork() == 0) { /* child */ 823 /* NB: parent will wait in NOMMU case */
824 if ((BB_MMU ? fork() : vfork()) == 0) { /* child */
813 sleep(CONFIG_FEATURE_KILL_DELAY); 825 sleep(CONFIG_FEATURE_KILL_DELAY);
814 for (a = init_action_list; a; a = a->next) { 826 for (a = init_action_list; a; a = a->next) {
815 pid_t pid = a->pid; 827 pid_t pid = a->pid;
diff --git a/networking/httpd.c b/networking/httpd.c
index 2c580b032..bcd1126a6 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -2192,7 +2192,7 @@ static void mini_httpd_nommu(int server_socket, int argc, char **argv)
2192 2192
2193 /* Wait for connections... */ 2193 /* Wait for connections... */
2194 fromAddr.len = LSA_SIZEOF_SA; 2194 fromAddr.len = LSA_SIZEOF_SA;
2195 n = accept(server_socket, &fromAddr.sa, &fromAddr.len); 2195 n = accept(server_socket, &fromAddr.u.sa, &fromAddr.len);
2196 2196
2197 if (n < 0) 2197 if (n < 0)
2198 continue; 2198 continue;