mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-05-23 09:35:56 +02:00
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.
This commit is contained in:
+4
-3
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user