We check if files exists by using a stat() call. If that call fails we return 0 (file does not exist) while there might be other reasons for failure, e. g.:
- checking a file over 2 GB on a system without large file support
- permissions problem
- out of memory
I think if stat() fails for any other reason than ENOENT (file does not exist) we should return ZBX_NOTSUPPORTED.