Skip to content

Commit 24b53fc

Browse files
committed
refactor, subprocess: Remove Popen::pid()
1 parent 98dd4e7 commit 24b53fc

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/util/subprocess.h

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,6 @@ class Streams
902902
* Command provided in a single string.
903903
* wait() - Wait for the child to exit.
904904
* retcode() - The return code of the exited child.
905-
* pid() - PID of the spawned child.
906905
* poll() - Check the status of the running child.
907906
* send(...) - Send input to the input channel of the child.
908907
* communicate(...) - Get the output/error from the child and close the channels
@@ -956,8 +955,6 @@ class Popen
956955
execute_process();
957956
}
958957

959-
int pid() const noexcept { return child_pid_; }
960-
961958
int retcode() const noexcept { return retcode_; }
962959

963960
int wait() noexcept(false);
@@ -1068,7 +1065,7 @@ inline int Popen::wait() noexcept(false)
10681065
return 0;
10691066
#else
10701067
int ret, status;
1071-
std::tie(ret, status) = util::wait_for_child_exit(pid());
1068+
std::tie(ret, status) = util::wait_for_child_exit(child_pid_);
10721069
if (ret == -1) {
10731070
if (errno != ECHILD) throw OSError("waitpid failed", errno);
10741071
return 0;

0 commit comments

Comments
 (0)