aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Shepard <andrea@torproject.org>2015-01-12 16:26:34 +0000
committerAndrea Shepard <andrea@torproject.org>2015-01-12 16:26:34 +0000
commit62f297fff062afa5aabfb5cd5152897a1ca4591b (patch)
treee516ce1378443fc6c471e13d1c66cabf332b731e
parent78956f5d857f573106fd4dd4d2f9220af32be1b3 (diff)
downloadtor-62f297fff062afa5aabfb5cd5152897a1ca4591b.tar.gz
tor-62f297fff062afa5aabfb5cd5152897a1ca4591b.zip
Kill duplicated code in connection_listener_new()
-rw-r--r--src/or/connection.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/src/or/connection.c b/src/or/connection.c
index c78cebad70..9866c4c804 100644
--- a/src/or/connection.c
+++ b/src/or/connection.c
@@ -1234,18 +1234,10 @@ connection_listener_new(const struct sockaddr *listensockaddr,
}
#endif
- if (type == CONN_TYPE_CONTROL_LISTENER &&
- options->ControlSocketsGroupWritable) {
- /* We need to use chmod; fchmod doesn't work on sockets on all
- * platforms. */
- if (chmod(address, 0660) < 0) {
- log_warn(LD_FS,"Unable to make %s group-writable.", address);
- goto err;
- }
- }
-
- if (type == CONN_TYPE_AP_LISTENER &&
- options->SocksSocketsGroupWritable) {
+ if ((type == CONN_TYPE_CONTROL_LISTENER &&
+ options->ControlSocketsGroupWritable) ||
+ (type == CONN_TYPE_AP_LISTENER &&
+ options->SocksSocketsGroupWritable)) {
/* We need to use chmod; fchmod doesn't work on sockets on all
* platforms. */
if (chmod(address, 0660) < 0) {