mirror of
https://github.com/schoebel/mars
synced 2025-03-11 07:47:41 +00:00
infra: retry creation on -ELOOP
This commit is contained in:
parent
a5576d5ad3
commit
3fb3ce9c8e
@ -3084,7 +3084,14 @@ do_switch:
|
||||
}
|
||||
|
||||
// switch on/off (may fail silently, but responsibility is at the workers)
|
||||
status = mars_power_button((void*)brick, switch_state, false);
|
||||
|
||||
status = mars_power_button((void *)brick, switch_state, false);
|
||||
|
||||
/* retry when a stray symlink during O_NOFOLLOW was the reason */
|
||||
if (status == -ELOOP && switch_state) {
|
||||
mars_unlink(new_path);
|
||||
status = mars_power_button((void *)brick, switch_state, false);
|
||||
}
|
||||
MARS_DBG("switch '%s' to %d status = %d\n", new_path, switch_state, status);
|
||||
goto done;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user