Tu geres mal le fork il me semble. De maniere generale:




pid_t pid;

if ((pid = fork()) < 0)
return (1);