summaryrefslogtreecommitdiffstats
path: root/Source/cmFileLockUnix.cxx
Commit message (Collapse)AuthorAgeFilesLines
* file(LOCK): Close file descriptor/handle when releasing a lockBetsy McPhail2015-03-251-0/+4
| | | | | | | | | | | | The file lock functionality added in commit v3.2.0-rc1~297^2~1 (file: Add LOCK subcommand to do file and directory locking, 2014-11-26) forgot to close the lock file descriptors. Eventually it was possible to run out of file descriptors and locks could not longer be acquired. Fix this by closing the file descriptor or handle when we are done with it. Also set the member back to the initial value from the constructor to leave everything in a consistent state (useful for debugging). Co-Author: Ruslan Baratov <ruslan_baratov@yahoo.com>
* file: Use 'long' to represent the parsed LOCK TIMEOUT valueRuslan Baratov2014-12-051-1/+1
| | | | | | | | | 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.
* file: Add LOCK subcommand to do file and directory lockingRuslan Baratov2014-12-031-0/+102
Provide options to fail without blocking or to block up to a timeout. Provide options to specify the scope containing the lock so it can be released automatically at the end of a function, file, or process. Extend the RunCMake.file test with cases covering the file(LOCK) command usage and error cases.