From 66be548b58ec2c88ec54197043dd3aa6202de7a4 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Wed, 29 Oct 2008 13:14:10 +0000 Subject: [PATCH] ITS#5774 blind fix for Windows, please test --- servers/slapd/back-ldif/ldif.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/servers/slapd/back-ldif/ldif.c b/servers/slapd/back-ldif/ldif.c index 00608e7e00..3acb687fd2 100644 --- a/servers/slapd/back-ldif/ldif.c +++ b/servers/slapd/back-ldif/ldif.c @@ -336,7 +336,13 @@ spew_entry( Entry * e, struct berval * path, int dolock, int *save_errnop ) tmpfname, STRERROR( save_errno ), 0 ); } else { +#ifdef _WIN32 + /* returns 0 on failure, nonzero on success */ + res = MoveFileEx( tmpfname, path->bv_val, + MOVEFILE_REPLACE_EXISTING ) == 0; +#else res = rename( tmpfname, path->bv_val ); +#endif if ( res == 0 ) { rs = LDAP_SUCCESS; -- 2.39.5