Move 'setvbuf' shim to '(gash compat)'.

* tests/unit/shell.scm: Mode 'setvbuf' shim...
* gash/compat.scm: ...here.
This commit is contained in:
Timothy Sample 2019-05-20 00:27:07 -04:00
parent 2d19d82444
commit 2d46b8b43e
2 changed files with 12 additions and 10 deletions

View File

@ -56,3 +56,14 @@
(define-public (exact-integer? x)
(and (integer? x) (exact? x))))
#f)
(cond-expand
((and guile-2 (not guile-2.2))
(define* (setvbuf port mode #:optional size)
(let ((mode (match mode
('none _IONBF)
('line _IOLBF)
('block _IOFBF))))
((@ (guile) setvbuf) port mode size)))
(export! setvbuf))
(else #f))

View File

@ -17,6 +17,7 @@
;;; along with Gash. If not, see <http://www.gnu.org/licenses/>.
(define-module (test-shell)
#:use-module (gash compat)
#:use-module (gash compat textual-ports)
#:use-module (gash environment)
#:use-module (gash shell)
@ -64,16 +65,6 @@
(delete-recursively directory)
result))
(cond-expand
((and guile-2 (not guile-2.2))
(define* (setvbuf port mode #:optional size)
(let ((mode (match mode
('none _IONBF)
('line _IOLBF)
('block _IOFBF))))
((@ (guile) setvbuf) port mode size))))
(else #f))
(define (%make-script object . forms)
(define (write-script port)
(chmod port #o755)