title: Infinite loop in program
body: <p>One of the components in my process calling assignment seems to be running an infinite loop and I can't tell why. here seems to be the problem area</p>
  
  <pre><code>D=fork();
  if (D==0)execv("/home/8/myfiles/DD.c",arg);
  
  
  while(temp != 4){               //return value of D is 4
  A = wait(&amp;temp);}
  exit(1);
  </code></pre>
  
  <p>The goal of the code is to wait until D terminates. Like the comment says, D ends with "exit(4);" so as far as I'm aware, that means that when it does temp will be assigned 4, right? Or am I doing something wrong here.</p>