@@ -4,7 +4,7 @@ pub struct GroupEntry {
44 pub gid : nix:: unistd:: Gid ,
55}
66
7- #[ cfg( any( target_os = "linux" , target_os= "freebsd" ) ) ]
7+ #[ cfg( any( target_os = "linux" , target_os = "freebsd" ) ) ]
88fn make_group_from_libc ( groupname : & str , group : & libc:: group ) -> Result < GroupEntry , String > {
99 let gid = nix:: unistd:: Gid :: from_raw ( group. gr_gid ) ;
1010 let pw = if !group. gr_passwd . is_null ( ) {
@@ -45,7 +45,7 @@ fn getgrnam(groupname: &str) -> Result<GroupEntry, String> {
4545 make_group_from_libc ( groupname, & res)
4646}
4747
48- #[ cfg( any( target_os = "linux" , target_os= "freebsd" ) ) ]
48+ #[ cfg( any( target_os = "linux" , target_os = "freebsd" ) ) ]
4949pub fn getgrnam_r ( groupname : & str ) -> Result < GroupEntry , String > {
5050 let username_i8 = groupname. bytes ( ) . map ( |x| x as i8 ) . collect :: < Vec < _ > > ( ) ;
5151 let pointer: * const i8 = username_i8. as_ptr ( ) ;
@@ -92,7 +92,7 @@ pub fn getgrnam_r(groupname: &str) -> Result<GroupEntry, String> {
9292 }
9393}
9494
95- #[ cfg( not( any( target_os = "linux" , target_os= "freebsd" ) ) ) ]
95+ #[ cfg( not( any( target_os = "linux" , target_os = "freebsd" ) ) ) ]
9696pub fn getgrnam_r ( _groupname : & str ) -> Result < GroupEntry , String > {
9797 compile_error ! ( "getgrnam_r is not yet implemented for this platform" ) ;
9898}
0 commit comments