From e4ce8cd9691708d9bc0bcc9904d656fe35001946 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 14 Sep 2012 10:06:00 -0400 Subject: Fix compilation with older gccs They don't like to have #preprocessor directives inside macro arguments. Fixes #6842; fix on 0.2.4.2-alpha. Found by grarpamp. --- src/common/util.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/common') diff --git a/src/common/util.c b/src/common/util.c index 0e0dcb179..d4d7cb372 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -3923,13 +3923,15 @@ tor_process_handle_destroy(process_handle_t *process_handle, if (also_terminate_process) { if (tor_terminate_process(process_handle) < 0) { - log_notice(LD_GENERAL, "Failed to terminate process with " - "PID '%d' ('%s').", tor_process_get_pid(process_handle), + const char *errstr = #ifdef _WIN32 - format_win32_error(GetLastError())); + format_win32_error(GetLastError()); #else - strerror(errno)); + strerror(errno); #endif + log_notice(LD_GENERAL, "Failed to terminate process with " + "PID '%d' ('%s').", tor_process_get_pid(process_handle), + errstr); } else { log_info(LD_GENERAL, "Terminated process with PID '%d'.", tor_process_get_pid(process_handle)); -- cgit v1.2.3