File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
48
48
` ::nix::sys::reboot ` now return ` Result<Infallible> ` instead of ` Result<Void> ` (#[ 1239] ( https://github.com/nix-rust/nix/pull/1239 ) )
49
49
- ` sys::socket::sockaddr_storage_to_addr ` is no longer ` unsafe ` . So is
50
50
` offset_of! ` .
51
+ - ` sys::socket::sockaddr_storage_to_addr ` , ` offset_of! ` , and ` Errno::clear ` are
52
+ no longer ` unsafe ` .
51
53
(#[ 1244] ( https://github.com/nix-rust/nix/pull/1244 ) )
52
54
- Several ` Inotify ` methods now take ` self ` by value instead of by reference
53
55
(#[ 1244] ( https://github.com/nix-rust/nix/pull/1244 ) )
Original file line number Diff line number Diff line change @@ -46,8 +46,11 @@ cfg_if! {
46
46
}
47
47
48
48
/// Sets the platform-specific errno to no-error
49
- unsafe fn clear ( ) {
50
- * errno_location ( ) = 0 ;
49
+ fn clear ( ) {
50
+ // Safe because errno is a thread-local variable
51
+ unsafe {
52
+ * errno_location ( ) = 0 ;
53
+ }
51
54
}
52
55
53
56
/// Returns the platform-specific value of errno
@@ -70,7 +73,7 @@ impl Errno {
70
73
from_i32 ( err)
71
74
}
72
75
73
- pub unsafe fn clear ( ) {
76
+ pub fn clear ( ) {
74
77
clear ( )
75
78
}
76
79
You can’t perform that action at this time.
0 commit comments