Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christopher Ng
OpenLDAP
Commits
399b57ea
Commit
399b57ea
authored
21 years ago
by
Luke Howard
Browse files
Options
Downloads
Patches
Plain Diff
Use gmtime_r() if HAVE_GMTIME_R is defined (need to add autoconf check)
parent
369b1515
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
servers/slapd/init.c
+4
-0
4 additions, 0 deletions
servers/slapd/init.c
servers/slapd/modify.c
+9
-0
9 additions, 0 deletions
servers/slapd/modify.c
servers/slapd/proto-slap.h
+2
-0
2 additions, 0 deletions
servers/slapd/proto-slap.h
servers/slapd/schema.c
+9
-0
9 additions, 0 deletions
servers/slapd/schema.c
with
24 additions
and
0 deletions
servers/slapd/init.c
+
4
−
0
View file @
399b57ea
...
...
@@ -65,7 +65,9 @@ struct berval NoAttrs = BER_BVC( LDAP_NO_ATTRS );
*/
ldap_pvt_thread_pool_t
connection_pool
;
int
connection_pool_max
=
SLAP_MAX_WORKER_THREADS
;
#ifndef HAVE_GMTIME_R
ldap_pvt_thread_mutex_t
gmtime_mutex
;
#endif
#if defined( SLAPD_CRYPT ) || defined( SLAPD_SPASSWD )
ldap_pvt_thread_mutex_t
passwd_mutex
;
#endif
...
...
@@ -153,7 +155,9 @@ slap_init( int mode, const char *name )
}
#endif
#ifndef HAVE_GMTIME_R
ldap_pvt_thread_mutex_init
(
&
gmtime_mutex
);
#endif
#if defined( SLAPD_CRYPT ) || defined( SLAPD_SPASSWD )
ldap_pvt_thread_mutex_init
(
&
passwd_mutex
);
#endif
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/modify.c
+
9
−
0
View file @
399b57ea
...
...
@@ -801,15 +801,24 @@ int slap_mods_opattrs(
if
(
SLAP_LASTMOD
(
op
->
o_bd
))
{
struct
tm
*
ltm
;
#ifdef HAVE_GMTIME_R
struct
tm
ltm_buf
;
#endif
time_t
now
=
slap_get_time
();
#ifdef HAVE_GMTIME_R
ltm
=
gmtime_r
(
&
now
,
&
ltm_buf
);
#else
ldap_pvt_thread_mutex_lock
(
&
gmtime_mutex
);
ltm
=
gmtime
(
&
now
);
#endif
/* HAVE_GMTIME_R */
lutil_gentime
(
timebuf
,
sizeof
(
timebuf
),
ltm
);
slap_get_csn
(
op
,
csnbuf
,
sizeof
(
csnbuf
),
&
csn
,
1
);
#ifndef HAVE_GMTIME_R
ldap_pvt_thread_mutex_unlock
(
&
gmtime_mutex
);
#endif
timestamp
.
bv_val
=
timebuf
;
timestamp
.
bv_len
=
strlen
(
timebuf
);
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/proto-slap.h
+
2
−
0
View file @
399b57ea
...
...
@@ -1242,7 +1242,9 @@ LDAP_SLAPD_V (ldap_pvt_thread_mutex_t) replog_mutex;
#if defined( SLAPD_CRYPT ) || defined( SLAPD_SPASSWD )
LDAP_SLAPD_V
(
ldap_pvt_thread_mutex_t
)
passwd_mutex
;
#endif
#ifndef HAVE_GMTIME_R
LDAP_SLAPD_V
(
ldap_pvt_thread_mutex_t
)
gmtime_mutex
;
#endif
LDAP_SLAPD_V
(
AccessControl
*
)
global_acl
;
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/schema.c
+
9
−
0
View file @
399b57ea
...
...
@@ -132,6 +132,9 @@ schema_info( Entry **entry, const char **text )
{
struct
tm
*
ltm
;
#ifdef HAVE_GMTIME_R
struct
tm
ltm_buf
;
#endif
char
timebuf
[
LDAP_LUTIL_GENTIME_BUFSIZE
];
/*
...
...
@@ -145,10 +148,16 @@ schema_info( Entry **entry, const char **text )
* AND modified at server startup time ...
*/
#ifdef HAVE_GMTIME_R
ltm
=
gmtime_r
(
&
starttime
,
&
ltm_buf
);
#else
ldap_pvt_thread_mutex_lock
(
&
gmtime_mutex
);
ltm
=
gmtime
(
&
starttime
);
#endif
/* HAVE_GMTIME_R */
lutil_gentime
(
timebuf
,
sizeof
(
timebuf
),
ltm
);
#ifndef HAVE_GMTIME_R
ldap_pvt_thread_mutex_unlock
(
&
gmtime_mutex
);
#endif
vals
[
0
].
bv_val
=
timebuf
;
vals
[
0
].
bv_len
=
strlen
(
timebuf
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment