title: C: Trying to restore signal handlers with sigaction but not succeeding.
body: <p>I'm writing a small program in C, (running on ubuntu). The first time the program receives Ctrl+C, I want the signal to be ignored, but the second time (after 10 seconds of waiting), I want the original action to be restored (and the signal not be ignored). So I have something like this:</p>
  
  <pre><code>void (*sold)(int);
  struct sigaction s;
  sold = s.sa_handler;
  s.sa_handler = SIG_IGN;
  sigaction(SIGINT,&amp;s,NULL);
  sleep(10)
  s.sa_handler = sold; //(this could be replaced by s.sa_handler = *sold and it doenst make a difference)
  </code></pre>
  
  <p>The program seems to ignore SIGINT just fine, but it doesn't revert back.., as in it doesn't restore the old handler. What am I doing wrong?</p>