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

[or-cvs] there was no need to die when we failed to spawn a cpuworker.



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

Modified Files:
	cpuworker.c 
Log Message:
there was no need to die when we failed to spawn a cpuworker.
it handles it fine if we decide not to die.


Index: cpuworker.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/cpuworker.c,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -d -r1.86 -r1.87
--- cpuworker.c	15 Aug 2005 23:46:18 -0000	1.86
+++ cpuworker.c	23 Sep 2005 00:04:44 -0000	1.87
@@ -293,7 +293,7 @@
   return 0; /* windows wants this function to return an int */
 }
 
-/** Launch a new cpuworker.
+/** Launch a new cpuworker. Return 0 if we're happy, -1 if we failed.
  */
 static int
 spawn_cpuworker(void)
@@ -305,10 +305,9 @@
 
   fdarray = tor_malloc(sizeof(int)*2);
   if ((err = tor_socketpair(AF_UNIX, SOCK_STREAM, 0, fdarray)) < 0) {
-    log(LOG_ERR, "Couldn't construct socketpair: %s", tor_socket_strerror(-err));
-    tor_cleanup();
+    log(LOG_WARN, "Couldn't construct socketpair: %s", tor_socket_strerror(-err));
     tor_free(fdarray);
-    exit(1);
+    return -1;
   }
 
   fd = fdarray[0];
@@ -354,7 +353,7 @@
 
   while (num_cpuworkers < num_cpuworkers_needed) {
     if (spawn_cpuworker() < 0) {
-      log_fn(LOG_WARN,"spawn failed!");
+      log_fn(LOG_WARN,"Spawn failed. Will try again later.");
       return;
     }
     num_cpuworkers++;