From 0736203a630b2fbc2bc3e6383e4aec9285bba184 Mon Sep 17 00:00:00 2001
From: Pixel <pixel@nobis-crew.org>
Date: Sat, 5 Feb 2011 08:31:33 -0800
Subject: Context switch also means switching that global errno variable.

---
 FreeRTOS/Source/tasks.c | 1 +
 1 file changed, 1 insertion(+)

(limited to 'FreeRTOS/Source')

diff --git a/FreeRTOS/Source/tasks.c b/FreeRTOS/Source/tasks.c
index 6ad1c58..1aac8f2 100644
--- a/FreeRTOS/Source/tasks.c
+++ b/FreeRTOS/Source/tasks.c
@@ -1641,6 +1641,7 @@ void vTaskSwitchContext( void )
 
 	#if ( configUSE_NEWLIB_REENTRANT == 1 )
 		_impure_ptr = &(pxCurrentTCB->reent);
+		errno = _impure_ptr->_errno;
 	#endif
 
 	traceTASK_SWITCHED_IN();
-- 
cgit v1.2.3