aboutsummaryrefslogtreecommitdiffstats
path: root/c/sh.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/sh.c')
-rw-r--r--c/sh.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/c/sh.c b/c/sh.c
index a8dd09d..3178894 100644
--- a/c/sh.c
+++ b/c/sh.c
@@ -155,6 +155,12 @@ void main(void) {
char *tok[16];
char cwd[40];
cwd[0] = '/'; cwd[1] = 0;
+ /* bring up networking first: run the DHCP client and wait for it to finish
+ (got a lease, or gave up). Only then drop to the prompt. */
+ {
+ unsigned char d = lookup("dhcp");
+ if (d != NOFD) { if (fork() == 0) exec(d); else wait(); }
+ }
for (;;) {
unsigned char nt, i, pipepos, c, bg;
/* reap finished background jobs */