/* Routine to return a Wiretap error code (0 for no error, an errno for a file error, or a WTAP_ERR_ code for other errors) for an I/O stream. Also returns an error string for some errors.  */
int file_error(FILE_T fh, gchar **err_info)
/* Routine to return a Wiretap error code (0 for no error, an errno for a file error, or a WTAP_ERR_ code for other errors) for an I/O stream. Also returns an error string for some errors.  */
int file_error(FILE_T fh, gchar **err_info)
{
    if (fh->err!=0 && err_info) {
        *err_info = g_strdup(fh->err_info);
    }
    return fh->err;
}