File tree Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Expand file tree Collapse file tree 1 file changed +10
-12
lines changed Original file line number Diff line number Diff line change @@ -279,19 +279,17 @@ fn getgroups() -> nix::Result<Vec<Gid>> {
279
279
use std:: ptr;
280
280
let ret = unsafe { libc:: getgroups ( 0 , ptr:: null_mut ( ) ) } ;
281
281
let mut groups = Vec :: < Gid > :: with_capacity ( Errno :: result ( ret) ? as usize ) ;
282
- loop {
283
- let ret = unsafe {
284
- libc:: getgroups (
285
- groups. capacity ( ) as c_int ,
286
- groups. as_mut_ptr ( ) as * mut gid_t ,
287
- )
288
- } ;
282
+ let ret = unsafe {
283
+ libc:: getgroups (
284
+ groups. capacity ( ) as c_int ,
285
+ groups. as_mut_ptr ( ) as * mut gid_t ,
286
+ )
287
+ } ;
289
288
290
- return Errno :: result ( ret) . map ( |s| {
291
- unsafe { groups. set_len ( s as usize ) } ;
292
- groups
293
- } ) ;
294
- }
289
+ Errno :: result ( ret) . map ( |s| {
290
+ unsafe { groups. set_len ( s as usize ) } ;
291
+ groups
292
+ } )
295
293
}
296
294
297
295
#[ cfg( any( target_os = "linux" , target_os = "android" ) ) ]
You can’t perform that action at this time.
0 commit comments