-
Notifications
You must be signed in to change notification settings - Fork 0
/
guile-1.8.8-make-sockets.test-more-robust.patch
46 lines (41 loc) · 1.89 KB
/
guile-1.8.8-make-sockets.test-more-robust.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
X-Git-Url: http://git.savannah.gnu.org/gitweb/?p=guile.git;a=blobdiff_plain;f=test-suite%2Ftests%2Fsocket.test;h=0510f545c9f6a6629409454a1053c8c09efc7809;hp=e73f5851070d51e4c287872369065b167fda819f;hb=b720f244942320731e1ceb67f3648143a3316b32;hpb=0270d901250423e89bbe42f997c0fc093c9e49cd
diff --git a/test-suite/tests/socket.test b/test-suite/tests/socket.test
index e73f585..0510f54 100644
--- a/test-suite/tests/socket.test
+++ b/test-suite/tests/socket.test
@@ -1,6 +1,6 @@
;;;; socket.test --- test socket functions -*- scheme -*-
;;;;
-;;;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
+;;;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
@@ -341,7 +341,9 @@
;; testing `bind', `listen' and `connect' on stream-oriented sockets
- (let ((server-socket (socket AF_INET6 SOCK_STREAM 0))
+ (let ((server-socket
+ ;; Some platforms don't support this protocol/family combination.
+ (false-if-exception (socket AF_INET6 SOCK_STREAM 0)))
(server-bound? #f)
(server-listening? #f)
(server-pid #f)
@@ -350,6 +352,8 @@
(client-port 9998))
(pass-if "bind"
+ (if (not server-socket)
+ (throw 'unresolved))
(catch 'system-error
(lambda ()
(bind server-socket AF_INET6 ipv6-addr server-port)
@@ -361,8 +365,10 @@
(else (apply throw args)))))))
(pass-if "bind/sockaddr"
- (let* ((sock (socket AF_INET6 SOCK_STREAM 0))
+ (let* ((sock (false-if-exception (socket AF_INET6 SOCK_STREAM 0)))
(sockaddr (make-socket-address AF_INET6 ipv6-addr client-port)))
+ (if (not sock)
+ (throw 'unresolved))
(catch 'system-error
(lambda ()
(bind sock sockaddr)