2020-02-24 Egeyar Bagcioglu <egeyar@gmail.com>
* libpoke/ios-dev-file.c (ios_dev_file_close): Handle errors properly.
Return IOD_ERROR on failure, IOD_OK otherwise.
* libpoke/ios-dev-mem.c (ios_dev_mem_close): Return IOD_OK.
* libpoke/ios-dev-nbd.c (ios_dev_nbd_close): Likewise.
* libpoke/ios-dev-stream.c (ios_dev_stream_close): Likewise.
* libpoke/ios-dev.h (close): Return IOD_ERROR on failure, IOD_OK on
success.
* libpoke/ios.c (ios_close): Return IOS_OK on success and the error
code on
failure. Do not assert that dev_if->close is successful.
* libpoke/ios.h (ios_close): Likewise.
* libpoke/pvm.jitter (close): Raise PVM_E_NO_IOS if the IO space to be
closed does not exist. Raise PVM_E_IO if ios_close fails.
Since this impacts the language-level semantics of the `close' built-in,
we are gonna need a couple of close-*.pk tests in testsuite/poke.pkl,
checking that the right exceptions are raised in the desired conditions.
Also, the "close" section in the manual needs an update to reflect this
change.
Provided the above, this is OK for master.
Thanks!