Don't try to enable sequential mode on non-existant files on GTK

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15222

(Cherry-picked from c26863cc1e)
This commit is contained in:
Ian McInerney 2023-07-18 21:02:11 +01:00
parent cc2637b310
commit 20a5b2d4c4
1 changed files with 2 additions and 1 deletions

View File

@ -30,7 +30,8 @@ FILE* KIPLATFORM::IO::SeqFOpen( const wxString& aPath, const wxString& aMode )
{
FILE* fp = wxFopen( aPath, aMode );
posix_fadvise( fileno( fp ), 0, 0, POSIX_FADV_SEQUENTIAL );
if( fp )
posix_fadvise( fileno( fp ), 0, 0, POSIX_FADV_SEQUENTIAL );
return fp;
}