Skip to content

Commit 6a1d7a8

Browse files
committed
return None if setregid success
1 parent f5a0bcc commit 6a1d7a8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

vm/src/stdlib/os.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,7 +1530,7 @@ fn os_setresgid(rgid: u32, egid: u32, sgid: u32, vm: &VirtualMachine) -> PyResul
15301530
Gid::from_raw(egid),
15311531
Gid::from_raw(sgid),
15321532
)
1533-
.map_err(|err| convert_nix_error(vm, err));
1533+
.map_err(|err| convert_nix_error(vm, err))
15341534
}
15351535

15361536
// cfg from nix
@@ -1540,10 +1540,10 @@ fn os_setresgid(rgid: u32, egid: u32, sgid: u32, vm: &VirtualMachine) -> PyResul
15401540
target_os = "linux",
15411541
target_os = "openbsd"
15421542
))]
1543-
fn os_setregid(rgid: u32, egid: u32, vm: &VirtualMachine) -> PyResult<(i32)> {
1543+
fn os_setregid(rgid: u32, egid: u32, vm: &VirtualMachine) -> PyResult<()> {
15441544
let ret = unsafe { libc::setregid(rgid, egid) };
15451545
if ret == 0 {
1546-
Ok(0)
1546+
Ok(())
15471547
} else {
15481548
Err(errno_err(vm))
15491549
}

0 commit comments

Comments
 (0)