Skip to content

Commit

Permalink
[fork-tester.c] run clangd to lint the file
Browse files Browse the repository at this point in the history
Signed-off-by: Tristan d'Audibert <[email protected]>
  • Loading branch information
ScriptSathi committed Nov 21, 2024
1 parent a511135 commit cc9850a
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions contrib/tester-progs/fork-tester.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ void child1()
{
pid_t pid;

if ((pid = fork()) == -1) {
if ((pid = fork()) == -1) {
perror("fork");
exit(1);
} else if (pid == 0) {
for (int i=0; ;i++) {
for (int i = 0;; i++) {
int ppid = getppid();
if (ppid == 1) {
break;
Expand All @@ -46,7 +46,6 @@ void child1()
printf("child 1 (pid:%d) exits\n", getpid());
return;
}

}

void alarm_handler(int signum)
Expand All @@ -68,7 +67,7 @@ int main(int argc, char **argv)
exit(1);
}

if ((pid = fork()) == -1) {
if ((pid = fork()) == -1) {
perror("fork");
exit(1);
} else if (pid == 0) {
Expand Down

0 comments on commit cc9850a

Please sign in to comment.