/* sig5.c (emx+gcc) */

/* signal() didn't return the previous signal handler (emx.dll 0.8g
   and older). */

#include <stdio.h>
#include <signal.h>

static void handler (int sig)
{
}


int main (void)
{
  int result = 0;

  if (signal (SIGUSR1, handler) != SIG_DFL)
    {
      puts ("Error 1");
      result = 1;
    }
  if (signal (SIGUSR1, SIG_IGN) != &handler)
    {
      puts ("Error 2");
      result = 1;
    }
  if (signal (SIGUSR1, SIG_DFL) != SIG_IGN)
    {
      puts ("Error 3");
      result = 1;
    }
  return result;
}
