-
Notifications
You must be signed in to change notification settings - Fork 10
Add UDS/Pipe to writev()/Fix UDS EPIPE on send #250
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
for _iov in 0..iovcnt { | ||
unsafe { | ||
let iovec = *ptr; | ||
assert!(!ptr.is_null()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check is performed after dereferencing the pointer, which is not right to me. This assertion should be placed before dereferencing to prevent undefined behavior.
@@ -514,7 +514,9 @@ mod tests { | |||
let emulated_file = EmulatedFile::new(file_path.clone(), file_content.len()).unwrap(); | |||
|
|||
let mut buffer = vec![0; file_content.len()]; | |||
let bytes_read = emulated_file.readat(buffer.as_mut_ptr(), buffer.len(), 0).unwrap(); | |||
let bytes_read = emulated_file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
everything in this file is just rust fmt fixing what I didn't format in the read_at PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The overall logic makes sense to me
Description
Fixes # (issue)
Type of change
How Has This Been Tested?
Added unix domain writev test
Lamp tests
Test suite
Checklist: