Merge pull request #113 from triplef/fix-pthread-setname

Use pthread_setname_np result instead of errno.
This commit is contained in:
rfm 2020-03-29 11:33:49 +01:00 committed by GitHub
commit 2dae7185f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 7 deletions

View file

@ -1,3 +1,8 @@
2020-03-29 Frederik Seiffert <frederik@algoriddim.com>
* Source/NSThread.m: Use pthread_setname_np result instead of errno,
which fixes setting thread name on platforms where errno is not set.
2020-03-29 Frederik Seiffert <frederik@algoriddim.com>
* Source/NSURLResponse.m: Fix parsing of NSURLResponse content type

View file

@ -1241,12 +1241,7 @@ unregisterActiveThread(NSThread *thread)
}
while (i > 0)
{
if (PTHREAD_SETNAME(buf) == 0)
{
break; // Success
}
if (ERANGE == errno)
if (PTHREAD_SETNAME(buf) == ERANGE)
{
/* Name must be too long ... gnu/linux uses 15 characters
*/
@ -1274,7 +1269,7 @@ unregisterActiveThread(NSThread *thread)
}
else
{
break; // Some other error
break; // Success or some other error
}
}
}