mirror of
https://github.com/BoredDevNL/BoredOS.git
synced 2026-05-15 10:48:38 +00:00
FIX: Retry to stop false application launch failures
This commit is contained in:
parent
62ac2ab849
commit
28108adde3
1 changed files with 6 additions and 1 deletions
|
|
@ -1180,7 +1180,12 @@ static int execute_line_inner(const char *line, int depth) {
|
|||
char args_buf[256];
|
||||
build_args_string(argc, argv, 1, args_buf, sizeof(args_buf));
|
||||
|
||||
int pid = sys_spawn(full_path, args_buf[0] ? args_buf : NULL, SPAWN_FLAG_TERMINAL | SPAWN_FLAG_INHERIT_TTY, 0);
|
||||
int pid = -1;
|
||||
for (int attempt = 0; attempt < 5; attempt++) {
|
||||
pid = sys_spawn(full_path, args_buf[0] ? args_buf : NULL, SPAWN_FLAG_TERMINAL | SPAWN_FLAG_INHERIT_TTY, 0);
|
||||
if (pid >= 0) break;
|
||||
sleep(10);
|
||||
}
|
||||
if (pid < 0) {
|
||||
set_color(g_color_error);
|
||||
printf("bsh: failed to launch: %s\n", full_path);
|
||||
|
|
|
|||
Loading…
Reference in a new issue