From 62a98913cf209ddd06fd80f9fcf45a0cc31a43a2 Mon Sep 17 00:00:00 2001 From: Matthias Kruk Date: Sun, 4 Apr 2021 07:35:14 +0900 Subject: [PATCH] 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. --- include/acpi/ac.sh | 2 +- include/acpi/battery.sh | 2 +- include/sem.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) 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 } -- 2.47.3