places: repair clean-up after serialize failure

This commit is contained in:
Matthew Flatt 2019-12-16 11:54:28 -07:00
parent f7c39512ab
commit c7388f9fa8
2 changed files with 9 additions and 7 deletions

View File

@ -8,18 +8,20 @@
(for/list ((n (in-naturals)))
(place-channel-get in))))
(define i
(define fds
(case mode
[("tcp")
(define PORT 12346)
(define listener (tcp-listen PORT 100 #t))
(define-values (i o) (tcp-connect "127.0.0.1" PORT))
i]
(list i o)]
[else
(current-input-port)]))
(list (current-input-port)
(current-output-port))]))
(for ((n (in-naturals)))
(printf "sending port ~a\n" n)
(place-channel-put out i)))
(place-channel-put out fds)))
(module+ test
(require racket/system

View File

@ -820,7 +820,7 @@ static void bad_place_message2(Scheme_Object *so, Scheme_Object *o, int can_rais
if (v) {
if (SCHEME_VEC_ELS(v)[0]) {
l = SCHEME_VEC_ELS(v)[0];
while (SCHEME_PAIRP(l)) {
while (SCHEME_RPAIRP(l)) {
rktio_fd_close_transfer(unbox_fd(SCHEME_CAR(l)));
l = SCHEME_CDR(l);
SCHEME_USE_FUEL(1);
@ -828,7 +828,7 @@ static void bad_place_message2(Scheme_Object *so, Scheme_Object *o, int can_rais
}
if (SCHEME_VEC_ELS(v)[1]) {
l = SCHEME_VEC_ELS(v)[1];
while (SCHEME_PAIRP(l)) {
while (SCHEME_RPAIRP(l)) {
rktio_fd_close_transfer(unbox_fd(SCHEME_CAR(l)));
l = SCHEME_CDR(l);
SCHEME_USE_FUEL(1);
@ -841,7 +841,7 @@ static void bad_place_message2(Scheme_Object *so, Scheme_Object *o, int can_rais
static void push_duped_fd(Scheme_Object **fd_accumulators, intptr_t slot, rktio_fd_transfer_t *dupfdt) {
Scheme_Object *tmp;
Scheme_Vector *v;
Scheme_Vector *v;
if (fd_accumulators) {
if (!*fd_accumulators) {
tmp = scheme_make_vector(2, scheme_null);