mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 20:33:10 +00:00
Tests/Kernel: Remove redundant if
(#4111)
Problem: - If `fork()` fails the system tries to call `execl()`. That will either succeed and replace the running process image or it will fail and it needs to try again. The `if` is redundant because it will only be evaluated if `execl()` fails. Solution: - Remove the `if`.
This commit is contained in:
parent
b9bbf377d6
commit
a34939bcd5
|
@ -151,8 +151,7 @@ int main()
|
|||
if (!fork()) {
|
||||
try_again:
|
||||
printf("exec\n");
|
||||
if (execl(path, "x", nullptr) < 0) {
|
||||
}
|
||||
execl(path, "x", nullptr);
|
||||
goto try_again;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue