diff --git a/btest b/btest index d63c410..1799bb4 100755 --- a/btest +++ b/btest @@ -1188,7 +1188,7 @@ class Test: error(f"cannot write test's additional file '{fname}'") for line in lines: - ffile.write(line) + ffile.write(line.replace("\r\n", "\n")) ffile.close() diff --git a/btest-bg-wait b/btest-bg-wait index e8437af..ed06a00 100755 --- a/btest-bg-wait +++ b/btest-bg-wait @@ -85,7 +85,11 @@ function kill_procs { } function collect_output { - rm -f .stdout .stderr + # Truncate rather than rm: on Windows the parent process (btest) + # still holds these files open and rm would fail with EBUSY. + # Truncation is allowed because btest opens them with write-sharing. + : >.stdout + : >.stderr if [ $timeout_ok != 1 ] && [ -s .timeout ]; then {