diff options
author | Maksym Telychko <maksym.telychko@globallogic.com> | 2020-03-25 22:28:30 +0200 |
---|---|---|
committer | Maksym Telychko <maksym.telychko@globallogic.com> | 2020-03-25 22:28:30 +0200 |
commit | 3c3b31e973c701c0cc12f3494f83b2750ac5c064 (patch) | |
tree | 240cabacc7f294ef6df1111acc352859cdfe33e1 /src | |
parent | efd5a28d96b91f5f9597a1e6ceef41cb22885cfd (diff) | |
download | libmts-io-3c3b31e973c701c0cc12f3494f83b2750ac5c064.tar.gz libmts-io-3c3b31e973c701c0cc12f3494f83b2750ac5c064.tar.bz2 libmts-io-3c3b31e973c701c0cc12f3494f83b2750ac5c064.zip |
MTX-3262 mpower lockfile: flock error check
Diffstat (limited to 'src')
-rw-r--r-- | src/MTS_IO_LockFile.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/MTS_IO_LockFile.cpp b/src/MTS_IO_LockFile.cpp index 842ffb7..ce6655c 100644 --- a/src/MTS_IO_LockFile.cpp +++ b/src/MTS_IO_LockFile.cpp @@ -60,6 +60,8 @@ bool LockFile::lock(uint32_t attemptMillis) m_iLockErr = ::flock(m_iLockFd, LOCK_EX | LOCK_NB); if (m_iLockErr == 0) { return true; + } else if (errno != EWOULDBLOCK) { + break; } ::usleep(((rand() % 10) + 1) * 100000); //Sleep from 100ms to 1 Second } |