guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, branch_release-1-8, updated. release_1


From: Ludovic Courtès
Subject: [Guile-commits] GNU Guile branch, branch_release-1-8, updated. release_1-8-7-14-g5411e04
Date: Thu, 26 Nov 2009 09:17:53 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=5411e043d0dd258a3724c8c5e3351944b91c543b

The branch, branch_release-1-8 has been updated
       via  5411e043d0dd258a3724c8c5e3351944b91c543b (commit)
      from  a0f8a73f283ca8e5532090a137c95546836ddd4d (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 5411e043d0dd258a3724c8c5e3351944b91c543b
Author: Ludovic Courtès <address@hidden>
Date:   Wed Nov 18 15:28:56 2009 +0100

    Work around path name length limitations in `socket.test'.
    
    * test-suite/tests/socket.test (%tmpdir, %curdir): New variables.
      Chdir to %TMPDIR.  Switch back to %CURDIR at the end.
      (temp-file-path): Return a base file name, not an absolute path.

-----------------------------------------------------------------------

Summary of changes:
 test-suite/tests/socket.test |   34 ++++++++++++++++++++++++++--------
 1 files changed, 26 insertions(+), 8 deletions(-)

diff --git a/test-suite/tests/socket.test b/test-suite/tests/socket.test
index 5b738fd..e73f585 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 Free Software Foundation, Inc.
+;;;; Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 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
@@ -174,13 +174,28 @@
 ;;; AF_UNIX sockets and `make-socket-address'
 ;;;
 
+(define %tmpdir
+  ;; Honor `$TMPDIR', which tmpnam(3) doesn't do.
+  (or (getenv "TMPDIR") "/tmp"))
+
+(define %curdir
+  ;; Remember the current working directory.
+  (getcwd))
+
+;; Temporarily cd to %TMPDIR.  The goal is to work around path name
+;; limitations, which can lead to exceptions like:
+;;
+;;  (misc-error "scm_to_sockaddr"
+;;              "unix address path too long: ~A"
+;;              
("/tmp/nix-build-fb7bph4ifh0vr3ihigm702dzffdnapfj-guile-coverage-1.9.5.drv-0/guile-test-socket-1258553296-77619")
+;;              #f)
+(chdir %tmpdir)
+
 (define (temp-file-path)
-  ;; Return a temporary file path that honors `$TMPDIR', which `tmpnam'
-  ;; doesn't do.
-  (let ((dir (or (getenv "TMPDIR") "/tmp")))
-    (string-append dir "/guile-test-socket-"
-                   (number->string (current-time)) "-"
-                   (number->string (random 100000)))))
+  ;; Return a temporary file name, assuming the current directory is %TMPDIR.
+  (string-append "guile-test-socket-"
+                 (number->string (current-time)) "-"
+                 (number->string (random 100000))))
 
 
 (if (defined? 'AF_UNIX)
@@ -404,4 +419,7 @@
              (let ((status (cdr (waitpid server-pid))))
                (eq? 0 (status:exit-val status)))))
 
-       #t)))
\ No newline at end of file
+       #t)))
+
+;; Switch back to the previous directory.
+(false-if-exception (chdir %curdir))


hooks/post-receive
-- 
GNU Guile




reply via email to

[Prev in Thread] Current Thread [Next in Thread]