aboutsummaryrefslogtreecommitdiff
path: root/src/test/test-child.c
blob: cf49c5d31ed1b5a616523924c8dba064cd9488c8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <stdio.h>
#include "orconfig.h"
#ifdef MS_WINDOWS
#define WINDOWS_LEAN_AND_MEAN
#include <windows.h>
#else
#include <unistd.h>
#endif

/** Trivial test program which prints out its command line arguments so we can
 * check if tor_spawn_background() works */
int
main(int argc, char **argv)
{
  int i;

  fprintf(stdout, "OUT\n");
  fprintf(stderr, "ERR\n");
  for (i = 1; i < argc; i++)
    fprintf(stdout, "%s\n", argv[i]);
  fprintf(stdout, "SLEEPING\n");
#ifdef MS_WINDOWS
  Sleep(1000);
#else
  sleep(1);
#endif
  fprintf(stdout, "DONE\n");
#ifdef MS_WINDOWS
  Sleep(1000);
#else
  sleep(1);
#endif

  return 0;
}