Opened 8 years ago

Closed 8 years ago

Last modified 7 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:

Description

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 <andrea.gelmini@gelma.net>
---
 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 @@
 #ifdef HAVE_SYS_SOCKET_H
 #include <sys/socket.h>
 #endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
 #ifdef HAVE_NETINET_IN_H
 #include <netinet/in.h>
 #endif
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"
 #endif

-#include <openssl/engine.h>
-
 #ifdef ANDROID
 /* Android's OpenSSL seems to have removed all of its Engine support. */
 #define DISABLE_ENGINES
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"
-#endif

 #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>
 #endif

-#include <string.h>
 #ifdef HAVE_FCNTL_H
 #include <fcntl.h>
 #endif
--
1.7.8.rc0.156.gdf33

Child Tickets

Change History (5)

comment:1 Changed 8 years ago by arma

Status: newneeds_review

comment:2 Changed 8 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 https://gitweb.torproject.org/sebastian/tor.git/shortlog/refs/heads/bug4366 for details

comment:3 Changed 8 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

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

comment:4 Changed 7 years ago by nickm

Keywords: tor-client added

comment:5 Changed 7 years ago by nickm

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