now i understood, your problem, how this equivalent code written?
fork() && fork() || fork();
e1 && e2 || e3 ; ===> ( ( e1 && e2 ) || ( e3 ) )
first e1 executed, if it is false then e2 can't executed, go to e3
first e1 executed, if it true, then
1) e2 executed if it is true, then e3 can't executed
2) e2 executed if it is false, then e3 executed
if( e1 )
{
}
else
{
e3;
}
if(e1)
{
if(e2)
{
}
else
{
e3;
}
}
else
{
e3;
}
if(fork())
{
if(fork())
{
}
else
{
fork();
}
}
else
{
fork();
}
remaining code written as it is