1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00

check file descriptor before we close the handle

This commit is contained in:
Stefan Lankes 2017-05-25 21:06:15 +02:00
parent 45c762c08c
commit fb67d3ca72

View file

@ -806,8 +806,10 @@ static int vcpu_loop(void)
unsigned data = *((unsigned*)((size_t)run+run->io.data_offset));
uhyve_close_t* uhyve_close = (uhyve_close_t*) (guest_mem+data);
if (uhyve_close->ret > 2)
if (uhyve_close->fd > 2)
uhyve_close->ret = close(uhyve_close->fd);
else
uhyve_close->ret = 0;
break;
}