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:
parent
45c762c08c
commit
fb67d3ca72
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue