Skip to content

Commit be782f3

Browse files
committed
remove unused loop in macos
1 parent a878ffc commit be782f3

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

vm/src/stdlib/os.rs

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -279,19 +279,17 @@ fn getgroups() -> nix::Result<Vec<Gid>> {
279279
use std::ptr;
280280
let ret = unsafe { libc::getgroups(0, ptr::null_mut()) };
281281
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+
};
289288

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+
})
295293
}
296294

297295
#[cfg(any(target_os = "linux", target_os = "android"))]

0 commit comments

Comments
 (0)