mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-06-09 00:32:08 -04:00
ITS#10515 slapo-auditlog: Add Windows non-blocking support
It doesn't work the same way as on Linux, so don't enable the test script.
This commit is contained in:
parent
64f247b8a4
commit
adec6d75c1
1 changed files with 9 additions and 1 deletions
|
|
@ -134,7 +134,7 @@ static int auditlog_response(Operation *op, SlapReply *rs) {
|
|||
|
||||
/* Open file with optional non-blocking mode */
|
||||
flags = O_WRONLY | O_CREAT | O_APPEND;
|
||||
#ifdef O_NONBLOCK
|
||||
#ifndef _WIN32
|
||||
if ( ad->ad_nonblocking ) {
|
||||
flags |= O_NONBLOCK;
|
||||
}
|
||||
|
|
@ -149,6 +149,14 @@ static int auditlog_response(Operation *op, SlapReply *rs) {
|
|||
goto done;
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
if ( ad->ad_nonblocking ) {
|
||||
intptr_t fh = _get_osfhandle( fd );
|
||||
DWORD mode = PIPE_NOWAIT;
|
||||
SetNamedPipeHandleState( (HANDLE)fh, &mode, NULL, NULL );
|
||||
}
|
||||
#endif
|
||||
|
||||
stamp = slap_get_time();
|
||||
fprintf(f, "# %s %ld %s%s%s %s conn=%ld\n",
|
||||
what, (long)stamp, suffix, who ? " " : "", who ? who->bv_val : "",
|
||||
|
|
|
|||
Loading…
Reference in a new issue