diff options
author | Ruslan Baratov <ruslan_baratov@yahoo.com> | 2014-12-05 14:18:11 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-12-05 17:59:37 (GMT) |
commit | 97841dad2ba5a79acb0b22db9a01ae45f7b2e80b (patch) | |
tree | a549030bf27c8d94e42fbbd35e723ff56206c07b /Source/cmFileLockPool.h | |
parent | 356f7cf4457271ee85a71face453ea9579f05da3 (diff) | |
download | CMake-97841dad2ba5a79acb0b22db9a01ae45f7b2e80b.zip CMake-97841dad2ba5a79acb0b22db9a01ae45f7b2e80b.tar.gz CMake-97841dad2ba5a79acb0b22db9a01ae45f7b2e80b.tar.bz2 |
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.
Diffstat (limited to 'Source/cmFileLockPool.h')
-rw-r--r-- | Source/cmFileLockPool.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Source/cmFileLockPool.h b/Source/cmFileLockPool.h index a63540c..baef310 100644 --- a/Source/cmFileLockPool.h +++ b/Source/cmFileLockPool.h @@ -45,13 +45,13 @@ class cmFileLockPool * @param timeoutSec Lock timeout. If -1 try until success or fatal error. */ cmFileLockResult LockFunctionScope( - const std::string& filename, unsigned timeoutSec + const std::string& filename, unsigned long timeoutSec ); cmFileLockResult LockFileScope( - const std::string& filename, unsigned timeoutSec + const std::string& filename, unsigned long timeoutSec ); cmFileLockResult LockProcessScope( - const std::string& filename, unsigned timeoutSec + const std::string& filename, unsigned long timeoutSec ); //@} @@ -72,7 +72,9 @@ class cmFileLockPool ScopePool(); ~ScopePool(); - cmFileLockResult Lock(const std::string& filename, unsigned timeoutSec); + cmFileLockResult Lock( + const std::string& filename, unsigned long timeoutSec + ); cmFileLockResult Release(const std::string& filename); bool IsAlreadyLocked(const std::string& filename) const; |