mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-24 21:35:47 +03:00
Make sure that we can't run in an infinite loop.
This commit is contained in:
parent
4adb536048
commit
7f003c1277
1 changed files with 5 additions and 0 deletions
|
@ -123,8 +123,13 @@ static int _csync_push_file(CSYNC *ctx, csync_file_stat_t *st) {
|
|||
/* Create the destination file */
|
||||
ctx->replica = drep;
|
||||
while ((dfp = csync_vio_open(ctx, turi, O_CREAT|O_EXCL|O_WRONLY, st->mode)) == NULL) {
|
||||
int count = 0;
|
||||
switch (errno) {
|
||||
case EEXIST:
|
||||
if (count++ > 10) {
|
||||
rc = 1;
|
||||
goto out;
|
||||
}
|
||||
turi = mktemp(turi);
|
||||
break;
|
||||
case ENOENT:
|
||||
|
|
Loading…
Reference in a new issue