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:
Lenny Maiorani 2020-11-29 02:41:02 -07:00 committed by GitHub
parent b9bbf377d6
commit a34939bcd5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
Notes: sideshowbarker 2024-07-19 01:12:33 +09:00

View file

@ -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;
}