io: fix file-stream-buffer-mode on file output ports

This commit is contained in:
Matthew Flatt 2019-02-13 10:20:04 -07:00
parent c2d53143c1
commit 5339a36187
2 changed files with 5 additions and 2 deletions

View File

@ -887,6 +887,9 @@
(define ofile (open-output-file path #:mode 'text #:exists 'replace))
(fprintf ofile "abc\ndef\nghi\n")
(test 'block file-stream-buffer-mode ofile)
(test (void) file-stream-buffer-mode ofile 'line)
(test 'line file-stream-buffer-mode ofile)
(close-output-port ofile)
(let ()

View File

@ -271,8 +271,8 @@
;; in atomic mode
[buffer-mode
(case-lambda
[(self) buffer-mode]
[(self mode) (set! buffer-mode mode)])]
[() buffer-mode]
[(mode) (set! buffer-mode mode)])]
#:property
[prop:file-stream (lambda (p) (fd-output-port-fd p))]