通常、C でフォークする必要がある場合は、次のようにします。
pid_t p = fork();
if(p == 0) { /* do child stuff */ }
else { /* do parent stuff and pray there wasn't an error */ }
余分な変数を捨てて、次のものを使用できることに気づきました。
if(fork() == 0) { /* child */ }
else { /* parent/pray */ }
不適切なエラー処理はさておき、(なぜ)これは機能するか機能しないのですか?