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 */
|
/* Create the destination file */
|
||||||
ctx->replica = drep;
|
ctx->replica = drep;
|
||||||
while ((dfp = csync_vio_open(ctx, turi, O_CREAT|O_EXCL|O_WRONLY, st->mode)) == NULL) {
|
while ((dfp = csync_vio_open(ctx, turi, O_CREAT|O_EXCL|O_WRONLY, st->mode)) == NULL) {
|
||||||
|
int count = 0;
|
||||||
switch (errno) {
|
switch (errno) {
|
||||||
case EEXIST:
|
case EEXIST:
|
||||||
|
if (count++ > 10) {
|
||||||
|
rc = 1;
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
turi = mktemp(turi);
|
turi = mktemp(turi);
|
||||||
break;
|
break;
|
||||||
case ENOENT:
|
case ENOENT:
|
||||||
|
|
Loading…
Reference in a new issue