summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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