Fixed segfault on quit with Xenomai, due to bat parameter type in waitReceiveTaskEnd.
--- a/drivers/timers_unix/timers_unix.c Mon Feb 18 17:14:22 2008 +0100
+++ b/drivers/timers_unix/timers_unix.c Tue Feb 19 14:52:40 2008 +0100
@@ -73,10 +73,10 @@
pthread_create(Thread, NULL, ReceiveLoopPtr, (void*)port);
}
-void WaitReceiveTaskEnd(TASK_HANDLE Thread)
+void WaitReceiveTaskEnd(TASK_HANDLE *Thread)
{
- pthread_kill(Thread, SIGTERM);
- pthread_join(Thread, NULL);
+ pthread_kill(*Thread, SIGTERM);
+ pthread_join(*Thread, NULL);
}
#define maxval(a,b) ((a>b)?a:b)
--- a/drivers/unix/unix.c Mon Feb 18 17:14:22 2008 +0100
+++ b/drivers/unix/unix.c Tue Feb 19 14:52:40 2008 +0100
@@ -190,7 +190,7 @@
int res = DLL_CALL(canClose)(tmp->fd);
- WaitReceiveTaskEnd(tmp->receiveTask);
+ WaitReceiveTaskEnd(&tmp->receiveTask);
return res;
}
--- a/include/timers_driver.h Mon Feb 18 17:14:22 2008 +0100
+++ b/include/timers_driver.h Tue Feb 19 14:52:40 2008 +0100
@@ -30,7 +30,7 @@
// For use from CAN driver
void EnterMutex(void);
void LeaveMutex(void);
-void WaitReceiveTaskEnd(TASK_HANDLE);
+void WaitReceiveTaskEnd(TASK_HANDLE*);
// For use from application
void StartTimerLoop(TimerCallback_t init_callback);