diff --git a/modules/csync_owncloud.c b/modules/csync_owncloud.c index 8741d6363..f6ac59f2b 100644 --- a/modules/csync_owncloud.c +++ b/modules/csync_owncloud.c @@ -894,6 +894,15 @@ static csync_vio_method_handle_t *owncloud_open(const char *durl, } #else writeCtx->tmpFileName = c_strdup( "/tmp/csync.XXXXXX" ); +#ifdef _WIN32 + if( c_tmpname( writeCtx->tmpFileName ) == 0 ) { + _fmode = _O_BINARY; + + writeCtx->fd = open( writeCtx->tmpFileName, O_RDWR | O_CREAT | O_EXCL, 0600 ); + } else { + writeCtx->fd = -1; + } +#else writeCtx->fd = mkstemp( writeCtx->tmpFileName ); #endif DEBUG_WEBDAV(("opening temp directory %s: %d\n", writeCtx->tmpFileName, writeCtx->fd ));