From: Matthias Kruk Date: Sat, 3 Apr 2021 22:35:14 +0000 (+0900) Subject: sem,acpi/*: Export global variables X-Git-Url: https://git.corax.cc/?a=commitdiff_plain;h=62a98913cf209ddd06fd80f9fcf45a0cc31a43a2;p=toolbox sem,acpi/*: Export global variables Global variables declared in the sem and acpi/* modules are not exported, causing them to become invisible in child processes. This effectively makes it impossible to use these modules in scripts that fork themselves to the background. This commit changes the declarations so that the variables are exported. --- diff --git a/include/acpi/ac.sh b/include/acpi/ac.sh index 4ada7ba..c1da36e 100644 --- a/include/acpi/ac.sh +++ b/include/acpi/ac.sh @@ -1,7 +1,7 @@ #!/bin/bash __init() { - declare -gr __acpi_ac_path="/sys/class/power_supply" + declare -xgr __acpi_ac_path="/sys/class/power_supply" return 0 } diff --git a/include/acpi/battery.sh b/include/acpi/battery.sh index 9f0386f..4a39e0c 100644 --- a/include/acpi/battery.sh +++ b/include/acpi/battery.sh @@ -1,7 +1,7 @@ #!/bin/bash __init() { - declare -gr __acpi_battery_path="/sys/class/power_supply" + declare -xgr __acpi_battery_path="/sys/class/power_supply" return 0 } diff --git a/include/sem.sh b/include/sem.sh index 7b48ebb..31df8e9 100644 --- a/include/sem.sh +++ b/include/sem.sh @@ -10,7 +10,7 @@ __init() { return 1 fi - declare -gr __sem_path="$TOOLBOX_HOME/sem" + declare -xgr __sem_path="$TOOLBOX_HOME/sem" return 0 }