Bug 58954 - functions file: code typo in pidofproc() function
Summary: functions file: code typo in pidofproc() function
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: initscripts
Version: 7.2
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bill Nottingham
QA Contact: Brock Organ
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-01-28 15:27 UTC by rm0
Modified: 2014-03-17 02:25 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-01-28 15:28:06 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2002:022 0 normal SHIPPED_LIVE New initscripts packages available for Red Hat Linux 7.2 2002-02-06 05:00:00 UTC

Description rm0 2002-01-28 15:27:59 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:0.9.7) Gecko/20011221

Description of problem:
The bash construct ${varname:-} is used all over the file
but in one occurrence in the pidofproc funcion the 
':' and '-'  chars have their positions swapped (demons-
trated with a small patch fixing the problem):

+++ functions   Mon Jan 28 12:00:22 2002
@@ -250,7 +250,7 @@
                for p in $line ; do
                       [ -z "${p//[0-9]/}" -a -d /proc/$p ] && pid="$pid $p"
                done
-               if [ -n "${pid-:}" ] ; then
+               if [ -n "${pid:-}" ] ; then
                        echo $pid
                        return 0
                fi


Version-Release number of selected component (if applicable):
initscripts-6.40-1

How reproducible:
Always

Steps to Reproduce:
1. $ less /etc/init.d/functions
2. search by -: by typing '/-:'
3. the line spotted is the bug
	

Actual Results:  
               if [ -n "${pid-:}" ] ; then



Expected Results:  should read
               if [ -n "${pid:-}" ] ; then

Additional info:

See (related) bugs #56174 and #57526

Comment 1 Bill Nottingham 2002-02-07 04:11:22 UTC
Eep. Fixed in CVS, will be in 6.53-1.


Note You need to log in before you can comment on or make changes to this bug.