Commit af50c9c4 authored by Aurelio Colosimo's avatar Aurelio Colosimo Committed by Alessandro Rubini

time-unix/unix-socket.c: fix unix_net_exit

invalidate fd value for ethernet_mode and check it again in case
unix_net_exit is called twice (though should not happen).
Signed-off-by: Aurelio Colosimo's avatarAurelio Colosimo <aurelio@aureliocolosimo.it>
parent 4724b198
......@@ -370,7 +370,11 @@ int unix_net_exit(struct pp_instance *ppi)
int i;
if (ppi->ethernet_mode) {
close(NP(ppi)->ch[PP_NP_GEN].fd);
fd = NP(ppi)->ch[PP_NP_GEN].fd;
if (fd > 0) {
close(fd);
NP(ppi)->ch[PP_NP_GEN].fd = -1;
}
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment