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

Function kwsysProcess_SetPipeFile

Source/kwsys/ProcessWin32.c:688–726  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

686}
687
688int kwsysProcess_SetPipeFile(kwsysProcess* cp, int pipe, char const* file)
689{
690 char** pfile;
691 if (!cp) {
692 return 0;
693 }
694 switch (pipe) {
695 case kwsysProcess_Pipe_STDIN:
696 pfile = &cp->PipeFileSTDIN;
697 break;
698 case kwsysProcess_Pipe_STDOUT:
699 pfile = &cp->PipeFileSTDOUT;
700 break;
701 case kwsysProcess_Pipe_STDERR:
702 pfile = &cp->PipeFileSTDERR;
703 break;
704 default:
705 return 0;
706 }
707 if (*pfile) {
708 free(*pfile);
709 *pfile = 0;
710 }
711 if (file) {
712 *pfile = strdup(file);
713 if (!*pfile) {
714 return 0;
715 }
716 }
717
718 /* If we are redirecting the pipe, do not share it or use a native
719 pipe. */
720 if (*pfile) {
721 kwsysProcess_SetPipeNative(cp, pipe, 0);
722 kwsysProcess_SetPipeShared(cp, pipe, 0);
723 }
724
725 return 1;
726}
727
728void kwsysProcess_SetPipeShared(kwsysProcess* cp, int pipe, int shared)
729{

Callers 3

kwsysProcess_DeleteFunction · 0.70

Calls 2

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…