MCPcopy Create free account
hub / github.com/Kitware/CMake / kwsysProcessSetupOutputPipeFile

Function kwsysProcessSetupOutputPipeFile

Source/kwsys/ProcessUNIX.c:1939–1963  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1937}
1938
1939static int kwsysProcessSetupOutputPipeFile(int* p, char const* name)
1940{
1941 int fout;
1942 if (!name) {
1943 return 1;
1944 }
1945
1946 /* Close the existing descriptor. */
1947 kwsysProcessCleanupDescriptor(p);
1948
1949 /* Open a file for the pipe to write. */
1950 if ((fout = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) {
1951 return 0;
1952 }
1953
1954 /* Set close-on-exec flag on the pipe's end. */
1955 if (fcntl(fout, F_SETFD, FD_CLOEXEC) < 0) {
1956 close(fout);
1957 return 0;
1958 }
1959
1960 /* Assign the replacement descriptor. */
1961 *p = fout;
1962 return 1;
1963}
1964
1965static int kwsysProcessSetupOutputPipeNative(int* p, int des[2])
1966{

Callers 1

kwsysProcess_ExecuteFunction · 0.70

Calls 1

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…