Skip to content

Commit d5f070b

Browse files
committed
Remove target_os, which does not have SO_PASSCRED constant in libc
1 parent 3806579 commit d5f070b

File tree

3 files changed

+5
-56
lines changed

3 files changed

+5
-56
lines changed

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

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -748,20 +748,7 @@ impl UnixDatagram {
748748
/// Ok(())
749749
/// }
750750
/// ```
751-
#[cfg(any(
752-
doc,
753-
target_os = "android",
754-
target_os = "dragonfly",
755-
target_os = "emscripten",
756-
target_os = "freebsd",
757-
target_os = "fuchsia",
758-
target_os = "ios",
759-
target_os = "linux",
760-
target_os = "macos",
761-
target_os = "netbsd",
762-
target_os = "openbsd",
763-
target_env = "uclibc",
764-
))]
751+
#[cfg(any(doc, target_os = "android", target_os = "emscripten", target_os = "linux",))]
765752
#[unstable(feature = "unix_socket_ancillary_data", issue = "76915")]
766753
pub fn set_passcred(&self, passcred: bool) -> io::Result<()> {
767754
self.0.set_passcred(passcred)
@@ -773,20 +760,7 @@ impl UnixDatagram {
773760
/// Get the socket option `SO_PASSCRED`.
774761
///
775762
/// [`set_passcred`]: UnixDatagram::set_passcred
776-
#[cfg(any(
777-
doc,
778-
target_os = "android",
779-
target_os = "dragonfly",
780-
target_os = "emscripten",
781-
target_os = "freebsd",
782-
target_os = "fuchsia",
783-
target_os = "ios",
784-
target_os = "linux",
785-
target_os = "macos",
786-
target_os = "netbsd",
787-
target_os = "openbsd",
788-
target_env = "uclibc",
789-
))]
763+
#[cfg(any(doc, target_os = "android", target_os = "emscripten", target_os = "linux",))]
790764
#[unstable(feature = "unix_socket_ancillary_data", issue = "76915")]
791765
pub fn passcred(&self) -> io::Result<bool> {
792766
self.0.passcred()

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

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -375,20 +375,7 @@ impl UnixStream {
375375
/// Ok(())
376376
/// }
377377
/// ```
378-
#[cfg(any(
379-
doc,
380-
target_os = "android",
381-
target_os = "dragonfly",
382-
target_os = "emscripten",
383-
target_os = "freebsd",
384-
target_os = "fuchsia",
385-
target_os = "ios",
386-
target_os = "linux",
387-
target_os = "macos",
388-
target_os = "netbsd",
389-
target_os = "openbsd",
390-
target_env = "uclibc",
391-
))]
378+
#[cfg(any(doc, target_os = "android", target_os = "emscripten", target_os = "linux",))]
392379
#[unstable(feature = "unix_socket_ancillary_data", issue = "76915")]
393380
pub fn set_passcred(&self, passcred: bool) -> io::Result<()> {
394381
self.0.set_passcred(passcred)
@@ -400,20 +387,7 @@ impl UnixStream {
400387
/// Get the socket option `SO_PASSCRED`.
401388
///
402389
/// [`set_passcred`]: UnixStream::set_passcred
403-
#[cfg(any(
404-
doc,
405-
target_os = "android",
406-
target_os = "dragonfly",
407-
target_os = "emscripten",
408-
target_os = "freebsd",
409-
target_os = "fuchsia",
410-
target_os = "ios",
411-
target_os = "linux",
412-
target_os = "macos",
413-
target_os = "netbsd",
414-
target_os = "openbsd",
415-
target_env = "uclibc",
416-
))]
390+
#[cfg(any(doc, target_os = "android", target_os = "emscripten", target_os = "linux",))]
417391
#[unstable(feature = "unix_socket_ancillary_data", issue = "76915")]
418392
pub fn passcred(&self) -> io::Result<bool> {
419393
self.0.passcred()

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ fn test_send_vectored_fds_unix_stream() {
491491
}
492492
}
493493

494+
#[cfg(any(test, target_os = "android", target_os = "emscripten", target_os = "linux",))]
494495
#[test]
495496
fn test_send_vectored_with_ancillary_to_unix_datagram() {
496497
fn getpid() -> libc::pid_t {

0 commit comments

Comments
 (0)