crepererum commented on code in PR #676:
URL:
https://github.com/apache/arrow-rs-object-store/pull/676#discussion_r3046526213
##########
src/local.rs:
##########
@@ -1913,4 +1956,16 @@ mod unix_test {
spawned.await.unwrap();
}
+
+ #[test]
+ fn test_close_file_detects_error() {
+ use std::os::unix::io::AsRawFd;
+
+ let file = tempfile::tempfile().unwrap();
+ let fd = file.as_raw_fd();
+ // Close the fd behind Rust's back so close_file will get EBADF
+ assert_eq!(unsafe { libc::close(fd) }, 0);
+ let err = super::close_file(file).unwrap_err();
+ assert_eq!(err.raw_os_error(), Some(libc::EBADF));
+ }
Review Comment:
Ah, NFS our old friend :grin: . This makes sense, thank you!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]