diff: Fix device case.

We already fell back to Stone for FIFOs, but we actually need to fall
back to Stone for everything except regular files, because libdiff's
atomizer needs to know the size of its input in advance, and neither
FIFOs nor devices can be trusted to report their size.

MFC after:	1 week
Reported by:	mav
Reviewed by:	mav, allanjude
Differential Revision:	https://reviews.freebsd.org/D48181
This commit is contained in:
Dag-Erling Smørgrav
2024-12-23 18:15:57 +01:00
parent b45f84cc62
commit 893839b119
+2 -2
View File
@@ -314,8 +314,8 @@ openfile(const char *path, char **p, struct stat *st)
bool
can_libdiff(int flags)
{
/* We can't use fifos with libdiff yet */
if (S_ISFIFO(stb1.st_mode) || S_ISFIFO(stb2.st_mode))
/* libdiff's atomizer can only deal with files */
if (!S_ISREG(stb1.st_mode) || !S_ISREG(stb2.st_mode))
return false;
/* Is this one of the supported input/output modes for diffreg_new? */