Portability bug in genbki.sh --> initdb hangup

Started by Andreas Zeugswetterover 27 years ago2 messages
#1Andreas Zeugswetter
andreas.zeugswetter@telecom.at

Can someone please apply this portability patch to genbki.sh ? (Mark or
Bruce?)
It fixes a problem when cpp gives a warning when precompiling /dev/null
like:
"/dev/null", line 1: 1506-229 (W) File is empty.
This leads to a hangup when doing the description load during initdb,
since stderr also ends up in the global1.description and
local1_template1.description

stderr has to be redirected to /dev/null:

*** genbki.sh.ori	Tue Aug 21 18:18:03 1998
--- genbki.sh	Tue Aug 25 
10:32:19 1998
***************
*** 24,30 ****

/tmp/genbki.tmp

  PATH=$PATH:/lib:/usr/ccs/lib:/usr/ccs/lbin		# to find cpp
! cpp 
/dev/null >/dev/null
  if [ "$?" -ne 0 ]
  then	echo "Can't find cpp. 
 Exiting." 1>&2
  	exit 1
--- 24,30 ----

/tmp/genbki.tmp

PATH=$PATH:/lib:/usr/ccs/lib:/usr/ccs/lbin # to find cpp
! cpp
/dev/null >/dev/null 2>&1
if [ "$?" -ne 0 ]
then echo "Can't find cpp.
Exiting." 1>&2
exit 1

#2Bruce Momjian
maillist@candle.pha.pa.us
In reply to: Andreas Zeugswetter (#1)
Re: [HACKERS] Portability bug in genbki.sh --> initdb hangup

Applied. The patch you sent had an unusual wrap problem, but I added
the 2>&1.

Can someone please apply this portability patch to genbki.sh ? (Mark or
Bruce?)
It fixes a problem when cpp gives a warning when precompiling /dev/null
like:
"/dev/null", line 1: 1506-229 (W) File is empty.
This leads to a hangup when doing the description load during initdb,
since stderr also ends up in the global1.description and
local1_template1.description

stderr has to be redirected to /dev/null:

*** genbki.sh.ori	Tue Aug 21 18:18:03 1998
--- genbki.sh	Tue Aug 25 
10:32:19 1998
***************
*** 24,30 ****

/tmp/genbki.tmp

PATH=$PATH:/lib:/usr/ccs/lib:/usr/ccs/lbin		# to find cpp
! cpp 
/dev/null >/dev/null
if [ "$?" -ne 0 ]
then	echo "Can't find cpp. 
Exiting." 1>&2
exit 1
--- 24,30 ----

/tmp/genbki.tmp

PATH=$PATH:/lib:/usr/ccs/lib:/usr/ccs/lbin # to find cpp
! cpp
/dev/null >/dev/null 2>&1
if [ "$?" -ne 0 ]
then echo "Can't find cpp.
Exiting." 1>&2
exit 1

-- 
Bruce Momjian                          |  830 Blythe Avenue
maillist@candle.pha.pa.us              |  Drexel Hill, Pennsylvania 19026
  +  If your life is a hard drive,     |  (610) 353-9879(w)
  +  Christ can be your backup.        |  (610) 853-3000(h)