mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-10-17 21:04:56 +08:00
Update to FreeBSD head 2016-08-23
Git mirror commit 9fe7c416e6abb28b1398fd3e5687099846800cfd.
This commit is contained in:
@@ -77,7 +77,7 @@ __res_init_ctx(void) {
|
||||
return (0);
|
||||
}
|
||||
|
||||
if ((mt = malloc(sizeof (mtctxres_t))) == 0) {
|
||||
if ((mt = malloc(sizeof(mtctxres_t))) == NULL) {
|
||||
errno = ENOMEM;
|
||||
return (-1);
|
||||
}
|
||||
@@ -96,10 +96,7 @@ __res_init_ctx(void) {
|
||||
static void
|
||||
__res_destroy_ctx(void *value) {
|
||||
|
||||
mtctxres_t *mt = (mtctxres_t *)value;
|
||||
|
||||
if (mt != 0)
|
||||
free(mt);
|
||||
free(value);
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -134,9 +131,9 @@ ___mtctxres(void) {
|
||||
* that fails return a global context.
|
||||
*/
|
||||
if (mt_key_initialized) {
|
||||
if (((mt = pthread_getspecific(key)) != 0) ||
|
||||
if (((mt = pthread_getspecific(key)) != NULL) ||
|
||||
(__res_init_ctx() == 0 &&
|
||||
(mt = pthread_getspecific(key)) != 0)) {
|
||||
(mt = pthread_getspecific(key)) != NULL)) {
|
||||
return (mt);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user