mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-04-20 12:01:41 +00:00
Add error handling to posix function call
This commit is contained in:
parent
2aa079d58c
commit
2ddcc7a7ad
@ -32,7 +32,13 @@ FILE* KIPLATFORM::IO::SeqFOpen( const wxString& aPath, const wxString& aMode )
|
||||
FILE* fp = wxFopen( aPath, aMode );
|
||||
|
||||
if( fp )
|
||||
posix_fadvise( fileno( fp ), 0, 0, POSIX_FADV_SEQUENTIAL );
|
||||
{
|
||||
if( posix_fadvise( fileno( fp ), 0, 0, POSIX_FADV_SEQUENTIAL ) != 0 )
|
||||
{
|
||||
fclose( fp );
|
||||
fp = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
return fp;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user