mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-13 10:02:38 +00:00
__error could be called too early before libthr is initialized, test
this case and return global varible errno instead.
This commit is contained in:
parent
b31da03fd8
commit
9bbc6c7f54
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=160284
@ -45,10 +45,12 @@ extern int errno;
|
||||
int *
|
||||
__error(void)
|
||||
{
|
||||
struct pthread *curthread = _get_curthread();
|
||||
struct pthread *curthread;
|
||||
|
||||
if (curthread != NULL && curthread != _thr_initial)
|
||||
return (&curthread->error);
|
||||
else
|
||||
return (&errno);
|
||||
if (_thr_initial != NULL) {
|
||||
curthread = _get_curthread();
|
||||
if (curthread != NULL && curthread != _thr_initial)
|
||||
return (&curthread->error);
|
||||
}
|
||||
return (&errno);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user