Bug 58954 - functions file: code typo in pidofproc() function
functions file: code typo in pidofproc() function
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
7.2
i386 Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
Brock Organ
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2002-01-28 10:27 EST by rm0
Modified: 2014-03-16 22:25 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2002-01-28 10:28:06 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description rm0 2002-01-28 10:27:59 EST
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-06 23:11:22 EST
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.