mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-27 17:37:36 +03:00
owncloud: Win32 use c_tmpname and set _fmode to O_BINARY.
This commit is contained in:
parent
4f8c6729ff
commit
4c8fe93412
1 changed files with 9 additions and 0 deletions
|
@ -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 ));
|
||||
|
|
Loading…
Reference in a new issue