diff options
author | Aaron <aaron@10gen.com> | 2009-02-02 09:52:14 -0500 |
---|---|---|
committer | Aaron <aaron@10gen.com> | 2009-02-02 09:52:14 -0500 |
commit | 89749798130cbe9be2f7b4133efc8388f16d9cb4 (patch) | |
tree | c0a25d554d75a67823aea60e963c7523922fcec1 /util/goodies.h | |
parent | 5eb1e40259cfe9ace594b63a977f6bd96d52f632 (diff) | |
download | mongo-89749798130cbe9be2f7b4133efc8388f16d9cb4.tar.gz |
Clean up signal handling, fixing some potential hangs
Diffstat (limited to 'util/goodies.h')
-rw-r--r-- | util/goodies.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/util/goodies.h b/util/goodies.h index 9ded73d235e..c8b40e8311d 100644 --- a/util/goodies.h +++ b/util/goodies.h @@ -42,7 +42,7 @@ namespace mongo { namespace mongo { /* use "addr2line -CFe <exe>" to parse. */ - inline void printStackTrace() { + inline void printStackTrace( ostream &o = cout ) { void *b[12]; size_t size; char **strings; @@ -52,10 +52,10 @@ namespace mongo { strings = backtrace_symbols(b, size); for (i = 0; i < size; i++) - cout << hex << b[i] << ' '; - cout << '\n'; + o << hex << b[i] << ' '; + o << '\n'; for (i = 0; i < size; i++) - cout << ' ' << strings[i] << '\n'; + o << ' ' << strings[i] << '\n'; free (strings); } |