mirror of
https://github.com/systemd/systemd.git
synced 2026-08-09 09:32:04 +00:00
The RETURN traps in the browse helpers only stopped the transient varlinkctl unit; the mktemp'd output/error/scratch files were never removed and leaked on every invocation. Remove them from the same trap, after the unit has been stopped so that nothing is still writing to them, and make that stop best-effort like in testcase_browse_ifindex_zero_no_flap: if varlinkctl exited on its own, the transient unit is already gone, and a failing stop would otherwise abort the testcase under errexit and skip the removal. testcase_browse_ifindex_zero_no_flap cleans up its output file from the trap it already arms for the dummy link, which is an EXIT trap since run_testcases runs each testcase in its own subshell. While at it, tidy up the helpers' variable scoping: error_file was accidentally a global, and i/svc were declared in the wrong functions (they are used by check_both/check_first, via dynamic scoping).