fprintf (stderr, "Incorrect signal from child: got `%s', need `%s'\n", strsignal (WTERMSIG (status)), strsignal (EXPECTED_SIGNAL));
if (EXPECTED_SIGNAL != 0) fprintf (stderr, "Incorrect signal from child: got `%s', need `%s'\n", strsignal (WTERMSIG (status)), strsignal (EXPECTED_SIGNAL)); else fprintf (stderr, "Incorrect signal from child: got `%s'\n", strsignal (WTERMSIG (status)));
main (int argc, char *argv[]){  int direct = 0;	/* Directly call the test function?  */  int status;  int opt;  while ((opt = getopt_long (argc, argv, "", options, NULL)) != -1)    switch (opt)      {      case '?':	exit (1);      case OPT_DIRECT:	direct = 1;	break;      case OPT_TESTDIR:	test_dir = optarg;	break;#ifdef CMDLINE_PROCESS	CMDLINE_PROCESS#endif      }  /* Set TMPDIR to specified test directory.  */  if (test_dir != NULL)    {      setenv ("TMPDIR", test_dir, 1);      if (chdir (test_dir) < 0)	{	  perror ("chdir");	  exit (1);	}    }  /* If we are not expected to fork run the function immediately.  */  if (direct)    return TEST_FUNCTION;  /* Set up the test environment:     - prevent core dumps     - set up the timer     - fork and execute the function.  */  pid = fork ();  if (pid == 0)    {      /* This is the child.  */#ifdef RLIMIT_CORE      /* Try to avoid dumping core.  */      struct rlimit core_limit;      core_limit.rlim_cur = 0;      core_limit.rlim_max = 0;      setrlimit (RLIMIT_CORE, &core_limit);#endif      /* Execute the test function and exit with the return value.   */      exit (TEST_FUNCTION);    }  else if (pid < 0)    {      perror ("Cannot fork test program");      exit (1);    }  /* Set timeout.  */#ifndef TIMEOUT  /* Default timeout is two seconds.  */# define TIMEOUT 2#endif  alarm (TIMEOUT);  signal (SIGALRM, timeout_handler);  /* Wait for the regular termination.  */  if (waitpid (pid, &status, 0) != pid)    {      perror ("Oops, wrong test program terminated");      exit (1);    }#ifndef EXPECTED_SIGNAL  /* We don't expect any signal.  */# define EXPECTED_SIGNAL 0#endif  if (WTERMSIG (status) != EXPECTED_SIGNAL)    {      fprintf (stderr, "Incorrect signal from child: got `%s', need `%s'\n",	       strsignal (WTERMSIG (status)), strsignal (EXPECTED_SIGNAL));      exit (1);    }  /* Simply exit with the return value of the test.  */  return WEXITSTATUS (status);}