1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-02 13:00:26 +02:00

Fix "non-revealed port is closed" ports.test

Don't close the test port's file descriptor because the port still has a
reference to it, and could still close it at any time when finally
garbage collected.  This did soemetimes break subsequent tests.

Bug: https://debbugs.gnu.org/43521
This commit is contained in:
Rob Browning 2020-09-19 14:09:04 -05:00
parent f18f670223
commit 6e82a4516a

View file

@ -623,9 +623,10 @@
(seek fdes 0 SEEK_CUR) (seek fdes 0 SEEK_CUR)
;; If we get here, it might be because PORT was not GC'd, we ;; If we get here, it might be because PORT was not GC'd, we
;; don't know (and we can't use a guardian because it would keep ;; don't know, and we can't use a guardian because it would keep
;; PORT alive.) ;; PORT alive, and we can't close the descriptor because
(close-fdes fdes) ;; subseuqent opens may re-use it, and then if this port is
;; garbage collected, it'll close the descriptor unexpectedly.
(throw 'unresolved)) (throw 'unresolved))
(lambda args (lambda args
(system-error-errno args))))) (system-error-errno args)))))