diff options
author | Lenny Maiorani <lenny@colorado.edu> | 2020-11-29 02:41:02 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-29 10:41:02 +0100 |
commit | a34939bcd54da99056d2ed11cf2840624f1322e5 (patch) | |
tree | 8f66a60faeacda34aef0622d54189fe1ccd1a2fd | |
parent | b9bbf377d6d8facef7a299c266615095f97436de (diff) | |
download | serenity-a34939bcd54da99056d2ed11cf2840624f1322e5.zip |
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`.
-rw-r--r-- | Userland/Tests/Kernel/elf-execve-mmap-race.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/Userland/Tests/Kernel/elf-execve-mmap-race.cpp b/Userland/Tests/Kernel/elf-execve-mmap-race.cpp index a5a730a3bb..002b37fe6f 100644 --- a/Userland/Tests/Kernel/elf-execve-mmap-race.cpp +++ b/Userland/Tests/Kernel/elf-execve-mmap-race.cpp @@ -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; } |