Prevent ro directories from showing lockfile error
(cherry picked from commit d94fd5f979
)
This commit is contained in:
parent
f974c8259e
commit
8648017b42
|
@ -230,7 +230,10 @@ bool EDA_DRAW_FRAME::LockFile( const wxString& aFileName )
|
|||
|
||||
m_file_checker = std::make_unique<LOCKFILE>( aFileName );
|
||||
|
||||
return m_file_checker->Locked();
|
||||
// If the file is not valid, or is successfully locked, return true
|
||||
// Invalid lockfiles are the result of bad permissions, so this is
|
||||
// likely not a file that we can override regardless
|
||||
return !m_file_checker->Valid() || m_file_checker->Locked();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -52,6 +52,13 @@ public:
|
|||
fn.SetName( "~" + fn.GetName() );
|
||||
fn.SetExt( fn.GetExt() + ".lck" );
|
||||
|
||||
if( !fn.IsFileWritable() )
|
||||
{
|
||||
m_status = true;
|
||||
m_removeOnRelease = false;
|
||||
return;
|
||||
}
|
||||
|
||||
m_lockFilename = fn.GetFullPath();
|
||||
|
||||
wxFile file;
|
||||
|
|
Loading…
Reference in New Issue