Detect when a .do script deletes its stdout tmp file.

This can happen if we create the .tmp file in the same directory as the
target, and the .do file first does "rm -rf" on that directory, then
re-creates it.  The result is that the stdout file is lost.

We'll make this a warning if the .do script *didn't* write to stdout
(so the loss is harmless, just weird), and an error if they *did* write
to stdout, which we can detect because we still have an open fd on the
file, so we can fstat() it.
This commit is contained in:
Avery Pennarun 2018-12-12 03:36:09 +00:00
commit 1f79bf1174
5 changed files with 43 additions and 3 deletions

View file

@ -1 +1,2 @@
deltest2
/destruct