File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Expand file tree Collapse file tree 1 file changed +4
-10
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 ,
@@ -89,14 +89,8 @@ pub fn get_match_settings(matches: &ArgMatches) -> UResult<Settings> {
8989 . get_many :: < u32 > ( "group" )
9090 . map ( |ids| ids. cloned ( ) . collect ( ) ) ,
9191 pgroup : matches. get_many :: < u64 > ( "pgroup" ) . map ( |xs| {
92- xs. map ( |pg| {
93- if * pg == 0 {
94- unsafe { getpgrp ( ) as u64 }
95- } else {
96- * pg
97- }
98- } )
99- . collect ( )
92+ xs. map ( |pg| if * pg == 0 { getpgrp ( ) as u64 } else { * pg } )
93+ . collect ( )
10094 } ) ,
10195 session : matches. get_many :: < u64 > ( "session" ) . map ( |xs| {
10296 xs. map ( |sid| {
@@ -390,7 +384,7 @@ pub fn grp2gid(_name: &str) -> io::Result<u32> {
390384///
391385/// Dummy implementation for unsupported platforms.
392386#[ cfg( not( unix) ) ]
393- pub unsafe fn getpgrp ( ) -> u32 {
387+ pub fn getpgrp ( ) -> u32 {
394388 panic ! ( "unsupported on this platform" ) ;
395389}
396390
You can’t perform that action at this time.
0 commit comments