mirror of
https://gitlab.com/buildroot.org/buildroot.git
synced 2026-09-10 00:04:06 -09:00
package/linux-tools/S10hyperv: fix invalid return value
In both start() and stop(), ret is only assigned on failure. When hypervkvpd starts or stops successfully, return "$ret" expands to an empty string and causes: /etc/init.d/S10hyperv: return: line 31: Illegal number: Those double quotes were added in Buildroot commit [1], to fix a new ShellCheck warning at that time. This was not a complete fix. Only removing the double quote would reintroduce the ShellCheck warning. This would also reintroduce a check-package error. Since a bare return is equivalent to a "return 0", this commit also initializes with ret=0. Doing so will tell ShellCheck "ret" is an integer. Therefore, the ShellCheck warning will no longer be reported. This commit fixes the invalid return value by removing the double quotes and initialzing "ret=0". [1]c4173d8b08Signed-off-by: Benjamin DeCamp <benjamin8532@protonmail.com> [Julien: - add "ret=0" initialization in script to fix check-package error - add extra info in the commit log ] Signed-off-by: Julien Olivain <ju.o@free.fr> (cherry picked from commit667335cd18) Signed-off-by: Titouan Christophe <titouan.christophe@mind.be>
This commit is contained in:
committed by
Titouan Christophe
parent
cdb6b23824
commit
4f1d3b786d
@@ -24,11 +24,12 @@ start_one() {
|
||||
}
|
||||
|
||||
start() {
|
||||
ret=0
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
for prog in ${PROGS}; do
|
||||
start_one "${prog}" || ret=$?
|
||||
done
|
||||
return "$ret"
|
||||
return $ret
|
||||
}
|
||||
|
||||
stop_one() {
|
||||
@@ -45,11 +46,12 @@ stop_one() {
|
||||
}
|
||||
|
||||
stop() {
|
||||
ret=0
|
||||
# shellcheck disable=SC2086 # we need the word splitting
|
||||
for prog in ${PROGS}; do
|
||||
stop_one "${prog}" || ret=$?
|
||||
done
|
||||
return "$ret"
|
||||
return $ret
|
||||
}
|
||||
|
||||
restart() {
|
||||
|
||||
Reference in New Issue
Block a user