Sleep() not working

I have a function that quits a program when <ctrl>c is entered as per following code;

void quitter (void)
{
  clear ();
  mvprintw (QUITTER_ROW, QUITTER_COL, "Quitting...");
  refresh ();
  sleep (15);
  endwin ();
  exit (1);
}

This function is called thus;

signal (SIGINT, quitter);

It works, sort of. The "Quitting..." message is displayed, but only for about half a second. I can change the argument in the sleep() function all I like. It makes no difference to the amount of time "Quitting..." is displayed for. I thought my code would cause the "Quitting..." message to be displayed for 15 seconds before the execution ends. Why does it not work as intended? I tried it on another machine with the same result.

sleep in implemented with signals and now you are trying to nest handlers. Go back to your other thread and look at porter's comments about too much code in a handler. Reduce to quiter function to just setting a flag and it will work.

I had an alarm signal interrupting the sleep() function.