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

[or-cvs] don"t mess with signals on windows until we know how



Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	main.c 
Log Message:
don't mess with signals on windows until we know how


Index: main.c
===================================================================
RCS file: /home/or/cvsroot/src/or/main.c,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -d -r1.80 -r1.81
--- main.c	12 Aug 2003 06:41:53 -0000	1.80
+++ main.c	12 Aug 2003 08:04:31 -0000	1.81
@@ -23,9 +23,11 @@
 
 static int nfds=0; /* number of connections currently active */
 
+#ifndef MS_WINDOWS /* do signal stuff only on unix */
 static int please_dumpstats=0; /* whether we should dump stats during the loop */
 static int please_fetch_directory=0; /* whether we should fetch a new directory */
 static int please_reap_children=0; /* whether we should waitpid for exited children*/
+#endif /* signal stuff */
 
 /* private key */
 static crypto_pk_env_t *privatekey=NULL;
@@ -514,6 +516,7 @@
   retry_all_connections(options.ORPort, options.APPort, options.DirPort);
 
   for(;;) {
+#ifndef MS_WINDOWS /* do signal stuff only on unix */
     if(please_dumpstats) {
       dumpstats();
       please_dumpstats = 0;
@@ -532,6 +535,7 @@
       while(waitpid(-1,NULL,WNOHANG)) ; /* keep reaping until no more zombies */
       please_reap_children = 0;
     }
+#endif /* signal stuff */
     if(prepare_for_poll(&timeout) < 0) {
       log(LOG_DEBUG,"do_main_loop(): prepare_for_poll failed, exiting.");
       return -1;
@@ -584,6 +588,7 @@
 
 static void catch(int the_signal) {
 
+#ifndef MS_WINDOWS /* do signal stuff only on unix */
   switch(the_signal) {
 //    case SIGABRT:
     case SIGTERM:
@@ -601,6 +606,7 @@
     default:
       log(LOG_ERR,"Caught signal that we can't handle??");
   }
+#endif /* signal stuff */
 }
 
 static void dumpstats(void) { /* dump stats to stdout */
@@ -848,11 +854,13 @@
     dns_init(); /* initialize the dns resolve tree, and spawn workers */
   }
 
+#ifndef MS_WINDOWS /* do signal stuff only on unix */
   signal (SIGINT,  catch); /* catch kills so we can exit cleanly */
   signal (SIGTERM, catch);
   signal (SIGUSR1, catch); /* to dump stats to stdout */
   signal (SIGHUP,  catch); /* to reload directory */
   signal (SIGCHLD, catch); /* for exiting dns/cpu workers */
+#endif /* signal stuff */
 
   crypto_global_init();
   crypto_seed_rng();