in reply to assign open2 output to variable

CIN for the child's output, and COUT for the child's input? You've picked very confusing names.