summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/ttyname.c
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 /lib/libc/gen/ttyname.c
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!
Diffstat (limited to 'lib/libc/gen/ttyname.c')
-rw-r--r--lib/libc/gen/ttyname.c4
1 files changed, 1 insertions, 3 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);
OpenPOWER on IntegriCloud