summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2005-09-23 00:04:44 +0000
committerRoger Dingledine <arma@torproject.org>2005-09-23 00:04:44 +0000
commite286c4267eb6cefcc1972c7dba9e12f2ff2e7aa4 (patch)
tree960b146422cdb48dde76ed578f6894476a9e07cc
parent479886fce2885efaabca72ae78ab65da19481609 (diff)
downloadtor-e286c4267eb6cefcc1972c7dba9e12f2ff2e7aa4.tar.gz
tor-e286c4267eb6cefcc1972c7dba9e12f2ff2e7aa4.zip
there was no need to die when we failed to spawn a cpuworker.
it handles it fine if we decide not to die. svn:r5114
-rw-r--r--src/or/cpuworker.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/or/cpuworker.c b/src/or/cpuworker.c
index 397aa36696..5208d79397 100644
--- a/src/or/cpuworker.c
+++ b/src/or/cpuworker.c
@@ -293,7 +293,7 @@ cpuworker_main(void *data)
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 @@ spawn_cpuworker(void)
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 @@ spawn_enough_cpuworkers(void)
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++;