]> git.lizzy.rs Git - rust.git/commitdiff
libstd needs update for pending libc change
authorShawn Walker-Salas <shawn.walker@oracle.com>
Thu, 16 Feb 2017 01:48:20 +0000 (17:48 -0800)
committerShawn Walker-Salas <shawn.walker@oracle.com>
Thu, 16 Feb 2017 01:52:24 +0000 (17:52 -0800)
Fixes #39868

src/libstd/sys/unix/os.rs

index 6992a17832e413690eae495c362f2e2bbee825f5..1dbfa640d52519c915ee5350605914e794189b1b 100644 (file)
@@ -483,7 +483,6 @@ unsafe fn fallback() -> Option<OsString> { None }
                   target_os = "nacl",
                   target_os = "emscripten")))]
     unsafe fn fallback() -> Option<OsString> {
-        #[cfg(not(target_os = "solaris"))]
         unsafe fn getpwduid_r(me: libc::uid_t, passwd: &mut libc::passwd,
                               buf: &mut Vec<c_char>) -> Option<()> {
             let mut result = ptr::null_mut();
@@ -495,16 +494,6 @@ unsafe fn getpwduid_r(me: libc::uid_t, passwd: &mut libc::passwd,
             }
         }
 
-        #[cfg(target_os = "solaris")]
-        unsafe fn getpwduid_r(me: libc::uid_t, passwd: &mut libc::passwd,
-                              buf: &mut Vec<c_char>) -> Option<()> {
-            // getpwuid_r semantics is different on Illumos/Solaris:
-            // http://illumos.org/man/3c/getpwuid_r
-            let result = libc::getpwuid_r(me, passwd, buf.as_mut_ptr(),
-                                          buf.capacity());
-            if result.is_null() { None } else { Some(()) }
-        }
-
         let amt = match libc::sysconf(libc::_SC_GETPW_R_SIZE_MAX) {
             n if n < 0 => 512 as usize,
             n => n as usize,