aws-nitro-enclaves-nsm-api
aws-nitro-enclaves-nsm-api copied to clipboard
driver: wrap fd returned from nsm_init in Option
Returning an Option instead of the raw file descriptor makes it easier for the caller to ensure that the file was opened successfully. It also forces them to handle any errors instead of allowing them to assume that it was successful, only to be met with "InternalError" when nsm_process_request is later used.
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.