[tor-commits] [tor/master] Merge branch 'bug8746_v2_squashed'

nickm at torproject.org nickm at torproject.org
Sat Jun 14 15:47:50 UTC 2014


commit a7cafb1ea9307864c94ad3e019af93d09d48350e
Merge: a58d94f e07d328
Author: Nick Mathewson <nickm at torproject.org>
Date:   Sat Jun 14 11:46:38 2014 -0400

    Merge branch 'bug8746_v2_squashed'
    
    Conflicts:
    	src/common/include.am

 changes/bug8746           |    4 ++
 configure.ac              |    2 +
 src/common/compat.c       |   26 ++++++++
 src/common/compat.h       |    4 ++
 src/common/include.am     |    7 +-
 src/common/procmon.c      |    1 +
 src/common/util.c         |   54 ++++++++++++---
 src/common/util.h         |    9 ++-
 src/common/util_process.c |  157 ++++++++++++++++++++++++++++++++++++++++++++
 src/common/util_process.h |   25 +++++++
 src/or/main.c             |    4 +-
 src/or/or.h               |    3 -
 src/test/test-child.c     |   40 ++++++++----
 src/test/test_util.c      |  160 ++++++++++++++++++++++++++++++++++++---------
 14 files changed, 437 insertions(+), 59 deletions(-)

diff --cc src/common/compat.c
index 111070c,1c460b6..e25ecc4
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@@ -3553,6 -3453,26 +3559,26 @@@ get_total_system_memory(size_t *mem_out
  
    *mem_out = mem_cached = (size_t) m;
  
 -  return -1;
 +  return 0;
  }
  
+ #ifdef TOR_UNIT_TESTS
+ /** Delay for <b>msec</b> milliseconds.  Only used in tests. */
+ void
+ tor_sleep_msec(int msec)
+ {
+ #ifdef _WIN32
+   Sleep(msec);
+ #elif defined(HAVE_USLEEP)
+   sleep(msec / 1000);
+   /* Some usleep()s hate sleeping more than 1 sec */
+   usleep((msec % 1000) * 1000);
+ #elif defined(HAVE_SYS_SELECT_H)
+   struct timeval tv = { msec / 1000, (msec % 1000) * 1000};
+   select(0, NULL, NULL, NULL, &tv);
+ #else
+   sleep(CEIL_DIV(msec, 1000));
+ #endif
+ }
+ #endif
+ 
diff --cc src/common/include.am
index 61a90cd,c9dcedd..68e0110
--- a/src/common/include.am
+++ b/src/common/include.am
@@@ -64,13 -56,13 +64,13 @@@ LIBOR_A_SOURCES = 
    src/common/di_ops.c					\
    src/common/log.c					\
    src/common/memarea.c					\
-   src/common/procmon.c					\
 -  src/common/mempool.c					\
    src/common/util.c					\
    src/common/util_codedigest.c				\
+   src/common/util_process.c				\
    src/common/sandbox.c					\
    src/ext/csiphash.c					\
 -  $(libor_extra_source)
 +  $(libor_extra_source)					\
 +  $(libor_mempool_source)
  
  LIBOR_CRYPTO_A_SOURCES = \
    src/common/aes.c		\
@@@ -119,7 -114,7 +121,8 @@@ COMMONHEADERS = 
    src/common/torlog.h				\
    src/common/tortls.h				\
    src/common/util.h				\
 -  src/common/util_process.h
++  src/common/util_process.h			\
 +  $(libor_mempool_header)
  
  noinst_HEADERS+= $(COMMONHEADERS)
  
diff --cc src/test/test_util.c
index c7fa141,656b77b..151ec69
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@@ -12,10 -12,9 +12,11 @@@
  #include "config.h"
  #include "control.h"
  #include "test.h"
 +#ifdef ENABLE_MEMPOOLS
  #include "mempool.h"
 +#endif /* ENABLE_MEMPOOLS */
  #include "memarea.h"
+ #include "util_process.h"
  
  #ifdef _WIN32
  #include <tchar.h>





More information about the tor-commits mailing list