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

Function kwsysProcess_SetPipeFile

Source/kwsys/ProcessUNIX.c:521–558  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

519}
520
521int kwsysProcess_SetPipeFile(kwsysProcess* cp, int prPipe, char const* file)
522{
523 char** pfile;
524 if (!cp) {
525 return 0;
526 }
527 switch (prPipe) {
528 case kwsysProcess_Pipe_STDIN:
529 pfile = &cp->PipeFileSTDIN;
530 break;
531 case kwsysProcess_Pipe_STDOUT:
532 pfile = &cp->PipeFileSTDOUT;
533 break;
534 case kwsysProcess_Pipe_STDERR:
535 pfile = &cp->PipeFileSTDERR;
536 break;
537 default:
538 return 0;
539 }
540 if (*pfile) {
541 free(*pfile);
542 *pfile = 0;
543 }
544 if (file) {
545 *pfile = strdup(file);
546 if (!*pfile) {
547 return 0;
548 }
549 }
550
551 /* If we are redirecting the pipe, do not share it or use a native
552 pipe. */
553 if (*pfile) {
554 kwsysProcess_SetPipeNative(cp, prPipe, 0);
555 kwsysProcess_SetPipeShared(cp, prPipe, 0);
556 }
557 return 1;
558}
559
560void kwsysProcess_SetPipeShared(kwsysProcess* cp, int prPipe, int shared)
561{

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…