From 1629c207b5f2ad52c05043e9de9de12d53633349 Mon Sep 17 00:00:00 2001 From: oliverschmidt Date: Wed, 23 May 2007 22:13:29 +0000 Subject: [PATCH] That PROCESS_EXITHANDLER() thing was after all kind of overengineered... --- cpu/native/net/tapdev-drv.c | 10 +++------- cpu/native/net/wpcap-drv.c | 11 +++-------- doc/example-packet-drv.c | 14 +++++--------- 3 files changed, 11 insertions(+), 24 deletions(-) diff --git a/cpu/native/net/tapdev-drv.c b/cpu/native/net/tapdev-drv.c index 130634538..b156ee49e 100644 --- a/cpu/native/net/tapdev-drv.c +++ b/cpu/native/net/tapdev-drv.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * @(#)$Id: tapdev-drv.c,v 1.1 2007/05/20 21:32:24 oliverschmidt Exp $ + * @(#)$Id: tapdev-drv.c,v 1.2 2007/05/23 22:13:29 oliverschmidt Exp $ */ #include "contiki-net.h" @@ -77,12 +77,6 @@ pollhandler(void) } } /*---------------------------------------------------------------------------*/ -static void -exithandler(void) -{ - tapdev_exit(); -} -/*---------------------------------------------------------------------------*/ PROCESS_THREAD(tapdev_process, ev, data) { PROCESS_POLLHANDLER(pollhandler()); @@ -98,6 +92,8 @@ PROCESS_THREAD(tapdev_process, ev, data) PROCESS_WAIT_UNTIL(ev == PROCESS_EVENT_EXIT); + tapdev_exit(); + PROCESS_END(); } /*---------------------------------------------------------------------------*/ diff --git a/cpu/native/net/wpcap-drv.c b/cpu/native/net/wpcap-drv.c index 9f37c8001..bc65464ec 100644 --- a/cpu/native/net/wpcap-drv.c +++ b/cpu/native/net/wpcap-drv.c @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * @(#)$Id: wpcap-drv.c,v 1.1 2007/05/20 21:32:24 oliverschmidt Exp $ + * @(#)$Id: wpcap-drv.c,v 1.2 2007/05/23 22:13:29 oliverschmidt Exp $ */ #include "contiki-net.h" @@ -79,16 +79,9 @@ pollhandler(void) } } /*---------------------------------------------------------------------------*/ -static void -exithandler(void) -{ - wpcap_exit(); -} -/*---------------------------------------------------------------------------*/ PROCESS_THREAD(wpcap_process, ev, data) { PROCESS_POLLHANDLER(pollhandler()); - PROCESS_EXITHANDLER(exithandler()); PROCESS_BEGIN(); @@ -100,6 +93,8 @@ PROCESS_THREAD(wpcap_process, ev, data) PROCESS_WAIT_UNTIL(ev == PROCESS_EVENT_EXIT); + wpcap_exit(); + PROCESS_END(); } /*---------------------------------------------------------------------------*/ diff --git a/doc/example-packet-drv.c b/doc/example-packet-drv.c index dd255efeb..e89c917b8 100644 --- a/doc/example-packet-drv.c +++ b/doc/example-packet-drv.c @@ -80,15 +80,6 @@ pollhandler(void) process_poll(&example_packet_driver_process); } /*---------------------------------------------------------------------------*/ -/* - * Here we shutdown the hardware in case the process exits. - */ -static void -exithandler(void) -{ - shutdown_the_hardware(); -} -/*---------------------------------------------------------------------------*/ /* * Finally, we define the process that does the work. */ @@ -135,6 +126,11 @@ PROCESS_THREAD(example_packet_driver_process, ev, data) */ PROCESS_WAIT_EVENT_UNTIL(ev == PROCESS_EVENT_EXIT); + /* + * Now we shutdown the hardware. + */ + shutdown_the_hardware(); + /* * Here ends the process. */