]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Fix compilation with older gccs
authorNick Mathewson <nickm@torproject.org>
Fri, 14 Sep 2012 14:06:00 +0000 (10:06 -0400)
committerNick Mathewson <nickm@torproject.org>
Fri, 14 Sep 2012 14:06:00 +0000 (10:06 -0400)
They don't like to have #preprocessor directives inside macro arguments.

Fixes #6842; fix on 0.2.4.2-alpha.

Found by grarpamp.

changes/old_gcc_macro_fix [new file with mode: 0644]
src/common/util.c
src/or/main.c

diff --git a/changes/old_gcc_macro_fix b/changes/old_gcc_macro_fix
new file mode 100644 (file)
index 0000000..5fc0a47
--- /dev/null
@@ -0,0 +1,5 @@
+  o Minor bugfixes:
+    - Fix building with older versions of GCC that don't like preprocessor
+      directives inside macro arguments. Found by grarpamp. Fixes bug 6842;
+      bugfix on 0.2.4.2-alpha.
+     
index 0e0dcb179cd2996ae8feff01801072a4c0c7c95c..d4d7cb3720a273fd022867c6558141a2e5a577fe 100644 (file)
@@ -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));
index 01da7a448ddf3d4fd2a69bbf5bb414715228fe29..635dcb4bd56550298cef5e068438292a5eee8768 100644 (file)
@@ -2309,13 +2309,14 @@ tor_init(int argc, char *argv[])
 
   {
     const char *version = get_version();
-    log_notice(LD_GENERAL, "Tor v%s %srunning on %s with Libevent %s "
-               "and OpenSSL %s.", version,
+    const char *bev_str =
 #ifdef USE_BUFFEREVENTS
-               "(with bufferevents) ",
+      "(with bufferevents) ";
 #else
-               "",
+      "";
 #endif
+    log_notice(LD_GENERAL, "Tor v%s %srunning on %s with Libevent %s "
+               "and OpenSSL %s.", version, bev_str,
                get_uname(),
                tor_libevent_get_version_str(),
                crypto_openssl_get_version_str());