]> git.donarmstrong.com Git - lilypond.git/blob - debian/patches/0006-Make-sockets.test-more-robust.patch
Cherry-pick 6a73776004 with minor adaptions in d/control and d/rules
[lilypond.git] / debian / patches / 0006-Make-sockets.test-more-robust.patch
1 From 4bd9feda896f146786de6481a63b449a1904047c Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= <ludo@gnu.org>
3 Date: Tue, 19 Jan 2010 18:49:06 +0100
4 Subject: Make `sockets.test' more robust.
5
6 * test-suite/tests/socket.test ("AF_INET6/SOCK_STREAM"): Gracefully
7   handle cases where this combination is not supported.
8 ---
9  test-suite/tests/socket.test | 12 +++++++++---
10  1 file changed, 9 insertions(+), 3 deletions(-)
11
12 diff --git a/guile18/test-suite/tests/socket.test b/guile18/test-suite/tests/socket.test
13 index e73f585..0510f54 100644
14 --- a/guile18/test-suite/tests/socket.test
15 +++ b/guile18/test-suite/tests/socket.test
16 @@ -1,6 +1,6 @@
17  ;;;; socket.test --- test socket functions     -*- scheme -*-
18  ;;;;
19 -;;;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
20 +;;;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
21  ;;;;
22  ;;;; This library is free software; you can redistribute it and/or
23  ;;;; modify it under the terms of the GNU Lesser General Public
24 @@ -341,7 +341,9 @@
25  
26        ;; testing `bind', `listen' and `connect' on stream-oriented sockets
27  
28 -      (let ((server-socket (socket AF_INET6 SOCK_STREAM 0))
29 +      (let ((server-socket
30 +             ;; Some platforms don't support this protocol/family combination.
31 +             (false-if-exception (socket AF_INET6 SOCK_STREAM 0)))
32             (server-bound? #f)
33             (server-listening? #f)
34             (server-pid #f)
35 @@ -350,6 +352,8 @@
36             (client-port 9998))
37  
38         (pass-if "bind"
39 +          (if (not server-socket)
40 +              (throw 'unresolved))
41           (catch 'system-error
42             (lambda ()
43               (bind server-socket AF_INET6 ipv6-addr server-port)
44 @@ -361,8 +365,10 @@
45                       (else (apply throw args)))))))
46  
47         (pass-if "bind/sockaddr"
48 -         (let* ((sock (socket AF_INET6 SOCK_STREAM 0))
49 +         (let* ((sock (false-if-exception (socket AF_INET6 SOCK_STREAM 0)))
50                  (sockaddr (make-socket-address AF_INET6 ipv6-addr client-port)))
51 +            (if (not sock)
52 +                (throw 'unresolved))
53             (catch 'system-error
54               (lambda ()
55                 (bind sock sockaddr)