]> git.corax.cc Git - toolbox/commitdiff
sem,acpi/*: Export global variables
authorMatthias Kruk <m@m10k.eu>
Sat, 3 Apr 2021 22:35:14 +0000 (07:35 +0900)
committerMatthias Kruk <m@m10k.eu>
Sat, 3 Apr 2021 22:35:14 +0000 (07:35 +0900)
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
include/acpi/battery.sh
include/sem.sh

index 4ada7ba3ceee7a534923186db8fd9fa6d4063063..c1da36eb11b3bf6ce9a177dff61a0ff11bd64a56 100644 (file)
@@ -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
 }
index 9f0386f7fd078add728e26c8634b5a1f23aea8d0..4a39e0c6f8e546a3301c7963db524d1529fd74a1 100644 (file)
@@ -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
 }
index 7b48ebbc22d087abdea2c8f643dd9b217978eb52..31df8e9cc524c48dacf3fa44714ec58d2e02377e 100644 (file)
@@ -10,7 +10,7 @@ __init() {
                return 1
        fi
 
-       declare -gr __sem_path="$TOOLBOX_HOME/sem"
+       declare -xgr __sem_path="$TOOLBOX_HOME/sem"
 
        return 0
 }