pthreadcreate.c: Fix bug where attr used instead of the_attr

This commit is contained in:
Joel Sherrill
2014-04-03 15:03:42 -05:00
parent a0a073d1c9
commit 68c156aea7
+13 -14
View File
@@ -9,7 +9,8 @@
* 16.1.2 Thread Creation, P1003.1c/Draft 10, p. 144
*/
/* COPYRIGHT (c) 1989-2008.
/*
* COPYRIGHT (c) 1989-2014.
* On-Line Applications Research Corporation (OAR).
*
* The license and distribution terms for this file may be
@@ -142,7 +143,7 @@ int pthread_create(
#if defined(RTEMS_SMP)
#if __RTEMS_HAVE_SYS_CPUSET_H__
status = _CPU_set_Is_valid( the_attr->affinityset, the_attr->affinitysetsize );
if (!status )
if ( !status )
return EINVAL;
#endif
#endif
@@ -191,19 +192,17 @@ int pthread_create(
return EAGAIN;
}
#if defined(RTEMS_SMP)
#if __RTEMS_HAVE_SYS_CPUSET_H__
status = _Scheduler_Set_affinity(
the_thread,
attr->affinitysetsize,
attr->affinityset
#if defined(RTEMS_SMP) && __RTEMS_HAVE_SYS_CPUSET_H__
status = _Scheduler_Set_affinity(
the_thread,
the_attr->affinitysetsize,
the_attr->affinityset
);
if ( !status ) {
_POSIX_Threads_Free( the_thread );
_RTEMS_Unlock_allocator();
return EINVAL;
}
#endif
if ( !status ) {
_POSIX_Threads_Free( the_thread );
_RTEMS_Unlock_allocator();
return EINVAL;
}
#endif
/*