Hi Doug,

Not that this is much a improvement but thought youd like to be informed
of it. I usually try to refrain whenever possible from calling utilities
like nice(1) or renice(1)  and let processes inherit their niceness be
inherited from the parent process. This patch does that very thing for
portmaster.


Regards,

-- 

 J. Hellenthal

--- portmaster.orig	2011-04-12 04:05:16.000000000 -0400
+++ portmaster	2011-04-12 04:15:54.000000000 -0400
@@ -3,6 +3,7 @@
 # Copyright (c) 2005-2011 Douglas Barton, All rights reserved
 # Please see detailed copyright below
 
+renice -n 10 -p $$
 trap trap_exit INT
 
 # Initialize crucial values for the parent, and export them for the children
@@ -269,7 +270,7 @@
 pm_kill   () { /bin/kill $* >/dev/null 2>/dev/null; }
 pm_make   () { ( unset -v CUR_DEPS INSTALLED_LIST PM_DEPTH build_l;
 		 unset -v MASTER_RB_LIST;
-		 /usr/bin/nice /usr/bin/make $PM_MAKE_ARGS $*; ); }
+		 /usr/bin/make $PM_MAKE_ARGS $*; ); }
 pm_make_b () { /usr/bin/make $PM_MAKE_ARGS BEFOREPORTMK=bpm $*; }
 pm_mktemp () { /usr/bin/mktemp -t f-${PM_PARENT_PID}-$1 ||
 		fail "mktemp for $1 failed"; }
@@ -281,7 +282,7 @@
 pm_install_s      () { $PM_SU_CMD /usr/bin/install -p -o root -g wheel -m 644 $1 $2; }
 pm_make_s         () { ( unset -v CUR_DEPS INSTALLED_LIST PM_DEPTH build_l;
 			 unset -v MASTER_RB_LIST;
-			 $PM_SU_CMD /usr/bin/nice /usr/bin/make $PM_MAKE_ARGS $*; ); }
+			 $PM_SU_CMD /usr/bin/make $PM_MAKE_ARGS $*; ); }
 pm_mkdir_s        () { $PM_SU_CMD /bin/mkdir -p $1; }
 pm_pkg_delete_s   () { $PM_SU_CMD /usr/sbin/pkg_delete $*; }
 pm_rm_s           () { $PM_SU_CMD /bin/rm $*; }

Attachment: pgpQGmf60Csd5.pgp
Description: PGP signature

Reply via email to