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

[or-cvs] Backport bugfix for 151 and other windows fix.



Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv13830/src/or

Modified Files:
      Tag: tor-0_1_0-patches
	main.c 
Log Message:
Backport bugfix for 151 and other windows fix.

Index: main.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.505
retrieving revision 1.505.2.1
diff -u -d -r1.505 -r1.505.2.1
--- main.c	27 May 2005 17:43:43 -0000	1.505
+++ main.c	6 Jun 2005 20:10:02 -0000	1.505.2.1
@@ -943,7 +943,7 @@
     if (loop_result < 0) {
       int e = errno;
       /* let the program survive things like ^z */
-      if (e != EINTR && e != EINPROGRESS) {
+      if (e != EINTR && !ERRNO_IS_EINPROGRESS(e)) {
 #ifdef HAVE_EVENT_GET_METHOD
         log_fn(LOG_ERR,"libevent poll with %s failed: %s [%d]",
                event_get_method(), tor_socket_strerror(e), e);
@@ -953,7 +953,7 @@
 #endif
         return -1;
       } else {
-        if (e == EINPROGRESS)
+        if (ERRNO_IS_EINPROGRESS(e))
           log_fn(LOG_WARN,"libevent poll returned EINPROGRESS? Please report.");
         log_fn(LOG_DEBUG,"event poll interrupted.");
         /* You can't trust the results of this poll(). Go back to the
@@ -1221,7 +1221,10 @@
   handle_signals(1);
 
   crypto_global_init();
-  crypto_seed_rng();
+  if (crypto_seed_rng()) {
+    log_fn(LOG_ERR, "Unable to seed random number generator. Exiting.");
+    return -1;
+  }
   return 0;
 }