[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 06/47: tests: Gracefully handle ENOSYS return for 'setaf
From: |
Andy Wingo |
Subject: |
[Guile-commits] 06/47: tests: Gracefully handle ENOSYS return for 'setaffinity'. |
Date: |
Sun, 22 May 2016 18:23:03 +0000 (UTC) |
wingo pushed a commit to branch master
in repository guile.
commit 70d8ef786ac89cfa07a3e7d55df4beb6181a657e
Author: Ludovic Courtès <address@hidden>
Date: Wed Mar 4 09:49:31 2015 +0100
tests: Gracefully handle ENOSYS return for 'setaffinity'.
Fixes <http://bugs.gnu.org/19646>.
Reported by John Paul Adrian Glaubitz <address@hidden>.
* test-suite/tests/posix.test ("affinity")["setaffinity"]: Wrap in
'catch' and throw 'unresolved upon ENOSYS.
---
test-suite/tests/posix.test | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/test-suite/tests/posix.test b/test-suite/tests/posix.test
index 9a0e489..f57001a 100644
--- a/test-suite/tests/posix.test
+++ b/test-suite/tests/posix.test
@@ -1,6 +1,7 @@
;;;; posix.test --- Test suite for Guile POSIX functions. -*- scheme -*-
;;;;
-;;;; Copyright 2003, 2004, 2006, 2007, 2010, 2012 Free Software Foundation,
Inc.
+;;;; Copyright 2003, 2004, 2006, 2007, 2010, 2012,
+;;;; 2015 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
@@ -195,9 +196,18 @@
(pass-if "setaffinity"
(if (and (defined? 'setaffinity) (defined? 'getaffinity))
- (let ((mask (getaffinity (getpid))))
- (setaffinity (getpid) mask)
- (equal? mask (getaffinity (getpid))))
+ (catch 'system-error
+ (lambda ()
+ (let ((mask (getaffinity (getpid))))
+ (setaffinity (getpid) mask)
+ (equal? mask (getaffinity (getpid)))))
+ (lambda args
+ ;; On some platforms such as sh4-linux-gnu, 'setaffinity'
+ ;; returns ENOSYS.
+ (let ((errno (system-error-errno args)))
+ (if (= errno ENOSYS)
+ (throw 'unresolved)
+ (apply throw args)))))
(throw 'unresolved))))
;;
- [Guile-commits] branch master updated (fd17cf9 -> 2badbd0), Andy Wingo, 2016/05/22
- [Guile-commits] 10/47: Handle zero-length bytevectors correctly in (system base types)., Andy Wingo, 2016/05/22
- [Guile-commits] 06/47: tests: Gracefully handle ENOSYS return for 'setaffinity'.,
Andy Wingo <=
- [Guile-commits] 02/47: http: Do not buffer HTTP chunks., Andy Wingo, 2016/05/22
- [Guile-commits] 16/47: doc: Fix parameter of 'set-record-type-printer!'., Andy Wingo, 2016/05/22
- [Guile-commits] 20/47: Clarify datum->syntax documentation., Andy Wingo, 2016/05/22
- [Guile-commits] 17/47: Fix atan procedure when applied to complex numbers., Andy Wingo, 2016/05/22
- [Guile-commits] 23/47: doc: Fix menu order for SXML., Andy Wingo, 2016/05/22
- [Guile-commits] 30/47: Add new Linux errno constants., Andy Wingo, 2016/05/22
- [Guile-commits] 29/47: Fix the rule to check for new signals and errors, Andy Wingo, 2016/05/22
- [Guile-commits] 35/47: doc: Mention a known-good Flex version number., Andy Wingo, 2016/05/22
- [Guile-commits] 27/47: web: Gracefully handle premature EOF when reading chunk header., Andy Wingo, 2016/05/22
- [Guile-commits] 36/47: build: Add SCM_T_OFF_MAX and SCM_T_OFF_MIN to scmconfig.h., Andy Wingo, 2016/05/22