mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-22 06:59:01 -06:00
file: Use 'long' to represent the parsed LOCK TIMEOUT value
Convert the StringToInt helper into a StringToLong helper with a 'long' result type. This will make the helper more useful to other callers that want to use strtol. While at it, also check errno after calling strtol in case the conversion fails with a range error.
This commit is contained in:
committed by
Brad King
parent
356f7cf445
commit
97841dad2b
@@ -37,7 +37,7 @@ class cmFileLock
|
||||
* @brief Lock the file.
|
||||
* @param timeoutSec Lock timeout. If -1 try until success or fatal error.
|
||||
*/
|
||||
cmFileLockResult Lock(const std::string& filename, unsigned timeoutSec);
|
||||
cmFileLockResult Lock(const std::string& filename, unsigned long timeoutSec);
|
||||
|
||||
/**
|
||||
* @brief Unlock the file.
|
||||
@@ -57,7 +57,7 @@ class cmFileLock
|
||||
|
||||
cmFileLockResult OpenFile();
|
||||
cmFileLockResult LockWithoutTimeout();
|
||||
cmFileLockResult LockWithTimeout(unsigned timeoutSec);
|
||||
cmFileLockResult LockWithTimeout(unsigned long timeoutSec);
|
||||
|
||||
#if defined(_WIN32)
|
||||
typedef HANDLE FileId;
|
||||
|
||||
Reference in New Issue
Block a user