diff options
author | Ludovic Courtès <ludo@gnu.org> | 2016-04-25 23:22:45 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2016-04-25 23:34:20 +0200 |
commit | 5cd25aad3cdb6c970a76542e328a3beba8c1f2c9 (patch) | |
tree | c2edfdb472236ea9145756b7da82ce32174da22e /tests/syscalls.scm | |
parent | 0054e47036b13d46f0f026bbc04d19770c2ecbad (diff) | |
download | guix-5cd25aad3cdb6c970a76542e328a3beba8c1f2c9.tar.gz |
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 'tests/syscalls.scm')
-rw-r--r-- | tests/syscalls.scm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/syscalls.scm b/tests/syscalls.scm index 895f90f4d8..71bcbc4d32 100644 --- a/tests/syscalls.scm +++ b/tests/syscalls.scm @@ -259,15 +259,16 @@ (#f #f) (lo (interface-address lo))))))) -(test-equal "terminal-window-size ENOTTY" - ENOTTY +(test-assert "terminal-window-size ENOTTY" (call-with-input-file "/dev/null" (lambda (port) (catch 'system-error (lambda () (terminal-window-size port)) (lambda args - (system-error-errno args)))))) + ;; Accept EINVAL, which some old Linux versions might return. + (memv (system-error-errno args) + (list ENOTTY EINVAL))))))) (test-assert "terminal-columns" (> (terminal-columns) 0)) |