git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101782
91177308-0d34-0410-b5e6-
96231b3b80d8
if (!envp)
#if !defined(__APPLE__)
if (!envp)
#if !defined(__APPLE__)
- envp = (const char**)environ;
+ envp = const_cast<const char **>(environ);
- envp = (const char**)*_NSGetEnviron(); // environ is missing in dylibs.
+ // environ is missing in dylibs.
+ envp = const_cast<const char **>(*_NSGetEnviron());
- int Err = posix_spawn(&PID, path.c_str(), &FileActions,
- /*attrp*/0, (char**)args, (char**)envp);
+ int Err = posix_spawn(&PID, path.c_str(), &FileActions, /*attrp*/0,
+ const_cast<char **>(args), const_cast<char **>(envp));
posix_spawn_file_actions_destroy(&FileActions);
posix_spawn_file_actions_destroy(&FileActions);
// Execute!
if (envp != 0)
// Execute!
if (envp != 0)
- execve(path.c_str(), (char**)args, (char**)envp);
+ execve(path.c_str(),
+ const_cast<char **>(args),
+ const_cast<char **>(envp));
- execv(path.c_str(), (char**)args);
+ execv(path.c_str(),
+ const_cast<char **>(args));
// If the execve() failed, we should exit. Follow Unix protocol and
// return 127 if the executable was not found, and 126 otherwise.
// Use _exit rather than exit so that atexit functions and static
// If the execve() failed, we should exit. Follow Unix protocol and
// return 127 if the executable was not found, and 126 otherwise.
// Use _exit rather than exit so that atexit functions and static