Commit f623d3c5 authored by Lukas Appelhans's avatar Lukas Appelhans
Browse files

Remove the lock if we have no pid in the queue, that way sudo akabei sync does...

Remove the lock if we have no pid in the queue, that way sudo akabei sync does work even after akabei sync :)
parent cf0e76a9
...@@ -189,7 +189,19 @@ void FilesystemHelper::removeLock(qint64 pid) ...@@ -189,7 +189,19 @@ void FilesystemHelper::removeLock(qint64 pid)
qDebug() << "Lock granted to " << m_lock.head(); qDebug() << "Lock granted to " << m_lock.head();
m_pid = m_lock.head(); m_pid = m_lock.head();
emit lockGranted(m_lock.head()); emit lockGranted(m_lock.head());
} else if (m_lock.isEmpty()) {
struct flock lockinfo;
memset(&lockinfo, 0, sizeof(struct flock));
lockinfo.l_type = F_UNLCK;
lockinfo.l_whence = SEEK_SET;
lockinfo.l_start = 0;
lockinfo.l_len = 0;
if (fcntl(m_lockFile->handle(), F_SETLK, &lockinfo) == -1) {
qDebug() << "Could not remove lock in helper";
}
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment