File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -907,13 +907,18 @@ ocf_unique_rundir()
907907# NB: FD 9 may be used for tracing with bash >= v4 in case
908908# OCF_TRACE_FILE is set to a path.
909909#
910- ocf_is_bash4 () {
910+ ocf_bash_has_xtracefd () {
911911 echo "$SHELL" | grep bash > /dev/null &&
912- [ ${BASH_VERSINFO[0]} = "4" ]
912+ [ ${BASH_VERSINFO[0]} -ge 4 ]
913+ }
914+ # for backwards compatibility
915+ ocf_is_bash4() {
916+ ocf_bash_has_xtracefd
917+ return $?
913918}
914919ocf_trace_redirect_to_file() {
915920 local dest=$1
916- if ocf_is_bash4 ; then
921+ if ocf_bash_has_xtracefd ; then
917922 exec 9>$dest
918923 BASH_XTRACEFD=9
919924 else
@@ -922,7 +927,7 @@ ocf_trace_redirect_to_file() {
922927}
923928ocf_trace_redirect_to_fd() {
924929 local fd=$1
925- if ocf_is_bash4 ; then
930+ if ocf_bash_has_xtracefd ; then
926931 BASH_XTRACEFD=$fd
927932 else
928933 exec 2>&$fd
You can’t perform that action at this time.
0 commit comments