diff should allow comparison between regular files and fifos
Added a few tests to help catch regressions here, and added
some cleanup for files the test creates.
Also exit immediately if a seek fails.
In addition to the supplied test, also tested manually with:
./toybox diff <(echo -e "1\n2") <(echo -e "1\n3")
However, the "testing" function in runtest.sh doesn't handle such
syntax.
Used by some ART tests and also some LLVM tests. (The motivating example
is the latter, but I noticed the former when looking for other users.)
Bug: http://b/137298656
We were doing two 32-byte memset()s instead of two 16-byte memset()s.
'dir' referred to the instance (array of 2) and not the struct type.
Add some test coverage for diff, including a case that hit this bug.
The bug was found by running cp.test under AddressSanitizer, since it
happens to use diff.