diff options
author | Ruslan Baratov <ruslan_baratov@yahoo.com> | 2014-12-05 17:18:11 +0300 |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2014-12-05 12:59:37 -0500 |
commit | 97841dad2ba5a79acb0b22db9a01ae45f7b2e80b (patch) | |
tree | a549030bf27c8d94e42fbbd35e723ff56206c07b /Source/cmFileLock.cxx | |
parent | 356f7cf4457271ee85a71face453ea9579f05da3 (diff) | |
download | cmake-97841dad2ba5a79acb0b22db9a01ae45f7b2e80b.tar.gz |
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/cmFileLock.cxx')
-rw-r--r-- | Source/cmFileLock.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/cmFileLock.cxx b/Source/cmFileLock.cxx index 5f75637023..e6aa5f49d5 100644 --- a/Source/cmFileLock.cxx +++ b/Source/cmFileLock.cxx @@ -28,7 +28,7 @@ cmFileLock::~cmFileLock() } cmFileLockResult cmFileLock::Lock( - const std::string& filename, unsigned timeout) + const std::string& filename, unsigned long timeout) { if (filename.empty()) { @@ -48,7 +48,7 @@ cmFileLockResult cmFileLock::Lock( cmFileLockResult result = this->OpenFile(); if (result.IsOk()) { - if (timeout == static_cast<unsigned>(-1)) + if (timeout == static_cast<unsigned long>(-1)) { result = this->LockWithoutTimeout(); } |