tor  0.4.1.0-alpha-dev
tor_main.c
Go to the documentation of this file.
1 /* Copyright 2001-2004 Roger Dingledine.
2  * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
3  * Copyright (c) 2007-2019, The Tor Project, Inc. */
4 /* See LICENSE for licensing information */
5 
6 #include "orconfig.h"
7 #ifdef ENABLE_RESTART_DEBUGGING
8 #include <stdlib.h>
9 #endif
10 
19 int tor_main(int argc, char *argv[]);
20 
24 int
25 main(int argc, char *argv[])
26 {
27  int r;
28 #ifdef ENABLE_RESTART_DEBUGGING
29  int restart_count = getenv("TOR_DEBUG_RESTART") ? 1 : 0;
30  again:
31 #endif
32  r = tor_main(argc, argv);
33  if (r < 0 || r > 255)
34  return 1;
35 #ifdef ENABLE_RESTART_DEBUGGING
36  else if (r == 0 && restart_count--)
37  goto again;
38 #endif
39  else
40  return r;
41 }
42 
int main(int argc, char *argv[])
Definition: tor_main.c:25
int tor_main(int argc, char **argv)