Consider this code snippet:
pid_t cpid = fork();
if (cpid == -1) {
perror(\"fork\");
exit(EXIT_FAILURE);
}
if (cpid == 0) { // in child
execvp(
execvp will exit the child if successfull so you don't have to exit.
On execve failure I simply use exit(EXIT_FAILURE); in the child.
Edit : i found that after some research : http://www.unixguide.net/unix/programming/1.1.3.shtml
So it's looks like it's better to use _exit() in a fork child specially when you are in C++ :p
Thanks for your question i learned something :D