diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2016-04-05 10:26:06 +0200 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2016-04-05 10:30:28 +0200 |
commit | 41abcc5825d33d78bd370997ba664e3c64eb6683 (patch) | |
tree | 5d69acdb43f4b1a415e2d870a18ff18675f0c9df /winsup/cygwin/pinfo.cc | |
parent | 722e363c4de410e67f24d0da3129c446074716bc (diff) | |
download | cygnal-41abcc5825d33d78bd370997ba664e3c64eb6683.tar.gz cygnal-41abcc5825d33d78bd370997ba664e3c64eb6683.tar.bz2 cygnal-41abcc5825d33d78bd370997ba664e3c64eb6683.zip |
Revert "Refactor to avoid nonnull checks on "this" pointer."
This reverts commit 0008bdea02b690ab19ffe997499cb9a96ee5a66d.
This patch introduced a regression. Calling FOO=$(...) in zsh hangs
indefinitely and has to be killed forcefully.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/pinfo.cc')
-rw-r--r-- | winsup/cygwin/pinfo.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index e6ceba8c1..d4b2afb3d 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -514,7 +514,7 @@ _pinfo::set_ctty (fhandler_termios *fh, int flags) bool __reg1 _pinfo::exists () { - return process_state && !(process_state & (PID_EXITED | PID_REAPED | PID_EXECED)); + return this && process_state && !(process_state & (PID_EXITED | PID_REAPED | PID_EXECED)); } bool @@ -685,7 +685,7 @@ _pinfo::commune_request (__uint32_t code, ...) res.s = NULL; res.n = 0; - if (!pid) + if (!this || !pid) { set_errno (ESRCH); goto err; @@ -783,7 +783,7 @@ out: fhandler_pipe * _pinfo::pipe_fhandler (int64_t unique_id, size_t &n) { - if (!pid) + if (!this || !pid) return NULL; if (pid == myself->pid) return NULL; @@ -796,7 +796,7 @@ char * _pinfo::fd (int fd, size_t &n) { char *s; - if (!pid) + if (!this || !pid) return NULL; if (pid != myself->pid) { @@ -820,7 +820,7 @@ char * _pinfo::fds (size_t &n) { char *s; - if (!pid) + if (!this || !pid) return NULL; if (pid != myself->pid) { @@ -848,7 +848,7 @@ char * _pinfo::root (size_t& n) { char *s; - if (!pid) + if (!this || !pid) return NULL; if (pid != myself->pid && !ISSTATE (this, PID_NOTCYGWIN)) { @@ -893,7 +893,7 @@ char * _pinfo::cwd (size_t& n) { char *s = NULL; - if (!pid) + if (!this || !pid) return NULL; if (ISSTATE (this, PID_NOTCYGWIN)) { @@ -939,7 +939,7 @@ char * _pinfo::cmdline (size_t& n) { char *s = NULL; - if (!pid) + if (!this || !pid) return NULL; if (ISSTATE (this, PID_NOTCYGWIN)) { |