From 0169ee0d07325ed8f7a13b375addcefb90cf7cf9 Mon Sep 17 00:00:00 2001 From: Michael Pyne Date: Sat, 5 Mar 2011 18:30:59 -0500 Subject: [PATCH] Use less magic constants. By using POSIX::nice (since POSIX is already in use anyways) I don't have to declare a random PRIO_PROCESS constant to use the Perl setpriority built-in. --- kdesrc-build | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/kdesrc-build b/kdesrc-build index c09bc00..e304cb3 100755 --- a/kdesrc-build +++ b/kdesrc-build @@ -746,10 +746,6 @@ my ($RED, $GREEN, $YELLOW, $NORMAL, $BOLD) = ("") x 5; # Subroutine definitions -# I swear Perl must be the only language where the docs tell you to use a -# constant that you'll never find exported without some module from CPAN. -use constant PRIO_PROCESS => 0; - # I'm lazy and would rather write in shorthand for the colors. This sub # allows me to do so. Put it right up top to stifle Perl warnings. sub clr($) @@ -3974,7 +3970,7 @@ sub set_debug_colors sub setup_operating_environment { # Set the process priority - setpriority PRIO_PROCESS, 0, get_option('global', 'niceness'); + POSIX::nice(get_option('global', 'niceness')); # Set the IO priority if available. if(get_option('global', 'use-idle-io-priority')) {