summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qlockfile_win.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.4' into 5.5Liang Qi2015-06-011-1/+1
|\ | | | | | | | | | | | | | | Conflicts: qmake/generators/mac/pbuilder_pbx.cpp src/corelib/global/qglobal.h Change-Id: I2c0f7544bf194f2d0f59218fd583c822901487b0
| * Ensure the same behavior on Win as Unix re the host in isApparentlyStaleAndy Shaw2015-05-221-1/+1
| | | | | | | | | | | | | | | | | | When the hostname is empty then it is assumed that the lock file is from the same host as the one running the application. Change-Id: Iba8aefc171a209294371dc2022d93ede3035b242 Reviewed-by: Will Wagner <willw@carallon.com> Reviewed-by: David Faure <david.faure@kdab.com>
* | take process name into account for QLockFile's pid clash resolutionJoerg Bornemann2015-05-261-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To cover the situation that the process ID got reused, the current process name is compared to the name of the process that corresponds to the process ID from the lock file. If the process names differ, the lock file is considered stale. [ChangeLog][QtCore][QLockFile] Detection of stale lock files got more robust and takes the name of the process that belongs to the stored PID into account. Task-number: QTBUG-45497 Change-Id: Ic3c0d7e066435451203e77b9b9ce2d70bfb9c570 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: David Faure <david.faure@kdab.com>
* | WinRT/Winphone: Fix warnings in qtbaseOliver Wolff2015-05-181-1/+5
| | | | | | | | | | | | Change-Id: I41725bcfeee0124b259e96f1e3a261e30f14350a Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
* | Merge remote-tracking branch 'origin/5.4' into merge5.5Allan Sandfeld Jensen2015-05-081-11/+11
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h src/corelib/io/qnoncontiguousbytedevice_p.h src/gui/image/qjpeghandler.cpp src/network/access/qhttpthreaddelegate_p.h tests/auto/corelib/io/qlockfile/tst_qlockfile.cpp tests/auto/widgets/widgets/qmenubar/BLACKLIST Change-Id: I01de8c1c28efcedfd7953d05025f54802dc08ab3
| * QLockFile: fix deadlock when the lock file is corruptedOlivier Goffart2015-04-151-11/+11
| | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QLockFile] Fixed a deadlock when the lock file is corrupted. Task-number: QTBUG-44771 Change-Id: Ic490b09d70ff1cc1733b64949889a73720b2d0f3 Reviewed-by: David Faure <david.faure@kdab.com>
* | Windows: Fix QLockFile hanging when file cannot be created.Friedemann Kleint2015-04-231-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Return QLockFile::PermissionError when file does not exist, preventing the stale file detection logic from triggering. Add Windows-only autotest trying to create a lock file in a system folder guarded with checks for elevated processes and UAC virtualization. Task-number: QTBUG-45631 Change-Id: I1790f8f925660f6bf1df94c2ced901e6ec57cbb0 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com> Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
* | QLockFile: use QCoreApplication::applicationName.David Faure2015-03-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | Unlike qAppName, it doesn't require a QCoreApplication instance, making QLockFile usable in destructors of global statics. This also uses the value passed to setApplicationName if called rather than always argv[0]. Change-Id: I40446aba410db42d7cfe6b4408878faf435246f7 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Update copyright headersJani Heikkinen2015-02-111-6/+6
|/ | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-18/+10
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* QLockFile: on Windows, retry deleting the lock file if it is being read.David Faure2014-09-111-1/+11
| | | | | | | | | | | | | | | | A "sharing violation" happens when trying to delete the lock file and another thread/process is reading it at that very moment. Detect the error and try again, up to 10000 times - to avoid an infinite loop if QFile::remove fails for another reason such as a sudden change of permissions preventing us from deleting our own lock file. On Unix the deletion can't fail because of readers, but it doesn't hurt to check the return value there too, to catch other reasons for failures such as a sudden permission change. Task-number: QTBUG-38853 Change-Id: Icf12a74faed4a4916e3427abc09d9c33aa141476 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QLockFile/Windows: Determine host name from environment variable COMPUTERNAME.Friedemann Kleint2014-07-231-9/+16
| | | | | | | | Useful when using shared directories. Task-number: QTBUG-39967 Change-Id: I2c082e33133b00306378b6ff58478e94119e6a0e Reviewed-by: David Faure <david.faure@kdab.com>
* Added initial file system support for winrtOliver Wolff2013-10-111-1/+13
| | | | | | | | | | | | | | While some functionality is not available for winphone (QFileSystemEngine::tempPath), some functionality can be fully supported. Other cases like checking for stale processes which is needed by QLockFile cannot be covered that easily as obtaining information about other processes is limited due to sandboxing. Change-Id: I9ea80ae2b421eea1ddfd4c5bc2f4b6f8adaee85f Done-with: Kamil Trzcinski Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
* Long live QLockFileDavid Faure2013-03-051-0/+138
Locking between processes, implemented with open(O_EXCL) on Unix and CreateFile(CREATE_NEW) on Windows. Supports detecting stale lock files and deleting them. Advisory locking is used to prevent deletion of files that are still in use. Change-Id: Id00ee2a4e77a29483d869037c7047c59cb909339 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>