]> git.saurik.com Git - wxWidgets.git/commitdiff
fixed a few minor bugs: handle the directory parameter to Create() correctly, better...
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 15 Apr 2002 19:45:20 +0000 (19:45 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 15 Apr 2002 19:45:20 +0000 (19:45 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15153 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/unix/snglinst.cpp

index d29268bbd3d9b096be9458448907a9c45aa0ad91..9cc4155e80ec11481daa02f0a1410c13f18dfb7d 100644 (file)
@@ -158,8 +158,7 @@ LockResult wxSingleInstanceCheckerImpl::CreateLockFile()
     if ( m_fdLock != -1 )
     {
         // try to lock it
-        int rc = wxLockFile(m_fdLock, LOCK);
-        if ( rc == 0 )
+        if ( wxLockFile(m_fdLock, LOCK) == 0 )
         {
             // fine, we have the exclusive lock to the file, write our PID
             // into it
@@ -188,7 +187,7 @@ LockResult wxSingleInstanceCheckerImpl::CreateLockFile()
             close(m_fdLock);
             m_fdLock = -1;
 
-            if ( rc != EACCES && rc != EAGAIN )
+            if ( errno != EACCES && errno != EAGAIN )
             {
                 wxLogSysError(_("Failed to lock the lock file '%s'"),
                               m_nameLock.c_str());
@@ -332,7 +331,12 @@ bool wxSingleInstanceChecker::Create(const wxString& name,
     wxString fullname = path;
     if ( fullname.empty() )
     {
-        fullname << wxGetHomeDir() << _T('/');
+        fullname = wxGetHomeDir();
+    }
+
+    if ( fullname.Last() != _T('/') )
+    {
+        fullname += _T('/');
     }
 
     fullname << name;