Probably because printf
buffers your message, and does not immediatly output it on the standard output. In this case, as your child process gets killed right after, your call to printf
would get totally unnoticed.
Try adding a \n
at the end of your message to force printf
to flush his internal buffer :
printf("Song complete...\n");