From 1763a80750dfc8455071a24df816cac0b81ff790 Mon Sep 17 00:00:00 2001 From: Stathis Kamperis Date: Sun, 5 Aug 2007 18:40:53 +0300 Subject: [PATCH] Remove bogus else if (...) condition --- ipc/fork_execlp.c | 2 +- ipc/fork_mult.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ipc/fork_execlp.c b/ipc/fork_execlp.c index a7070aa..8b73372 100755 --- a/ipc/fork_execlp.c +++ b/ipc/fork_execlp.c @@ -19,7 +19,7 @@ int main(void) else if (pid > 0) /* parent process */ wait(&retval); - else if (pid == 0) { /* child process */ + else { /* child process (pid = 0) */ if (execlp("date", "date", (char *)0) < 0) { perror("execlp"); exit(EXIT_FAILURE); diff --git a/ipc/fork_mult.c b/ipc/fork_mult.c index 0d6960c..fdd149a 100755 --- a/ipc/fork_mult.c +++ b/ipc/fork_mult.c @@ -21,7 +21,7 @@ int main(void) else if (pid[i] > 0) { /* parent process */ wait(&retval); } - else if (pid[i] == 0) { /* child process */ + else { /* child process (pid = 0) */ printf("Child[%d] = %d\n", i, getpid()); /* break, or else every child will spawn it's own children */ -- 2.11.4.GIT