diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-07-15 12:26:55 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2013-07-15 12:26:55 -0400 |
commit | 22977b7c1dd6b693237fb3fed1cd6f88ec71cb21 (patch) | |
tree | 1e0432725155ce4f4e11823d0265cecc79a03226 /src/common/util.h | |
parent | 449b2b7c58e5dd5b33941a5142524a66c64c98ec (diff) | |
download | tor-22977b7c1dd6b693237fb3fed1cd6f88ec71cb21.tar.gz tor-22977b7c1dd6b693237fb3fed1cd6f88ec71cb21.zip |
Expose format_hex_number_..., and rename it to ..._sigsafe().
There are some other places in the code that will want a signal-safe
way to format numbers, so it shouldn't be static to util.c.
Diffstat (limited to 'src/common/util.h')
-rw-r--r-- | src/common/util.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/common/util.h b/src/common/util.h index ca6ce7c4c8..ad75266587 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -518,11 +518,12 @@ int32_t tor_weak_random_range(tor_weak_rng_t *rng, int32_t top); * <b>n</b> */ #define tor_weak_random_one_in_n(rng, n) (0==tor_weak_random_range((rng),(n))) +int format_hex_number_sigsafe(unsigned int x, char *buf, int max_len); + #ifdef UTIL_PRIVATE /* Prototypes for private functions only used by util.c (and unit tests) */ -STATIC int format_hex_number_for_helper_exit_status(unsigned int x, char *buf, - int max_len); +#ifndef _WIN32 STATIC int format_helper_exit_status(unsigned char child_state, int saved_errno, char *hex_errno); @@ -532,6 +533,8 @@ STATIC int format_helper_exit_status(unsigned char child_state, 1 + sizeof(int) * 2 + 1) #endif +#endif + const char *libor_get_digests(void); #endif |