summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorhsu <hsu@FreeBSD.org>1996-11-11 09:14:24 +0000
committerhsu <hsu@FreeBSD.org>1996-11-11 09:14:24 +0000
commit9c65a1a1867e5bf9e2dcdd8a6af3b1a004df06bd (patch)
tree842bfdbd1e9427eca164cb6bfaaf2fbc7efd0c80 /lib
parent15c6125d87839a2edaa4dde400712b261f3701c6 (diff)
downloadFreeBSD-src-9c65a1a1867e5bf9e2dcdd8a6af3b1a004df06bd.zip
FreeBSD-src-9c65a1a1867e5bf9e2dcdd8a6af3b1a004df06bd.tar.gz
Parameters for localtime_r() and gmtime_r() definitions changed.
Parameters for pthread_getspecific() call changed. pthread_keycreate() renamed to pthread_key_create().
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdtime/localtime.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/libc/stdtime/localtime.c b/lib/libc/stdtime/localtime.c
index 5774354..35a7071 100644
--- a/lib/libc/stdtime/localtime.c
+++ b/lib/libc/stdtime/localtime.c
@@ -1077,7 +1077,7 @@ struct tm * const tmp;
}
#ifdef _THREAD_SAFE
-int
+struct tm *
localtime_r(timep, p_tm)
const time_t * const timep;
struct tm *p_tm;
@@ -1086,7 +1086,7 @@ struct tm *p_tm;
tzset();
localsub(timep, 0L, p_tm);
pthread_mutex_unlock(&lcl_mutex);
- return(0);
+ return(p_tm);
}
#endif
@@ -1102,13 +1102,13 @@ const time_t * const timep;
pthread_mutex_lock(&localtime_mutex);
if (localtime_key < 0) {
- if (pthread_keycreate(&localtime_key, free) < 0) {
+ if (pthread_key_create(&localtime_key, free) < 0) {
pthread_mutex_unlock(&localtime_mutex);
return(NULL);
}
}
pthread_mutex_unlock(&localtime_mutex);
- if (pthread_getspecific(localtime_key,(void **) &p_tm) != 0) {
+ if ((p_tm = pthread_getspecific(localtime_key)) != 0) {
return(NULL);
} else if (p_tm == NULL) {
if ((p_tm = (struct tm *)malloc(sizeof(struct tm))) == NULL) {
@@ -1186,13 +1186,13 @@ const time_t * const timep;
pthread_mutex_lock(&gmtime_mutex);
if (gmtime_key < 0) {
- if (pthread_keycreate(&gmtime_key, free) < 0) {
+ if (pthread_key_create(&gmtime_key, free) < 0) {
pthread_mutex_unlock(&gmtime_mutex);
return(NULL);
}
}
pthread_mutex_unlock(&gmtime_mutex);
- if (pthread_getspecific(gmtime_key,(void **) &p_tm) != 0) {
+ if ((p_tm = pthread_getspecific(gmtime_key)) != 0) {
return(NULL);
} else if (p_tm == NULL) {
if ((p_tm = (struct tm *)malloc(sizeof(struct tm))) == NULL) {
@@ -1209,11 +1209,11 @@ const time_t * const timep;
}
#ifdef _THREAD_SAFE
-int
+struct tm *
gmtime_r(const time_t * timep, struct tm * tm)
{
gmtsub(timep, 0L, tm);
- return(0);
+ return(tm);
}
#endif
OpenPOWER on IntegriCloud