Skip to content

Commit

Permalink
refactor, subprocess: Remove Popen::pid()
Browse files Browse the repository at this point in the history
  • Loading branch information
hebasto committed May 10, 2024
1 parent 98dd4e7 commit 24b53fc
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/util/subprocess.h
Expand Up @@ -902,7 +902,6 @@ class Streams
* Command provided in a single string.
* wait() - Wait for the child to exit.
* retcode() - The return code of the exited child.
* pid() - PID of the spawned child.
* poll() - Check the status of the running child.
* send(...) - Send input to the input channel of the child.
* communicate(...) - Get the output/error from the child and close the channels
Expand Down Expand Up @@ -956,8 +955,6 @@ class Popen
execute_process();
}

int pid() const noexcept { return child_pid_; }

int retcode() const noexcept { return retcode_; }

int wait() noexcept(false);
Expand Down Expand Up @@ -1068,7 +1065,7 @@ inline int Popen::wait() noexcept(false)
return 0;
#else
int ret, status;
std::tie(ret, status) = util::wait_for_child_exit(pid());
std::tie(ret, status) = util::wait_for_child_exit(child_pid_);
if (ret == -1) {
if (errno != ECHILD) throw OSError("waitpid failed", errno);
return 0;
Expand Down

0 comments on commit 24b53fc

Please sign in to comment.