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

Function kwsysProcess_SetWorkingDirectory

Source/kwsys/ProcessUNIX.c:497–519  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

495}
496
497int kwsysProcess_SetWorkingDirectory(kwsysProcess* cp, char const* dir)
498{
499 if (!cp) {
500 return 0;
501 }
502 if (cp->WorkingDirectory == dir) {
503 return 1;
504 }
505 if (cp->WorkingDirectory && dir && strcmp(cp->WorkingDirectory, dir) == 0) {
506 return 1;
507 }
508 if (cp->WorkingDirectory) {
509 free(cp->WorkingDirectory);
510 cp->WorkingDirectory = 0;
511 }
512 if (dir) {
513 cp->WorkingDirectory = strdup(dir);
514 if (!cp->WorkingDirectory) {
515 return 0;
516 }
517 }
518 return 1;
519}
520
521int kwsysProcess_SetPipeFile(kwsysProcess* cp, int prPipe, char const* file)
522{

Callers 1

kwsysProcess_DeleteFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…