mirror of
https://github.com/schoebel/mars
synced 2025-01-18 21:31:00 +00:00
infra: fix potential endless loop
Thisd unlikely, but may happen when /mars is defective.
This commit is contained in:
parent
707dc32c54
commit
bec3ebf006
@ -1091,6 +1091,7 @@ int ordered_symlink(const char *oldpath,
|
|||||||
{
|
{
|
||||||
char *dir_path = NULL;
|
char *dir_path = NULL;
|
||||||
int dir_len;
|
int dir_len;
|
||||||
|
int nr_retry = 0;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
retry:
|
retry:
|
||||||
@ -1118,7 +1119,9 @@ int ordered_symlink(const char *oldpath,
|
|||||||
if (check >= 0) {
|
if (check >= 0) {
|
||||||
brick_string_free(dir_path);
|
brick_string_free(dir_path);
|
||||||
dir_path = NULL;
|
dir_path = NULL;
|
||||||
goto retry;
|
if (nr_retry++ < 3)
|
||||||
|
goto retry;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
brick_string_free(dir_path);
|
brick_string_free(dir_path);
|
||||||
|
Loading…
Reference in New Issue
Block a user