if (( fp = fopen( path, mode )) == NULL ) {
if (( fp = ldaptool_open_file( path, mode )) == NULL ) {
berval_from_file( const char *path, struct berval *bvp, int reporterrs ){    FILE	*fp;    long	rlen;    int		eof;#if defined( XP_WIN32 )    char	mode[20] = "r+b";#else    char	mode[20] = "r";#endif    if (( fp = fopen( path, mode )) == NULL ) {	if ( reporterrs ) perror( path );	return( LDAPTOOL_FILEURL_FILEIOERROR );    }    if ( fseek( fp, 0L, SEEK_END ) != 0 ) {	if ( reporterrs ) perror( path );	fclose( fp );	return( LDAPTOOL_FILEURL_FILEIOERROR );    }    bvp->bv_len = ftell( fp );    if (( bvp->bv_val = (char *)malloc( bvp->bv_len + 1 )) == NULL ) {	if ( reporterrs ) perror( "malloc" );	fclose( fp );	return( LDAPTOOL_FILEURL_NOMEMORY );    }    if ( fseek( fp, 0L, SEEK_SET ) != 0 ) {	if ( reporterrs ) perror( path );	fclose( fp );	return( LDAPTOOL_FILEURL_FILEIOERROR );    }    rlen = fread( bvp->bv_val, 1, bvp->bv_len, fp );    eof = feof( fp );    fclose( fp );    if ( rlen != (long)bvp->bv_len ) {	if ( reporterrs ) perror( path );	free( bvp->bv_val );	return( LDAPTOOL_FILEURL_FILEIOERROR );    }    bvp->bv_val[ bvp->bv_len ] = '\0';    return( LDAPTOOL_FILEURL_SUCCESS );}