summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qlockfile.cpp13
-rw-r--r--src/corelib/io/qlockfile_p.h5
2 files changed, 5 insertions, 13 deletions
diff --git a/src/corelib/io/qlockfile.cpp b/src/corelib/io/qlockfile.cpp
index fef20455732..908db7b9d38 100644
--- a/src/corelib/io/qlockfile.cpp
+++ b/src/corelib/io/qlockfile.cpp
@@ -458,18 +458,7 @@ bool QLockFilePrivate::isApparentlyStale() const
return staleLockTime > 0ms && abs(age) > staleLockTime;
}
-int QLockFilePrivate::getLockFileHandle(QLockFile *f)
-{
- int fd;
-#ifdef Q_OS_WIN
- // Use of this function on Windows WILL leak a file descriptor.
- fd = _open_osfhandle(intptr_t(f->d_func()->fileHandle), 0);
-#else
- fd = f->d_func()->fileHandle;
-#endif
- QT_LSEEK(fd, 0, SEEK_SET);
- return fd;
-}
+
/*!
Attempts to forcefully remove an existing lock file.
diff --git a/src/corelib/io/qlockfile_p.h b/src/corelib/io/qlockfile_p.h
index 8758adfb71e..2a7ebe1926d 100644
--- a/src/corelib/io/qlockfile_p.h
+++ b/src/corelib/io/qlockfile_p.h
@@ -52,7 +52,10 @@ public:
bool isLocked = false;
// used in tst_QLockFile:
- Q_CORE_EXPORT static int getLockFileHandle(QLockFile *f);
+ static auto getLockFileHandle(QLockFile *f)
+ {
+ return f->d_func()->fileHandle;
+ }
};
QT_END_NAMESPACE