Cleanup Windows build

Fix make depend errors in slapi
This commit is contained in:
Howard Chu 2023-09-07 20:03:07 +01:00 committed by Quanah Gibson-Mount
parent 756fa91aef
commit 95c5d0b045
3 changed files with 32 additions and 6 deletions

View File

@ -19,9 +19,6 @@ LIBRARY = libslapi.la
#all-common: $(LIBRARY) $(PROGRAMS)
# @touch plugin.c slapi_pblock.c slapi_utils.c slapi_ops.c slapi_ext.c
NT_SRCS = nt_err.c
NT_OBJS = nt_err.lo
LIB_DEFS = -DSLAPI_LIBRARY
SRCS= plugin.c slapi_pblock.c slapi_utils.c printmsg.c slapi_ops.c slapi_dn.c slapi_ext.c slapi_overlay.c \
@ -31,12 +28,15 @@ OBJS= plugin.lo slapi_pblock.lo slapi_utils.lo printmsg.lo slapi_ops.lo slapi_d
XSRCS= version.c
LDAP_INCDIR= ../../../include -I.. -I.
LDAP_LIBDIR= ../../../libraries
LDAP_INCDIR= ../../../include -I.. -I.
LDAP_LIBDIR= ../../../libraries
shared_LDAP_LIBS = $(LDAP_LIBLDAP_LA) $(LDAP_LIBLBER_LA)
XLIBS = $(LIBRARY)
XXLIBS =
NT_LINK_LIBS = $(AC_LIBS)
MOD_LIBS = $(MODULES_LIBS)
NT_LINK_LIBS = $(AC_LIBS) -L.. -lslapd $(@BUILD_LIBS_DYNAMIC@_LDAP_LIBS)
XINCPATH = -I$(srcdir)/.. -I$(srcdir)
XDEFS = $(MODULES_CPPFLAGS)

View File

@ -32,6 +32,10 @@
#include <slap.h>
#include <slapi.h>
#ifdef _WIN32
#include <io.h>
#endif
#include <ldap_pvt_thread.h>
/* Single threads access to routine */
@ -60,18 +64,30 @@ slapi_int_log_error(
/* for now, we log all severities */
if ( level <= slapi_log_level ) {
#ifdef _WIN32
intptr_t fhandle;
#endif
fp = fopen( slapi_log_file, "a" );
if ( fp == NULL) {
rc = -1;
goto done;
}
#ifdef _WIN32
fhandle = _get_osfhandle( fileno( fp ));
#endif
/*
* FIXME: could block
*/
#ifdef _WIN32
while ( LockFile( fhandle, 0, 0, UINT_MAX, UINT_MAX ) == 0 ) {
/* DO NOTHING */ ;
}
#else
while ( lockf( fileno( fp ), F_LOCK, 0 ) != 0 ) {
/* DO NOTHING */ ;
}
#endif
time( &currentTime );
ltm = localtime( &currentTime );
@ -85,7 +101,11 @@ slapi_int_log_error(
}
fflush( fp );
#ifdef _WIN32
UnlockFile( fhandle, 0, 0, UINT_MAX, UINT_MAX );
#else
lockf( fileno( fp ), F_ULOCK, 0 );
#endif
fclose( fp );

View File

@ -31,7 +31,11 @@
#include <slap.h>
#include <slapi.h>
#ifdef _WIN32
#include <winsock.h>
#else
#include <netdb.h>
#endif
#ifdef LDAP_SLAPI
@ -1971,6 +1975,8 @@ slapi_timer_current_time( void )
*/
#else /* _WIN32 */
LARGE_INTEGER now;
static LARGE_INTEGER base_time, performance_freq;
static int performance_counter_present;
if ( first_time ) {
first_time = 0;