diff options
author | Guillem Jover <guillem@debian.org> | 2009-11-07 00:30:16 +0100 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2009-11-07 18:15:00 +0100 |
commit | a720b6aec5ab71211067cfd0250b57efa0aa18f9 (patch) | |
tree | 6ef87ce1935491413c8552ad53350aac1cdf4007 /dselect | |
parent | d5388296797726e34abe13031dcbdd302319b908 (diff) | |
download | dpkg-a720b6aec5ab71211067cfd0250b57efa0aa18f9.tar.gz |
Use subproc_wait instead of directly calling waitpid
Diffstat (limited to 'dselect')
-rw-r--r-- | dselect/method.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/dselect/method.cc b/dselect/method.cc index 4f1c8b1f5..5f39663e7 100644 --- a/dselect/method.cc +++ b/dselect/method.cc @@ -138,7 +138,7 @@ static enum urqresult lockmethod(void) { urqresult falliblesubprocess(const char *exepath, const char *name, const char *const *args) { - pid_t c1, cr; + pid_t c1; int status, i, c; cursesoff(); @@ -151,10 +151,7 @@ urqresult falliblesubprocess(const char *exepath, const char *name, ohshite(_("unable to run %.250s process `%.250s'"),name,exepath); } - while ((cr= waitpid(c1,&status,0)) == -1) - if (errno != EINTR) ohshite(_("unable to wait for %.250s"),name); - if (cr != c1) - ohshit(_("got wrong child's status - asked for %ld, got %ld"),(long)c1,(long)cr); + status = subproc_wait(c1, name); pop_cleanup(ehflag_normaltidy); |