|
|
|
@ -54,16 +54,6 @@ namespace google { |
|
|
|
|
namespace protobuf { |
|
|
|
|
namespace compiler { |
|
|
|
|
|
|
|
|
|
namespace { |
|
|
|
|
char* portable_strdup(const char* s) { |
|
|
|
|
char* ns = (char*)malloc(strlen(s) + 1); |
|
|
|
|
if (ns != nullptr) { |
|
|
|
|
strcpy(ns, s); |
|
|
|
|
} |
|
|
|
|
return ns; |
|
|
|
|
} |
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
|
|
#ifdef _WIN32 |
|
|
|
|
|
|
|
|
|
static void CloseHandleOrDie(HANDLE handle) { |
|
|
|
@ -318,6 +308,16 @@ Subprocess::~Subprocess() { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
namespace { |
|
|
|
|
char* portable_strdup(const char* s) { |
|
|
|
|
char* ns = (char*)malloc(strlen(s) + 1); |
|
|
|
|
if (ns != nullptr) { |
|
|
|
|
strcpy(ns, s); |
|
|
|
|
} |
|
|
|
|
return ns; |
|
|
|
|
} |
|
|
|
|
} // namespace
|
|
|
|
|
|
|
|
|
|
void Subprocess::Start(const std::string& program, SearchMode search_mode) { |
|
|
|
|
// Note that we assume that there are no other threads, thus we don't have to
|
|
|
|
|
// do crazy stuff like using socket pairs or avoiding libc locks.
|
|
|
|
|