[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Kill duplicated code in connection_listener_new()



commit 62f297fff062afa5aabfb5cd5152897a1ca4591b
Author: Andrea Shepard <andrea@xxxxxxxxxxxxxx>
Date:   Mon Jan 12 16:26:34 2015 +0000

    Kill duplicated code in connection_listener_new()
---
 src/or/connection.c |   16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

diff --git a/src/or/connection.c b/src/or/connection.c
index c78ceba..9866c4c 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) {



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits