Submitted by: Jeremy Allison (jallison@whistle.com)
fix a slight confusion about which draft of threads we are supporting. this allows something as big and ugly as samba to be compiled with libc_r and still work! our user-level pthreads seems amazingly robust!
This commit is contained in:
parent
934fb1c520
commit
39a9295edc
@ -126,9 +126,7 @@ __ttyname_basic(int fd)
|
||||
pthread_mutex_unlock(&ttyname_lock);
|
||||
|
||||
/* Must have thread specific data field to put data */
|
||||
if ((buf = pthread_getspecific(ttyname_key)) != 0) {
|
||||
return (NULL);
|
||||
} else if (buf == NULL) {
|
||||
if ((buf = pthread_getspecific(ttyname_key)) == NULL) {
|
||||
if ((buf = malloc(sizeof(_PATH_DEV) + MAXNAMLEN)) != NULL) {
|
||||
if (pthread_setspecific(ttyname_key, buf) != 0) {
|
||||
free(buf);
|
||||
|
@ -1191,9 +1191,11 @@ const time_t * const timep;
|
||||
}
|
||||
}
|
||||
pthread_mutex_unlock(&gmtime_mutex);
|
||||
if ((p_tm = pthread_getspecific(gmtime_key)) != 0) {
|
||||
return(NULL);
|
||||
} else if (p_tm == NULL) {
|
||||
/*
|
||||
* Changed to follow draft 4 pthreads standard, which
|
||||
* is what BSD currently has.
|
||||
*/
|
||||
if ((p_tm = pthread_getspecific(gmtime_key)) == NULL) {
|
||||
if ((p_tm = (struct tm *)malloc(sizeof(struct tm))) == NULL) {
|
||||
return(NULL);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user