diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-02-25 10:29:52 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-03-14 13:50:23 -0400 |
commit | feca32903147e10974b00c80db56b1347e042946 (patch) | |
tree | 290390772aaf433af5d868bfbe96ae01691ad8e4 /src/common/log.c | |
parent | 4247ce99e5d9b7b2063df66cc808fac1f09fb799 (diff) | |
download | tor-feca32903147e10974b00c80db56b1347e042946.tar.gz tor-feca32903147e10974b00c80db56b1347e042946.zip |
Log version when LD_BUG is logged.
Closes ticket 15026.
Diffstat (limited to 'src/common/log.c')
-rw-r--r-- | src/common/log.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/common/log.c b/src/common/log.c index e8cc30c312..396eb6b0e8 100644 --- a/src/common/log.c +++ b/src/common/log.c @@ -263,6 +263,13 @@ log_tor_version(logfile_t *lf, int reset) return 0; } +const char bug_suffix[] = " (on Tor " VERSION +#ifndef _MSC_VER + " " +#include "micro-revision.i" +#endif + ")"; + /** Helper: Format a log message into a fixed-sized buffer. (This is * factored out of <b>logv</b> so that we never format a message more * than once.) Return a pointer to the first character of the message @@ -341,6 +348,13 @@ format_msg(char *buf, size_t buf_len, } } } + + if (domain == LD_BUG && + buf_len - n > strlen(bug_suffix)+1) { + memcpy(buf+n, bug_suffix, strlen(bug_suffix)); + n += strlen(bug_suffix); + } + buf[n]='\n'; buf[n+1]='\0'; *msg_len_out = n+1; |