mirror of
https://github.com/genodelabs/genode.git
synced 2025-03-23 04:25:21 +00:00
run: close connection to spawned processes on kill
From the man page of expect: > Both expect and interact will detect when the current process exits > and implicitly do a close. But if you kill the process by, say, "exec > kill $pid", you will need to explicitly call close. Fixes #3569
This commit is contained in:
parent
b57a4c98cf
commit
6145cdcf37
@ -112,8 +112,7 @@ proc autopilot_run_genode_until {{wait_for_re forever} {timeout_value 0} {runnin
|
|||||||
|
|
||||||
# kill the spawned load process if there is one
|
# kill the spawned load process if there is one
|
||||||
if {[load_spawn_id] != -1} {
|
if {[load_spawn_id] != -1} {
|
||||||
set pid [exp_pid -i [load_spawn_id]]
|
kill_spawned [load_spawn_id]
|
||||||
exec kill -9 $pid
|
|
||||||
}
|
}
|
||||||
|
|
||||||
incr retry -1;
|
incr retry -1;
|
||||||
@ -830,7 +829,7 @@ while {1} {
|
|||||||
if {$run_genode_failed} {
|
if {$run_genode_failed} {
|
||||||
|
|
||||||
# shut-down running system
|
# shut-down running system
|
||||||
exec kill -9 [exp_pid -i $serial_id]
|
kill_spawned $serial_id
|
||||||
run_power_off
|
run_power_off
|
||||||
|
|
||||||
# remember result of last test
|
# remember result of last test
|
||||||
@ -902,7 +901,7 @@ while {1} {
|
|||||||
{
|
{
|
||||||
# shut-down running system
|
# shut-down running system
|
||||||
puts "Re-booting to meet maximum number of tests per boot for this platform"
|
puts "Re-booting to meet maximum number of tests per boot for this platform"
|
||||||
exec kill -9 [exp_pid -i $serial_id]
|
kill_spawned $serial_id
|
||||||
run_power_off
|
run_power_off
|
||||||
|
|
||||||
# prepare system re-boot
|
# prepare system re-boot
|
||||||
|
14
tool/run/run
14
tool/run/run
@ -307,8 +307,7 @@ proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id
|
|||||||
|
|
||||||
# kill the spawned load process if there is one
|
# kill the spawned load process if there is one
|
||||||
if {[load_spawn_id] != -1} {
|
if {[load_spawn_id] != -1} {
|
||||||
set pid [exp_pid -i [load_spawn_id]]
|
kill_spawned [load_spawn_id]
|
||||||
exec kill -9 $pid
|
|
||||||
}
|
}
|
||||||
|
|
||||||
incr retry -1;
|
incr retry -1;
|
||||||
@ -329,6 +328,17 @@ proc run_genode_until {{wait_for_re forever} {timeout_value 0} {running_spawn_id
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
##
|
||||||
|
# "Safely" kill spawned process
|
||||||
|
#
|
||||||
|
proc kill_spawned {spawn_id} {
|
||||||
|
set pid [exp_pid -i $spawn_id]
|
||||||
|
close -i $spawn_id
|
||||||
|
exec kill -9 $pid
|
||||||
|
wait -i $spawn_id
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# Remove color information from output
|
# Remove color information from output
|
||||||
#
|
#
|
||||||
|
Loading…
x
Reference in New Issue
Block a user