[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] move network_init to compat.c from main.c



Update of /home2/or/cvsroot/tor/src/tools
In directory moria.mit.edu:/home2/arma/work/onion/0091/tor/src/tools

Modified Files:
      Tag: tor-0_0_9-patches
	tor-resolve.c 
Log Message:
move network_init to compat.c from main.c
so we can call it from tor-resolve.c


Index: tor-resolve.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/tools/tor-resolve.c,v
retrieving revision 1.12
retrieving revision 1.12.2.1
diff -u -d -r1.12 -r1.12.2.1
--- tor-resolve.c	30 Nov 2004 08:54:08 -0000	1.12
+++ tor-resolve.c	4 Feb 2005 07:16:13 -0000	1.12.2.1
@@ -181,6 +181,11 @@
   if (!n_args)
     usage();
 
+  if (!strcmp(arg[0],"--version")) {
+    printf("Tor version %s.\n",VERSION);
+    return 0;
+  }
+
   if (!strcmp("-v", arg[0])) {
     add_stream_log(LOG_DEBUG, LOG_ERR, "<stderr>", stderr);
     ++arg; --n_args;
@@ -211,6 +216,11 @@
     return 1;
   }
 
+  if (network_init()<0) {
+    log_fn(LOG_ERR,"Error initializing network; exiting.");
+    return 1;
+  }
+
   if (do_resolve(arg[0], sockshost, socksport, &result))
     return 1;