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:
Howard Chu 2026-06-05 15:56:27 +01:00
parent 64f247b8a4
commit adec6d75c1

View file

@ -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 : "",