diff options
| author | LinkTed <LinkTed@users.noreply.github.com> | 2020-09-16 20:30:59 +0200 |
|---|---|---|
| committer | LinkTed <LinkTed@users.noreply.github.com> | 2020-10-10 15:19:12 +0200 |
| commit | 1902711f3867753cb2682043c283ffa4a70a317c (patch) | |
| tree | 3b68a101e7778522d71f8455aee1040655dbc7d6 /library/std/src | |
| parent | eeea5c23b494782bf6a864005684d3405f5c062b (diff) | |
| download | rust-1902711f3867753cb2682043c283ffa4a70a317c.tar.gz rust-1902711f3867753cb2682043c283ffa4a70a317c.zip | |
Change name of struct to SocketCred
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/sys/unix/ext/net/ancillary.rs | 16 | ||||
| -rw-r--r-- | library/std/src/sys/unix/ext/net/tests.rs | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/library/std/src/sys/unix/ext/net/ancillary.rs b/library/std/src/sys/unix/ext/net/ancillary.rs index d41984a532b..8dc74062fdf 100644 --- a/library/std/src/sys/unix/ext/net/ancillary.rs +++ b/library/std/src/sys/unix/ext/net/ancillary.rs @@ -180,7 +180,7 @@ impl<'a, T> Iterator for AncillaryDataIter<'a, T> { ))] #[unstable(feature = "unix_socket_ancillary_data", issue = "none")] #[derive(Clone)] -pub struct UCred(libc::ucred); +pub struct SocketCred(libc::ucred); #[cfg(any( doc, @@ -196,13 +196,13 @@ pub struct UCred(libc::ucred); target_os = "openbsd", target_env = "uclibc", ))] -impl UCred { +impl SocketCred { /// Create a Unix credential struct. /// /// PID, UID and GID is set to 0. #[unstable(feature = "unix_socket_ancillary_data", issue = "none")] - pub fn new() -> UCred { - UCred(libc::ucred { pid: 0, uid: 0, gid: 0 }) + pub fn new() -> SocketCred { + SocketCred(libc::ucred { pid: 0, uid: 0, gid: 0 }) } /// Set the PID. @@ -293,10 +293,10 @@ pub struct ScmCredentials<'a>(AncillaryDataIter<'a, libc::ucred>); ))] #[unstable(feature = "unix_socket_ancillary_data", issue = "none")] impl<'a> Iterator for ScmCredentials<'a> { - type Item = UCred; + type Item = SocketCred; - fn next(&mut self) -> Option<UCred> { - Some(UCred(self.0.next()?)) + fn next(&mut self) -> Option<SocketCred> { + Some(SocketCred(self.0.next()?)) } } @@ -606,7 +606,7 @@ impl<'a> SocketAncillary<'a> { target_env = "uclibc", ))] #[unstable(feature = "unix_socket_ancillary_data", issue = "none")] - pub fn add_creds(&mut self, creds: &[UCred]) -> bool { + pub fn add_creds(&mut self, creds: &[SocketCred]) -> bool { self.truncated = false; add_to_ancillary_data( &mut self.buffer, diff --git a/library/std/src/sys/unix/ext/net/tests.rs b/library/std/src/sys/unix/ext/net/tests.rs index db6a972e7d2..16915a4cc1e 100644 --- a/library/std/src/sys/unix/ext/net/tests.rs +++ b/library/std/src/sys/unix/ext/net/tests.rs @@ -519,7 +519,7 @@ fn test_send_vectored_with_ancillary_to_unix_datagram() { let mut ancillary1_buffer = [0; 128]; let mut ancillary1 = SocketAncillary::new(&mut ancillary1_buffer[..]); - let mut cred1 = UCred::new(); + let mut cred1 = SocketCred::new(); cred1.set_pid(getpid()); cred1.set_uid(getuid()); cred1.set_gid(getgid()); |
