mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
owncloud: set _fmode variable to set file ops to binary mode.
This commit is contained in:
parent
87d3a56221
commit
bc138efa4e
@ -752,7 +752,17 @@ static csync_vio_method_handle_t *owncloud_open(const char *durl,
|
||||
if( rc == NE_OK ) {
|
||||
/* open a temp file to store the incoming data */
|
||||
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\n", writeCtx->tmpFileName ));
|
||||
if( writeCtx->fd == -1 ) {
|
||||
rc = NE_ERROR;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user