Parameters for localtime_r() and gmtime_r() definitions changed.
Parameters for pthread_getspecific() call changed. pthread_keycreate() renamed to pthread_key_create().
This commit is contained in:
parent
3384e369af
commit
c1f20410c2
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=19636
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user