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.
#!/bin/bash
__init() {
- declare -gr __acpi_ac_path="/sys/class/power_supply"
+ declare -xgr __acpi_ac_path="/sys/class/power_supply"
return 0
}
#!/bin/bash
__init() {
- declare -gr __acpi_battery_path="/sys/class/power_supply"
+ declare -xgr __acpi_battery_path="/sys/class/power_supply"
return 0
}
return 1
fi
- declare -gr __sem_path="$TOOLBOX_HOME/sem"
+ declare -xgr __sem_path="$TOOLBOX_HOME/sem"
return 0
}