Program::~Program() {}
unsigned Program::GetPid() const {
- return reinterpret_cast<unsigned>(Data_);
+ uint64_t pid = reinterpret_cast<uint64_t>(Data_);
+ return static_cast<unsigned>(pid);
}
// This function just uses the PATH environment variable to find the program.
// Parent process: Wait for the child process to terminate.
int status;
- pid_t child = reinterpret_cast<pid_t>(Data_);
+ uint64_t pid = reinterpret_cast<uint64_t>(Data_);
+ pid_t child = static_cast<pid_t>(pid);
while (wait(&status) != child)
if (secondsToWait && errno == EINTR) {
// Kill the child.
return true;
}
- pid_t pid = reinterpret_cast<pid_t>(Data_);
+ uint64_t pid64 = reinterpret_cast<uint64_t>(Data_);
+ pid_t pid = static_cast<pid_t>(pid64);
return (kill(pid, SIGKILL) == 0);
}