Skip to content

Commit 6a22042

Browse files
committed
alsa: Rename state files
Paths removed from $SCRIPT_NAME when creating and using state files. Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
1 parent 9e44b14 commit 6a22042

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

case-lib/hijack.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ function func_exit_handler()
186186
}
187187

188188
# Restore ALSA settings after execution if state file exists
189-
if [ -f /var/tmp/"${SCRIPT_NAME}".state ]; then
189+
if [ -f /var/tmp/"${SCRIPT_NAME##*/}".state ]; then
190190
restore_alsa_state
191191
fi
192192

case-lib/lib.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,11 +1193,11 @@ perf_analyze()
11931193
# Couple with save_machine_state.
11941194
restore_alsa_state()
11951195
{
1196-
dlogi "restore_alsa_state called in ${SCRIPT_NAME}"
1197-
if [ -f /var/tmp/"${SCRIPT_NAME}".state ]; then
1196+
dlogi "restore_alsa_state called in ${SCRIPT_NAME##*/}"
1197+
if [ -f /var/tmp/"${SCRIPT_NAME##*/}".state ]; then
11981198
dlogi "restore_alsa_state found a relevant state file."
1199-
alsactl restore --file /var/tmp/"${SCRIPT_NAME}".state --pedantic --no-ucm --no-init-fallback || dlogi "alsactl state restoration failed!"
1200-
rm /var/tmp/"${SCRIPT_NAME}".state || dlogi "Old state file removal failed!"
1199+
alsactl restore --file /var/tmp/"${SCRIPT_NAME##*/}".state --pedantic --no-ucm --no-init-fallback || dlogi "alsactl state restoration failed!"
1200+
rm /var/tmp/"${SCRIPT_NAME##*/}".state || dlogi "Old state file removal failed!"
12011201
fi
12021202
}
12031203

@@ -1208,6 +1208,6 @@ restore_alsa_state()
12081208
# on an exit signal inside func_exit_handler.
12091209
save_alsa_state()
12101210
{
1211-
dlogi "save_alsa_state called in ${SCRIPT_NAME}"
1212-
alsactl store --file /var/tmp/"${SCRIPT_NAME}".state || dlogi "alsactl state storage failed!"
1211+
dlogi "save_alsa_state called in ${SCRIPT_NAME##*/}"
1212+
alsactl store --file /var/tmp/"${SCRIPT_NAME##*/}".state || dlogi "alsactl state storage failed!"
12131213
}

0 commit comments

Comments
 (0)