Compare commits

..

No commits in common. "dc8b8a535e9167bdd2460f060262cfba6467df2d" and "40fe6ae015286fdd7778200000a0cbc9d5d8e8c2" have entirely different histories.

View file

@ -2,7 +2,7 @@
#
# Typically used in combination with the MSX-DOS 'omsxctl.com' utility.
#
# Adds two commands to openMSX;
# Adds two environment variables and two commands to openMSX;
#
# 'fail_after timeout [timeunit] [fail_id] [fail_code]'
# Schedules an openMSX exit after the timeout.
@ -54,26 +54,17 @@ proc fail_after { timeout {time_unit "time"} {fail_id "fail_after"} {fail_code 2
puts stderr "error: $err_msg"
fail_after_exit fail_after_timer_error 1
}
set msg "$msg\n$fail_id: Failure in $timeout $time_unit sec"
set msg "$msg\n$fail_id: Automatic failure in $timeout $time_unit seconds."
} else {
set fail_after_prev_timer 0
}
return $msg
}
proc fail_after_reboot_watchdog {} {
global fail_after_boot_timeout
if {$fail_after_boot_timeout != 0} {
fail_after $fail_after_boot_timeout realtime failed_boot 124
after boot "fail_after_reboot_watchdog"
}
}
# Globals
set fail_after_prev_timer 0
set fail_after_prev_id 0
set fail_after_path 0
set fail_after_boot_timeout 0
# Parse screenshot path env setting
if {[info exists ::env(FAIL_AFTER_PATH)] && ([string trim $::env(FAIL_AFTER_PATH)] != "")} {
@ -82,6 +73,5 @@ if {[info exists ::env(FAIL_AFTER_PATH)] && ([string trim $::env(FAIL_AFTER_PATH
# Enables boot watch dog timer when FAIL_AFTER_BOOT env has a value. (124 see `man timeout`)
if {[info exists ::env(FAIL_AFTER_BOOT)] && ([string trim $::env(FAIL_AFTER_BOOT)] != "")} {
set fail_after_boot_timeout [string trim $::env(FAIL_AFTER_BOOT)]
fail_after_reboot_watchdog
fail_after [string trim $::env(FAIL_AFTER_BOOT)] realtime failed_boot 124
}