wait2.c
check child process exit status