File tree Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Expand file tree Collapse file tree 1 file changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ use std::{collections::HashSet, io};
1313use clap:: { arg, Arg , ArgAction , ArgMatches } ;
1414use regex:: Regex ;
1515#[ cfg( unix) ]
16- use uucore:: libc :: { getpgrp, getsid} ;
16+ use uucore:: process :: { getpgrp, getsid} ;
1717#[ cfg( unix) ]
1818use uucore:: {
1919 display:: Quotable ,
@@ -91,19 +91,13 @@ pub fn get_match_settings(matches: &ArgMatches) -> UResult<Settings> {
9191 . get_many :: < u32 > ( "group" )
9292 . map ( |ids| ids. cloned ( ) . collect ( ) ) ,
9393 pgroup : matches. get_many :: < u64 > ( "pgroup" ) . map ( |xs| {
94- xs. map ( |pg| {
95- if * pg == 0 {
96- unsafe { getpgrp ( ) as u64 }
97- } else {
98- * pg
99- }
100- } )
101- . collect ( )
94+ xs. map ( |pg| if * pg == 0 { getpgrp ( ) as u64 } else { * pg } )
95+ . collect ( )
10296 } ) ,
10397 session : matches. get_many :: < u64 > ( "session" ) . map ( |xs| {
10498 xs. map ( |sid| {
10599 if * sid == 0 {
106- unsafe { getsid ( 0 ) as u64 }
100+ getsid ( 0 ) . unwrap ( ) as u64
107101 } else {
108102 * sid
109103 }
@@ -445,7 +439,7 @@ pub fn grp2gid(_name: &str) -> io::Result<u32> {
445439///
446440/// Dummy implementation for unsupported platforms.
447441#[ cfg( not( unix) ) ]
448- pub unsafe fn getpgrp ( ) -> u32 {
442+ pub fn getpgrp ( ) -> u32 {
449443 panic ! ( "unsupported on this platform" ) ;
450444}
451445
You can’t perform that action at this time.
0 commit comments