]> git.saurik.com Git - wxWidgets.git/commitdiff
return false, not true, from wxSingleInstanceChecker::IsAnotherRunning() if an error...
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 24 Sep 2008 13:47:41 +0000 (13:47 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 24 Sep 2008 13:47:41 +0000 (13:47 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55833 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/unix/snglinst.cpp

index 26bab35d8bcdfb1120637ce42fd8e25433bfeb83..1ce464edfab62e12f0777d3e456c5ed0cd8a6127 100644 (file)
@@ -375,9 +375,19 @@ bool wxSingleInstanceChecker::IsAnotherRunning() const
 {
     wxCHECK_MSG( m_impl, false, _T("must call Create() first") );
 
+    const pid_t lockerPid = m_impl->GetLockerPID();
+
+    if ( !lockerPid )
+    {
+        // we failed to open the lock file, return false as we're definitely
+        // not sure that another our process is running and so it's better not
+        // to prevent this one from starting up
+        return false;
+    }
+
     // if another instance is running, it must own the lock file - otherwise
     // we have it and the locker PID is ours one
-    return m_impl->GetLockerPID() != getpid();
+    return lockerPid != getpid();
 }
 
 wxSingleInstanceChecker::~wxSingleInstanceChecker()