aboutsummaryrefslogtreecommitdiffstats
path: root/src/shared/qtlockedfile/qtlockedfile_unix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/qtlockedfile/qtlockedfile_unix.cpp')
-rw-r--r--src/shared/qtlockedfile/qtlockedfile_unix.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/shared/qtlockedfile/qtlockedfile_unix.cpp b/src/shared/qtlockedfile/qtlockedfile_unix.cpp
index b83129e370..32930ef003 100644
--- a/src/shared/qtlockedfile/qtlockedfile_unix.cpp
+++ b/src/shared/qtlockedfile/qtlockedfile_unix.cpp
@@ -42,10 +42,10 @@ bool QtLockedFile::lock(LockMode mode, bool block)
qWarning("QtLockedFile::lock(): file is not opened");
return false;
}
-
+
if (mode == NoLock)
return unlock();
-
+
if (mode == m_lock_mode)
return true;
@@ -59,14 +59,14 @@ bool QtLockedFile::lock(LockMode mode, bool block)
fl.l_type = (mode == ReadLock) ? F_RDLCK : F_WRLCK;
int cmd = block ? F_SETLKW : F_SETLK;
int ret = fcntl(handle(), cmd, &fl);
-
+
if (ret == -1) {
if (errno != EINTR && errno != EAGAIN)
qWarning("QtLockedFile::lock(): fcntl: %s", strerror(errno));
return false;
}
-
+
m_lock_mode = mode;
return true;
}
@@ -88,12 +88,12 @@ bool QtLockedFile::unlock()
fl.l_len = 0;
fl.l_type = F_UNLCK;
int ret = fcntl(handle(), F_SETLKW, &fl);
-
+
if (ret == -1) {
qWarning("QtLockedFile::lock(): fcntl: %s", strerror(errno));
return false;
}
-
+
m_lock_mode = NoLock;
return true;
}