diff options
Diffstat (limited to 'cpukit/libcsupport/src/privateenv.c')
-rw-r--r-- | cpukit/libcsupport/src/privateenv.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cpukit/libcsupport/src/privateenv.c b/cpukit/libcsupport/src/privateenv.c index 29821e4045..bf6036a1b3 100644 --- a/cpukit/libcsupport/src/privateenv.c +++ b/cpukit/libcsupport/src/privateenv.c @@ -57,7 +57,8 @@ rtems_status_code rtems_libio_set_private_env(void) bool uses_global_env = old_env == &rtems_global_user_env; if (uses_global_env) { - bool life_protection = _Thread_Set_life_protection(true); + Thread_Life_state life_state = + _Thread_Set_life_protection(THREAD_LIFE_PROTECTED); rtems_user_env_t *new_env = calloc(1, sizeof(*new_env)); if (new_env != NULL) { @@ -92,7 +93,7 @@ rtems_status_code rtems_libio_set_private_env(void) sc = RTEMS_NO_MEMORY; } - _Thread_Set_life_protection(life_protection); + _Thread_Set_life_protection(life_state); } return sc; @@ -104,11 +105,12 @@ void rtems_libio_use_global_env(void) bool uses_private_env = env != &rtems_global_user_env; if (uses_private_env) { - bool life_protection = _Thread_Set_life_protection(true); + Thread_Life_state life_state = + _Thread_Set_life_protection(THREAD_LIFE_PROTECTED); rtems_libio_free_user_env(env); pthread_setspecific(rtems_current_user_env_key, NULL); - _Thread_Set_life_protection(life_protection); + _Thread_Set_life_protection(life_state); } } |