For nonexistent file file(1) returns zero on 11.1:
> $ /usr/bin/file /nonexistent
> /nonexistent: cannot open `/nonexistent' (No such file or directory)
> $ echo $?
Despite its manpage saying:
> RETURN CODE
> file returns 0 on success, and non-zero on error.
I believe this is correct POSIX behavior:
If the file named by the file operand does not exist, cannot be read, or the type of the file named by the file operand cannot be determined, this shall not be considered an error that affects the exit status.
An appropriate fix would be to add that text to our manual page.
(In reply to lgfbsd from comment #1)