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 @@ -11,7 +11,7 @@ use std::{collections::HashSet, io};
1111use clap:: { arg, Arg , ArgAction , ArgMatches } ;
1212use regex:: Regex ;
1313#[ cfg( unix) ]
14- use uucore:: libc :: { getpgrp, getsid} ;
14+ use uucore:: process :: { getpgrp, getsid} ;
1515#[ cfg( unix) ]
1616use uucore:: {
1717 display:: Quotable ,
@@ -82,14 +82,8 @@ pub fn get_match_settings(matches: &ArgMatches) -> UResult<Settings> {
8282 . get_many :: < u32 > ( "group" )
8383 . map ( |ids| ids. cloned ( ) . collect ( ) ) ,
8484 pgroup : matches. get_many :: < u64 > ( "pgroup" ) . map ( |xs| {
85- xs. map ( |pg| {
86- if * pg == 0 {
87- unsafe { getpgrp ( ) as u64 }
88- } else {
89- * pg
90- }
91- } )
92- . collect ( )
85+ xs. map ( |pg| if * pg == 0 { getpgrp ( ) as u64 } else { * pg } )
86+ . collect ( )
9387 } ) ,
9488 session : matches. get_many :: < u64 > ( "session" ) . map ( |xs| {
9589 xs. map ( |sid| {
@@ -343,7 +337,7 @@ pub fn grp2gid(_name: &str) -> io::Result<u32> {
343337///
344338/// Dummy implementation for unsupported platforms.
345339#[ cfg( not( unix) ) ]
346- pub unsafe fn getpgrp ( ) -> u32 {
340+ pub fn getpgrp ( ) -> u32 {
347341 panic ! ( "unsupported on this platform" ) ;
348342}
349343
You can’t perform that action at this time.
0 commit comments