summaryrefslogtreecommitdiff
path: root/guix/build/syscalls.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2016-04-25 23:22:45 +0200
committerLudovic Courtès <ludo@gnu.org>2016-04-25 23:34:20 +0200
commit5cd25aad3cdb6c970a76542e328a3beba8c1f2c9 (patch)
treec2edfdb472236ea9145756b7da82ce32174da22e /guix/build/syscalls.scm
parent0054e47036b13d46f0f026bbc04d19770c2ecbad (diff)
syscalls: 'terminal-columns' catches EINVAL on the TIOCGWINSZ ioctl.
Reported by Mark H Weaver <mhw@netris.org>. * guix/build/syscalls.scm (terminal-columns): Tolerate EINVAL. * tests/syscalls.scm ("terminal-window-size ENOTTY"): Likewise.
Diffstat (limited to 'guix/build/syscalls.scm')
-rw-r--r--guix/build/syscalls.scm5
1 files changed, 4 insertions, 1 deletions
diff --git a/guix/build/syscalls.scm b/guix/build/syscalls.scm
index d168293ee4..6cdf65304d 100644
--- a/guix/build/syscalls.scm
+++ b/guix/build/syscalls.scm
@@ -1034,7 +1034,10 @@ always a positive integer."
(fall-back)))
(lambda args
(let ((errno (system-error-errno args)))
- (if (= errno ENOTTY)
+ ;; ENOTTY is what we're after but 2012-and-earlier Linux versions
+ ;; would return EINVAL instead in some cases:
+ ;; <https://bugs.ruby-lang.org/issues/10494>.
+ (if (or (= errno ENOTTY) (= errno EINVAL))
(fall-back)
(apply throw args))))))