I'm writing a program that creates four different pipes between four different processes, and relays messages through each pipe. I've written all of the code for passing the messages, however I'm having problems terminating the program once everything is finished. I believe the problem may be in this sectionAny suggestions as to how I can terminate the program otherwise? I have the rest of the source code if required.Code:if((pid2=fork())==0){ int i; close(log[0]); close(bc[1]); while(i<10){ sleep(1); bytes = read(bc[0], msg, 3); if(msg[0]=='e') exit(1); time(&now); n = sprintf(msg2, "C received %s at %s", msg, ctime(&now)); write(log[1], msg2, strlen(msg2)+1); i++; } close(bc[0]); close(log[1]); exit(1); } if((pid3=fork())==0){ int i; close(bd[1]); close(log[0]); while(i<10){ sleep(5); bytes = read(bd[0], msg, 3); if(msg[0]=='e') exit(1); time(&now); n = sprintf(msg2, "D received %s at %s", msg, ctime(&now)); i++; } close(bd[0]); close(log[1]); exit(1); }