Skip to content

Commit

Permalink
close channel on a %shut
Browse files Browse the repository at this point in the history
  • Loading branch information
mopfel-winrux committed Dec 4, 2023
1 parent b95f228 commit 9826d8a
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions pkg/vere/io/lick.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,16 +182,12 @@ _lick_moor_poke(void* ptr_v, c3_d len_d, c3_y* byt_y)
return;
}

if ( c3y == gen_u->liv_o ) {
wir = u3nc(c3__lick, u3_nul);
dev = _lick_string_to_path(gen_u->nam_c+1);
cad = u3nt(c3__soak, dev, put);
u3_auto_peer(
u3_auto_plan(&lic_u->car_u, u3_ovum_init(0, c3__l, wir, cad)),
0, 0, 0);
} else {
u3z(put);
}
wir = u3nc(c3__lick, u3_nul);
dev = _lick_string_to_path(gen_u->nam_c+1);
cad = u3nt(c3__soak, dev, put);
u3_auto_peer(
u3_auto_plan(&lic_u->car_u, u3_ovum_init(0, c3__l, wir, cad)),
0, 0, 0);
}

/* _lick_close_chan(): close given channel, freeing.
Expand Down Expand Up @@ -306,6 +302,12 @@ static void
_lick_close_sock(u3_shan* san_u)
{
u3_lick* lic_u = san_u->gen_u->lic_u;
u3_chan* can_u = san_u->can_u;

if ( NULL != can_u ) {
_lick_close_chan(san_u->can_u);
}

c3_w len_w = strlen(lic_u->fod_c) + strlen(san_u->gen_u->nam_c) + 2;
c3_c* paf_c = c3_malloc(len_w);
c3_i wit_i;
Expand Down

0 comments on commit 9826d8a

Please sign in to comment.