Ejemplo n.º 1
0
void
doit (void)
{
  pid_t child;

  global_start ();
  if (error_count)
    return;

  child = fork ();
  if (child < 0)
    {
      perror ("fork");
      fail ("fork");
      return;
    }

  if (child)
    {
      int status;
      /* parent */
      server ();
      wait (&status);
    }
  else
    client ();

  global_stop ();
}
Ejemplo n.º 2
0
void
doit (void)
{
  int i;

  for (i = 0; resume_tests[i].desc; i++)
    {
      printf ("%s\n", resume_tests[i].desc);

      global_start ();
      if (error_count)
        return;

      child = fork ();
      if (child < 0)
        {
          perror ("fork");
          fail ("fork");
          return;
        }

      if (child)
        {
          int status;
          /* parent */
          server (&resume_tests[i]);
          wait (&status);
          if (WEXITSTATUS(status) > 0)
            error_count++;
          global_stop ();
        }
      else
        {
          client (&resume_tests[i]);
          gnutls_global_deinit ();
          if (error_count)
            exit(1);
          exit (0);
        }
    }
}