Update to FreeBSD head 2016-08-23

Git mirror commit 9fe7c416e6abb28b1398fd3e5687099846800cfd.
This commit is contained in:
Sebastian Huber
2016-10-07 15:10:20 +02:00
parent 8c0eebac7d
commit c40e45b75e
1040 changed files with 156866 additions and 67039 deletions

View File

@@ -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);
}
}