summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjulian <julian@FreeBSD.org>1998-02-18 01:20:33 +0000
committerjulian <julian@FreeBSD.org>1998-02-18 01:20:33 +0000
commit6d639f103c1aa569f6322279c34d9479bac16505 (patch)
treecc0b7b43f4b5c2d41829f82122695c753018a0e9
parent62e49a374eb3e45ff4db78edf773aab1059b5a22 (diff)
downloadFreeBSD-src-6d639f103c1aa569f6322279c34d9479bac16505.zip
FreeBSD-src-6d639f103c1aa569f6322279c34d9479bac16505.tar.gz
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!
-rw-r--r--lib/libc/gen/ttyname.c4
-rw-r--r--lib/libc/stdtime/localtime.c8
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/libc/gen/ttyname.c b/lib/libc/gen/ttyname.c
index b2f3f79..be2de59 100644
--- a/lib/libc/gen/ttyname.c
+++ b/lib/libc/gen/ttyname.c
@@ -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);
diff --git a/lib/libc/stdtime/localtime.c b/lib/libc/stdtime/localtime.c
index 3438cc6..204bac0 100644
--- a/lib/libc/stdtime/localtime.c
+++ b/lib/libc/stdtime/localtime.c
@@ -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);
}
OpenPOWER on IntegriCloud