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

[tor-commits] [tor/master] test: Add missing socket errno in test_util.c



commit e129393e40ae291b825d41946580d8a4cf63a61d
Author: David Goulet <dgoulet@xxxxxxxxxxxxxx>
Date:   Wed Feb 8 08:56:39 2017 -0500

    test: Add missing socket errno in test_util.c
    
    According to 21116, it seems to be needed for Wheezy Raspbian build. Also,
    manpage of socket(2) does confirm that this errno value should be catched as
    well in case of no support from the OS of IPv4 or/and IPv6.
    
    Fixes #21116
    
    Signed-off-by: David Goulet <dgoulet@xxxxxxxxxxxxxx>
---
 changes/bug21116     | 3 +++
 src/test/test_util.c | 3 ++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/changes/bug21116 b/changes/bug21116
new file mode 100644
index 0000000..2304ab0
--- /dev/null
+++ b/changes/bug21116
@@ -0,0 +1,3 @@
+  o Minor bugfixes (test):
+    - Fix Raspbian build missing socket errno in test util. Fixes bug 21116.;
+      bugfix on tor-0.2.8.2. Patch by "hein".
diff --git a/src/test/test_util.c b/src/test/test_util.c
index fafb84f..c317e72 100644
--- a/src/test/test_util.c
+++ b/src/test/test_util.c
@@ -5091,7 +5091,8 @@ test_util_socket(void *arg)
 
   fd1 = tor_open_socket_with_extensions(domain, SOCK_STREAM, 0, 0, 0);
   int err = tor_socket_errno(fd1);
-  if (fd1 < 0 && err == SOCK_ERRNO(EPROTONOSUPPORT)) {
+  if (fd1 < 0 && (err == SOCK_ERRNO(EPROTONOSUPPORT) ||
+                  err == SOCK_ERRNO(EAFNOSUPPORT))) {
     /* Assume we're on an IPv4-only or IPv6-only system, and give up now. */
     goto done;
   }



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