]> git.sur5r.net Git - openldap/commitdiff
ITS#5774 blind fix for Windows, please test
authorHoward Chu <hyc@openldap.org>
Wed, 29 Oct 2008 13:14:10 +0000 (13:14 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 29 Oct 2008 13:14:10 +0000 (13:14 +0000)
servers/slapd/back-ldif/ldif.c

index 00608e7e0099156a59665224c8f8e52fa30f4915..3acb687fd2d17f503f3b00795adac989f16fca7f 100644 (file)
@@ -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;