if (kill(pid, 0) == 0) //Check if the process created is still running...
{
fputc(EOF, output); //If it was, tell it to stop with EOF
- sleep(1); //Give it 1 second to respond...
+ usleep(500000); //Give it 1/2 a second to respond...
if (kill(pid, 0) == 0) //Check if its still running
{
kill(pid, 9); //Slay the infidel mercilessly!