khan: do not unlink / close unless live

This commit is contained in:
Jōshin 2021-10-03 17:33:45 +00:00
parent 77db31f187
commit eab4ed9477

View File

@ -274,7 +274,11 @@ _khan_io_exit(u3_auto* car_u)
{
u3_khan* kan_u = (u3_khan*)car_u;
{
if ( car_u->liv_o == c3n ) {
c3_free(car_u);
return;
}
else {
c3_c* pax_c = u3_Host.dir_c;
c3_w len_w = strlen(pax_c) + 1 + sizeof(URB_SOCK_PATH);
c3_c* paf_c = c3_malloc(len_w);
@ -288,7 +292,6 @@ _khan_io_exit(u3_auto* car_u)
u3l_log("khan: failed to unlink socket: %s\n", uv_strerror(errno));
}
c3_free(paf_c);
}
{
u3_shan* san_u = kan_u->san_u;
@ -302,6 +305,7 @@ _khan_io_exit(u3_auto* car_u)
}
uv_close((uv_handle_t*)&san_u->pyp_u, _khan_close_cb);
}
}
c3_free(kan_u);
}