diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2013-11-22 22:29:31 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2013-11-22 22:29:31 +0100 |
commit | 55d31f2cab0101dfbdeb2857e2fce2629080cf02 (patch) | |
tree | 90a653927ee803495d55ca049e45157cb0bf5339 /sys/src/9/pc/ether82557.c | |
parent | df6b68092cf2806d7c517e15d2db57b0b19a9788 (diff) |
pc kernel: kproc error and exit
catch the error() that can be thrown by sleep() and tsleep()
in kprocs.
add missing pexit() calls.
always set the freemem argument to pexit() from kproc otherwise
the process gets added to the broken list.
Diffstat (limited to 'sys/src/9/pc/ether82557.c')
-rw-r--r-- | sys/src/9/pc/ether82557.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/src/9/pc/ether82557.c b/sys/src/9/pc/ether82557.c index be7971d67..7194d39c8 100644 --- a/sys/src/9/pc/ether82557.c +++ b/sys/src/9/pc/ether82557.c @@ -348,6 +348,8 @@ watchdog(void* arg) static void txstart(Ether*); ether = arg; + while(waserror()) + ; for(;;){ tsleep(&up->sleep, return0, 0, 4000); @@ -357,10 +359,8 @@ watchdog(void* arg) * the future. */ ctlr = ether->ctlr; - if(ctlr == nil || ctlr->state == 0){ - print("%s: exiting\n", up->text); - pexit("disabled", 0); - } + if(ctlr == nil || ctlr->state == 0) + break; ilock(&ctlr->cblock); if(ctlr->tick++){ @@ -369,6 +369,8 @@ watchdog(void* arg) } iunlock(&ctlr->cblock); } + print("%s: exiting\n", up->text); + pexit("disabled", 1); } static void |