/* If we get a read error, return FALSE with *err and *err_info set appropriately.  */
gboolean wtap_read_bytes_or_eof(FILE_T fh, void *buf, unsigned int count, int *err, gchar **err_info)
/* If we get a read error, return FALSE with *err and *err_info set appropriately.  */
gboolean wtap_read_bytes_or_eof(FILE_T fh, void *buf, unsigned int count, int *err, gchar **err_info)
{
	int	bytes_read;
	bytes_read = file_read(buf, count, fh);
	if (bytes_read < 0 || (guint)bytes_read != count) {
		*err = file_error(fh, err_info);
		if (*err == 0 && bytes_read > 0)
			*err = WTAP_ERR_SHORT_READ;
		return FALSE;
	}
	return TRUE;
}