X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/776862b4972c6e10da2df21769743a9d1dc490e0..9fd9e47a93dfcdd99c2722e288a0f28a51ce6f5f:/src/unix/snglinst.cpp diff --git a/src/unix/snglinst.cpp b/src/unix/snglinst.cpp index d29268bbd3..9cc4155e80 100644 --- a/src/unix/snglinst.cpp +++ b/src/unix/snglinst.cpp @@ -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;