- Aug 28, 2015
-
-
Brad King authored
Change-Id: I930fdf45832e09b01b653a21ed0be159bebbf45d
-
Brad King authored
Change-Id: Icdc68acbac4b393ff753598dff331ac22df68b73
-
Brad King authored
Use the standard headers and namespace instead. We no longer support compilers without them. Change-Id: Iafb19d28462e9302df06eecc8ae42b48a9577a21
-
- Aug 24, 2015
-
-
James Johnston authored
If honor_umask is set, the umask is queried and applied to the given permissions when calling SetPermissions. Change-Id: I302231a2ae7f0c4610eb47fdb256fa02934ecd8c
-
James Johnston authored
Added a new TestFileAccess function that can be used to test for access to a file or directory using the requested combination of permissions. This is basically a wrapper of the POSIX access() function. Change-Id: I3e1769a2438cc2047a97850c5f312e36ed695799
-
James Johnston authored
The FileExists function always ensures that a file is readable on POSIX systems by using access() with R_OK. This was due to bug #809. Publicly state in the header file that this is being done. Also simplify the implementation so that redundant code handling the isFile parameter is eliminated. Change-Id: Ie07bec7aa5dd2bca07bb3244c01c0a29587aa437
-
James Johnston authored
This is necessary to satisfy a warning in Modules/Platform/CYGWIN.cmake. Change-Id: If5b5a661d3b82f4f3542ed34e96e4ccff4cbce8d
-
James Johnston authored
Change-Id: I53978f9da16eef6652566a59d8569fed07fe33a4
-
- Aug 21, 2015
-
-
Brad King authored
Pass flags to the SunPro compiler to improve the level of C++ standard support beyond the default. Do this only in a standalone build so that host projects can set flags for us. Change-Id: Ic9a84debfa939caf00b7ad99887793e885c35371
-
- Aug 07, 2015
-
-
Apply KWSYS_PROPERTIES_C to our C-only library, not the main library. Change-Id: I550196e6c6bdf613abfa7c7a19ec0b36d7f09553
-
- Aug 03, 2015
-
-
Teach testProcess-1 to stress-test kwsysProcess for leaks that lead to failure by running the test many times. Change-Id: I1906b935f4096161f30f418918653087f91dde16
-
Change-Id: Id632329f3593da977ce52de42ad39af4e6fb01dd
-
Change-Id: Iddfc4048d412ea9ecf1546802d6faca645c7ff36
-
Some operating systems allow directories to be opened and read like files while others do not. Simply check for a directory type first. Change-Id: Ic970f662d5aa887ace4a8f166ede7e0d1531d0d6
-
Fix the following error reported by valgrind memcheck tool: ==31549== 256 bytes in 1 blocks are definitely lost in loss record 1 of 1 ==31549== at 0x4C2B800: operator new[](unsigned long) (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==31549== by 0x44F3AA: kwsys::SystemTools::DetectFileType(char const*, unsigned long, double) (in .../kwsysTestsCxx) ==31549== by 0x43D75E: CheckFileOperations() (in .../kwsysTestsCxx) ==31549== by 0x43FAC5: testSystemTools(int, char**) (in .../kwsysTestsCxx) ==31549== by 0x434A2B: main (in .../kwsysTestsCxx) Change-Id: I42db9774bf30889b67921a538e00c1bf519a2719
-
- Jul 30, 2015
-
-
Since commit faff2ab0 (Process: Wait for children to terminate on Ctrl+C, 2015-06-30) we do not report the GetLastError() from CreateProcessW() failure. Refactor kwsysProcessCleanup to pass the error code in so that we can always call GetLastError() immediately after a failure. Change-Id: I2b7950560c8bde2e29070c87f4927c51dca32e39
-
- Jul 23, 2015
-
-
Brad King authored
Store and pass the interruptDelay parameter as 'unsigned int' so it does not have to be converted to pass to testProcess_sleep. Otherwise some compilers warn about the signed->unsigned conversion. Change-Id: I1edf6dbc852231834a5de82c5b14f84ac8018c1f
-
- Jul 22, 2015
-
-
kwsysProcess leaked a file descriptor every time a process would start. This was causing exhaustion of available file descriptors on some operating systems (e.g. Mac OS X). Change-Id: I78eed0755f9766065c36460ffab468b2d7d1df12
-
- Jul 15, 2015
-
-
Two new tests were added to testProcess: * Test 9 is constructed of the root test process, a child process, and a grandchild process. The grandchild ignores all Ctrl+C signals and then sleeps. The child runs the grandchild normally. The root process runs the child in a new process group, sends it a Ctrl+C signal, and then lets the process expire to prove that the child was blocked waiting for the uninterruptable grandchild to die. * Test 10 is constructed of the root test process, a child process, and a grandchild process. The grandchild sleeps and processes signals normally. The child runs the grandchild in a new process group. The root process runs the child in a new process group as well, sends it a Ctrl+C, and then verifies that: (1) the child does indeed terminate with an interrupt signal, (2) the child did not expire, proving that it retransmitted the signal to the sleeping grandchild before waiting for the grandchild to terminate. Change-Id: Iba5bee546a82eb61a41d4194341e9382a00279d4
-
kwsysProcess_SetOption now allows you to specify a new kwsysProcess_Option_CreateProcessGroup option, which creates the process in a new process group (Windows/UNIX) and a new session (UNIX). Child process groups receive signals separately from their parents. This allowed for the introduction of the new kwsysProcess_Interrupt function, which allows one to safely request the child process in its own group to terminate. The Ctrl+C handler also manually sends that signal to child process groups, since it's no longer automatic. Change-Id: Id0a420ad65f1b1c1d299ac0eb95fbb8b50a52409
-
The following applies to any KWSys console app on Windows or UNIX (e.g. cmake.exe): The default behavior of such an app when Ctrl+C is pressed is to call ExitProcess or _exit. If the user has a subprocess open (e.g. by way of cmake --build) when this happens, the subprocess will be orphaned because the kwsys-based program will immediately exit. This can lead to odd behavior such as the orphaned subprocess continuing to run and mix output with the operating system shell. We prevent this behavior on Windows by tracking all subprocesses and waiting for their termination when Ctrl+C is pressed before allowing the call to ExitProcess to proceed. On UNIX, we reap every single child process and then call _exit. Change-Id: Iebd2eedb1c06719e9797dd5b1309d473145476a8
-
Code for delaying/sleeping has been unified into one location. Change-Id: I234f3e1be667539e8126f7ed24aec95fe14284b3
-
Change-Id: I821de08dd10b5f1f4af6287a5d7dc6e03e2c1e78
-
- Jul 10, 2015
-
-
Brad King authored
Use a case-insensitive map key since paths of all case combinations should map to the same actual case. This may reduce the number of copies of each path differing only by case in the map. Change-Id: Ic5460fcf14fa263d45ef1909bf80a81c6f4791a4
-
- Jul 08, 2015
-
-
Brad King authored
The shell escaping APIs are very specific to CMake and are not used by other KWSys clients. They are moving to CMake proper, so drop them from KWSys. Change-Id: I422c76f6515d51a352e112828533d6e3fd1a5440
-
- Jul 07, 2015
-
-
Brad King authored
Use an algorithm that simply reverses CommandLineToArgvW to construct a string encoding command line arguments. Change-Id: I52a5d27679da3962eda36b8bb6a1fb714a735a1d
-
- Jul 02, 2015
-
-
Brad King authored
Change-Id: I5eb32dd2b8ca02800f15375dd4959c5c80d9ba7a
-
- Jun 15, 2015
-
-
Brad King authored
The latter is predefined by Windows toolchains and is more reliable. Change-Id: I598092af2965b4660b57d490caecdb678f5147ca
-
- Jun 03, 2015
-
-
Implement on platforms with getloadavg() available. Also implement on Windows using an approach like that described here: http://stackoverflow.com/questions/23143693/retrieving-cpu-load-percent-total-in-windows-with-c Co-Author: Betsy McPhail <betsy.mcphail@kitware.com> Co-Author: Brad King <brad.king@kitware.com> Change-Id: I5c50b964a05ece97e88f246df532ed6881bf2dce
-
- May 27, 2015
-
-
Brad King authored
Some use cases may have a race condition such that the file to be removed disappears before we remove it. Detect when removal fails due to the file already missing and tolerate it without failing. On Windows this requires using DeleteFileW instead of _wunlink because the latter does not seem to always update errno. Try to delete before checking permissions because getting permissions will fail if the file is missing. Change-Id: If1922a15d742daca6d252c594284800d60cc1fce
-
- May 18, 2015
-
-
Matt McCormick authored
When Android is compiled with "-static" in CMAKE_EXE_LINKER_FLAGS, only the shared version of libc has utimensat. By setting CMP0056 to NEW, CMAKE_EXE_LINKER_FLAGS is passed to the try_compile in KWSYS_PLATFORM_CXX_TEST so KWSYS_CXX_HAS_UTIMENSAT gets the correct result. Change-Id: Ia5ff7abaafb92e043927b57c5f2858259195235f
-
- May 12, 2015
-
-
Brad King authored
MIPS machines are biendian hence they can run both big endian kernels e.g. Debian mips architecture, and little endian kernels e.g. Debian mipsel architecture. Use predefined macros to distinguish them. Change-Id: I75fccd3cb1ef7915c8754ebbb64cb52a948b4ad8 Reported-by:
Mathieu Malaterre <malat@debian.org> Inspired-by:
Modestas Vainius <modax@debian.org>
-
- May 05, 2015
-
-
Brad King authored
When enabled, ignore all stderr pipe configuration options and just give the child a copy of stdout as its stderr. Change-Id: I87a64657cc701b706da78f7bfc56ad0071383372
-
Brad King authored
Consolidate logic to prepare stdin/stdout/stderr in the same way before starting any processes. This will simplify alternative approaches to select the child pipes. Change-Id: I36175a8cfc2578543103297420908a539ad71a3a
-
- May 04, 2015
-
-
Brad King authored
Suggested-by:
Gerhard Grimm <gerhard.grimm@detec.com> Change-Id: I22bf9a8e14c5c3862f6422ec2d8cc4da645a5a0d
-
- Apr 19, 2015
-
-
Brad King authored
Glob.hxx:58:5: warning: definition of implicit copy assignment operator for 'Message' is deprecated because it has a user-declared copy constructor [-Wdeprecated] Message(const Message& msg) : ^ Change-Id: Id6d28d9e5b4ed556556a5add10881f1bcd4525b7
-
- Apr 16, 2015
-
-
Brad King authored
Since we do not package the KWSys source tree directly and always merge snapshots of its content into other project subtrees, we should carry the .gitattributes file into the other projects to that the attributes apply in their source trees too. Change-Id: I039b151443486d24ff798fa0c677b62620cec0b7
-
- Apr 10, 2015
-
-
Brad King authored
Change-Id: Ic8f5dec4fbada46d68ed02b5916b61998966d85e
-