[oe-commits] [openembedded-core] 14/19: bluez5: Fix status subcommand of init script

git at git.openembedded.org git at git.openembedded.org
Sat Jan 12 16:23:10 UTC 2019

This is an automated email from the git hooks/post-receive script.

rpurdie pushed a commit to branch master-next
in repository openembedded-core.

commit 75ed9e6730e733280e3c735415d6f311bfe0eb11
Author: David Frey <dpfrey at gmail.com>
AuthorDate: Thu Jan 10 11:23:52 2019 -0800

    bluez5: Fix status subcommand of init script
    Update the bluez5 init script to resolve an issue where the status
    subcommand would exit without printing any message if bluez was not
    running. The early exit was caused by the fact that the init script has
    "set -e". When "pidof ${DAEMON} >/dev/null" is executed, the script
    terminates immediately if bluez isn't running because pidof returns a
    non-zero result. The fixed version does not suffer from this issue and
    makes use of the "status" function from the functions library.
    Signed-off-by: David Frey <dpfrey at gmail.com>
    Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>
 meta/recipes-connectivity/bluez5/bluez5/init | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/meta/recipes-connectivity/bluez5/bluez5/init b/meta/recipes-connectivity/bluez5/bluez5/init
index d7972f2..ca9fa18 100644
--- a/meta/recipes-connectivity/bluez5/bluez5/init
+++ b/meta/recipes-connectivity/bluez5/bluez5/init
@@ -1,5 +1,8 @@
+# Source function library
+. /etc/init.d/functions
@@ -44,14 +47,7 @@ case $1 in
 	$0 start
-	 pidof ${DAEMON} >/dev/null
-	 status=$?
-        if [ $status -eq 0 ]; then
-                 echo "bluetooth is running."
-        else
-                echo "bluetooth is not running"
-        fi
-        exit $status
+	status ${DAEMON} || exit $?

To stop receiving notification emails like this one, please contact
the administrator of this repository.

More information about the Openembedded-commits mailing list