Removed a confusing error message from NitroEnclave shutdowns
@@ -191,7 +191,15 @@ impl NitroEnclave {
}
if let Err(err) = shutdown(socket_fd, Shutdown::Both) {
- println!("NitroEnclave::ocall_loop failed to shutdown socket({:?}. This might cause you problems in the future.", err);
+ match err {
+ nix::Error::Sys(err) => {
+ match err {
+ nix::errno::Errno::ENOTCONN => (), // this is normal
+ _ => println!("NitroEnclave::ocall_loop failed to shutdown socket({:?}. This might cause you problems in the future.", err),
+ }
+ }, // This is normal
+ _ => println!("NitroEnclave::ocall_loop failed to shutdown socket({:?}. This might cause you problems in the future.", err),
+ }
}
if let Err(err) = close(socket_fd) {
println!("NitroEnclave::ocall_loop failed to close socket file handle({:?}). This might cause you problems in the future", err);
