Skip to content

Commit 1902711

Browse files
committed
Change name of struct to SocketCred
1 parent eeea5c2 commit 1902711

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

library/std/src/sys/unix/ext/net/ancillary.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ impl<'a, T> Iterator for AncillaryDataIter<'a, T> {
180180
))]
181181
#[unstable(feature = "unix_socket_ancillary_data", issue = "none")]
182182
#[derive(Clone)]
183-
pub struct UCred(libc::ucred);
183+
pub struct SocketCred(libc::ucred);
184184

185185
#[cfg(any(
186186
doc,
@@ -196,13 +196,13 @@ pub struct UCred(libc::ucred);
196196
target_os = "openbsd",
197197
target_env = "uclibc",
198198
))]
199-
impl UCred {
199+
impl SocketCred {
200200
/// Create a Unix credential struct.
201201
///
202202
/// PID, UID and GID is set to 0.
203203
#[unstable(feature = "unix_socket_ancillary_data", issue = "none")]
204-
pub fn new() -> UCred {
205-
UCred(libc::ucred { pid: 0, uid: 0, gid: 0 })
204+
pub fn new() -> SocketCred {
205+
SocketCred(libc::ucred { pid: 0, uid: 0, gid: 0 })
206206
}
207207

208208
/// Set the PID.
@@ -293,10 +293,10 @@ pub struct ScmCredentials<'a>(AncillaryDataIter<'a, libc::ucred>);
293293
))]
294294
#[unstable(feature = "unix_socket_ancillary_data", issue = "none")]
295295
impl<'a> Iterator for ScmCredentials<'a> {
296-
type Item = UCred;
296+
type Item = SocketCred;
297297

298-
fn next(&mut self) -> Option<UCred> {
299-
Some(UCred(self.0.next()?))
298+
fn next(&mut self) -> Option<SocketCred> {
299+
Some(SocketCred(self.0.next()?))
300300
}
301301
}
302302

@@ -606,7 +606,7 @@ impl<'a> SocketAncillary<'a> {
606606
target_env = "uclibc",
607607
))]
608608
#[unstable(feature = "unix_socket_ancillary_data", issue = "none")]
609-
pub fn add_creds(&mut self, creds: &[UCred]) -> bool {
609+
pub fn add_creds(&mut self, creds: &[SocketCred]) -> bool {
610610
self.truncated = false;
611611
add_to_ancillary_data(
612612
&mut self.buffer,

library/std/src/sys/unix/ext/net/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ fn test_send_vectored_with_ancillary_to_unix_datagram() {
519519

520520
let mut ancillary1_buffer = [0; 128];
521521
let mut ancillary1 = SocketAncillary::new(&mut ancillary1_buffer[..]);
522-
let mut cred1 = UCred::new();
522+
let mut cred1 = SocketCred::new();
523523
cred1.set_pid(getpid());
524524
cred1.set_uid(getuid());
525525
cred1.set_gid(getgid());

0 commit comments

Comments
 (0)