Opened 9 years ago

Closed 9 years ago

Last modified 8 years ago

#4366 closed defect (fixed)

duplicate includes

Reported by: arma Owned by:
Priority: Medium Milestone: Tor: 0.2.3.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: tor-client
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


I got a nice mail from somebody named Andrea Gelmini with a patch to remove some duplicate include lines. Here is the patch:

Signed-off-by: Andrea Gelmini <>
 src/common/compat.h  |    3 ---
 src/common/crypto.c  |    2 --
 src/common/mempool.c |    4 ----
 src/or/eventdns.c    |    1 -
 4 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/src/common/compat.h b/src/common/compat.h
index 8e271ba..045f414 100644
--- a/src/common/compat.h
+++ b/src/common/compat.h
@@ -45,9 +45,6 @@
 #include <sys/socket.h>
-#include <sys/types.h>
 #include <netinet/in.h>
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 0763a2c..f2ef833 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -64,8 +64,6 @@
 #error "We require OpenSSL >= 0.9.7"

-#include <openssl/engine.h>
 #ifdef ANDROID
 /* Android's OpenSSL seems to have removed all of its Engine support. */
diff --git a/src/common/mempool.c b/src/common/mempool.c
index 30d7788..c753052 100644
--- a/src/common/mempool.c
+++ b/src/common/mempool.c
@@ -1,9 +1,5 @@
 /* Copyright (c) 2007-2011, The Tor Project, Inc. */
 /* See LICENSE for licensing information */
-#if 1
-/* Tor dependencies */
-#include "orconfig.h"

 #include <stdlib.h>
 #include <string.h>
diff --git a/src/or/eventdns.c b/src/or/eventdns.c
index 7fe376b..aa12324 100644
--- a/src/or/eventdns.c
+++ b/src/or/eventdns.c
@@ -64,7 +64,6 @@
 #include <openssl/rand.h>

-#include <string.h>
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>

Child Tickets

Change History (5)

comment:1 Changed 9 years ago by arma

Status: newneeds_review

comment:2 Changed 9 years ago by Sebastian

I suspect the change in mempool.c is wrong:
93f32db438cff63662761374f4a69b710f3d71d9 added it there, to get rid of some compile warnings on some Sun systems. I suspect it is needed for the other includes to work. Since I can't test this, I'd rather use a different patch here.

I've pushed a branch (bug4366) with the original patch together with a fixup commit. Please check it out? See for details

comment:3 Changed 9 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

looks fine to me. will squash and merge. Thanks, Sebastian! Thanks, Andrea!

comment:4 Changed 8 years ago by nickm

Keywords: tor-client added

comment:5 Changed 8 years ago by nickm

Component: Tor ClientTor
Note: See TracTickets for help on using tickets.